Message ID | 20240828084115.967960-1-liyuesong@vivo.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [v1] net: ipa: make use of dev_err_cast_probe() | expand |
On 8/28/24 3:41 AM, Yuesong Li wrote: > Using dev_err_cast_probe() to simplify the code. > > Signed-off-by: Yuesong Li <liyuesong@vivo.com> > --- > drivers/net/ipa/ipa_power.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/net/ipa/ipa_power.c b/drivers/net/ipa/ipa_power.c > index 65fd14da0f86..248bcc0b661e 100644 > --- a/drivers/net/ipa/ipa_power.c > +++ b/drivers/net/ipa/ipa_power.c > @@ -243,9 +243,8 @@ ipa_power_init(struct device *dev, const struct ipa_power_data *data) > > clk = clk_get(dev, "core"); > if (IS_ERR(clk)) { > - dev_err_probe(dev, PTR_ERR(clk), "error getting core clock\n"); > - > - return ERR_CAST(clk); > + return dev_err_cast_probe(dev, clk, > + "error getting core clock\n"); This looks to me like a simple replacement with equivalent code. Reviewed-by: Alex Elder <elder@kernel.org> > } > > ret = clk_set_rate(clk, data->core_clock_rate);
diff --git a/drivers/net/ipa/ipa_power.c b/drivers/net/ipa/ipa_power.c index 65fd14da0f86..248bcc0b661e 100644 --- a/drivers/net/ipa/ipa_power.c +++ b/drivers/net/ipa/ipa_power.c @@ -243,9 +243,8 @@ ipa_power_init(struct device *dev, const struct ipa_power_data *data) clk = clk_get(dev, "core"); if (IS_ERR(clk)) { - dev_err_probe(dev, PTR_ERR(clk), "error getting core clock\n"); - - return ERR_CAST(clk); + return dev_err_cast_probe(dev, clk, + "error getting core clock\n"); } ret = clk_set_rate(clk, data->core_clock_rate);
Using dev_err_cast_probe() to simplify the code. Signed-off-by: Yuesong Li <liyuesong@vivo.com> --- drivers/net/ipa/ipa_power.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)