Message ID | 20230611225702.891856-4-andi.shyti@kernel.org |
---|---|
State | New |
Headers | show |
Series | i2c: busses: Use devm_clk_get_enabled() | expand |
On Mon, Jun 12, 2023 at 12:56:50AM +0200, Andi Shyti wrote: > Replace the pair of functions, devm_clk_get() and > clk_prepare_enable(), with a single function > devm_clk_get_enabled(). > > Signed-off-by: Andi Shyti <andi.shyti@kernel.org> > Cc: Codrin Ciubotariu <codrin.ciubotariu@microchip.com> > Cc: Nicolas Ferre <nicolas.ferre@microchip.com> > Cc: Alexandre Belloni <alexandre.belloni@bootlin.com> > Cc: Claudiu Beznea <claudiu.beznea@microchip.com> Nicolas, did you find a new maintainer for this driver?
Wolfram, On 23/06/2023 at 12:23, Wolfram Sang wrote: > > On Mon, Jun 12, 2023 at 12:56:50AM +0200, Andi Shyti wrote: >> Replace the pair of functions, devm_clk_get() and >> clk_prepare_enable(), with a single function >> devm_clk_get_enabled(). >> >> Signed-off-by: Andi Shyti<andi.shyti@kernel.org> >> Cc: Codrin Ciubotariu<codrin.ciubotariu@microchip.com> >> Cc: Nicolas Ferre<nicolas.ferre@microchip.com> >> Cc: Alexandre Belloni<alexandre.belloni@bootlin.com> >> Cc: Claudiu Beznea<claudiu.beznea@microchip.com> > Nicolas, did you find a new maintainer for this driver? You can contact Durai in "to" of this email. I can have a look if needed as well. Thanks for the heads-up! Best regards, Nicolas
On 12/06/2023 at 00:56, Andi Shyti wrote: > Replace the pair of functions, devm_clk_get() and > clk_prepare_enable(), with a single function > devm_clk_get_enabled(). > > Signed-off-by: Andi Shyti <andi.shyti@kernel.org> > Cc: Codrin Ciubotariu <codrin.ciubotariu@microchip.com> > Cc: Nicolas Ferre <nicolas.ferre@microchip.com> Looks good to me: Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> Best regards, Nicolas > Cc: Alexandre Belloni <alexandre.belloni@bootlin.com> > Cc: Claudiu Beznea <claudiu.beznea@microchip.com> > --- > drivers/i2c/busses/i2c-at91-core.c | 8 ++------ > 1 file changed, 2 insertions(+), 6 deletions(-) > > diff --git a/drivers/i2c/busses/i2c-at91-core.c b/drivers/i2c/busses/i2c-at91-core.c > index 05ad3bc3578ac..2251e0deed29c 100644 > --- a/drivers/i2c/busses/i2c-at91-core.c > +++ b/drivers/i2c/busses/i2c-at91-core.c > @@ -226,12 +226,11 @@ static int at91_twi_probe(struct platform_device *pdev) > > platform_set_drvdata(pdev, dev); > > - dev->clk = devm_clk_get(dev->dev, NULL); > + dev->clk = devm_clk_get_enabled(dev->dev, NULL); > if (IS_ERR(dev->clk)) { > - dev_err(dev->dev, "no clock defined\n"); > + dev_err(dev->dev, "failed to enable clock\n"); > return -ENODEV; > } > - clk_prepare_enable(dev->clk); > > snprintf(dev->adapter.name, sizeof(dev->adapter.name), "AT91"); > i2c_set_adapdata(&dev->adapter, dev); > @@ -260,8 +259,6 @@ static int at91_twi_probe(struct platform_device *pdev) > > rc = i2c_add_numbered_adapter(&dev->adapter); > if (rc) { > - clk_disable_unprepare(dev->clk); > - > pm_runtime_disable(dev->dev); > pm_runtime_set_suspended(dev->dev); > > @@ -278,7 +275,6 @@ static void at91_twi_remove(struct platform_device *pdev) > struct at91_twi_dev *dev = platform_get_drvdata(pdev); > > i2c_del_adapter(&dev->adapter); > - clk_disable_unprepare(dev->clk); > > pm_runtime_disable(dev->dev); > pm_runtime_set_suspended(dev->dev); > -- > 2.40.1 >
On Mon, Jun 12, 2023 at 12:56:50AM +0200, Andi Shyti wrote: > Replace the pair of functions, devm_clk_get() and > clk_prepare_enable(), with a single function > devm_clk_get_enabled(). > > Signed-off-by: Andi Shyti <andi.shyti@kernel.org> > Cc: Codrin Ciubotariu <codrin.ciubotariu@microchip.com> > Cc: Nicolas Ferre <nicolas.ferre@microchip.com> > Cc: Alexandre Belloni <alexandre.belloni@bootlin.com> > Cc: Claudiu Beznea <claudiu.beznea@microchip.com> Applied to for-next, thanks!
diff --git a/drivers/i2c/busses/i2c-at91-core.c b/drivers/i2c/busses/i2c-at91-core.c index 05ad3bc3578ac..2251e0deed29c 100644 --- a/drivers/i2c/busses/i2c-at91-core.c +++ b/drivers/i2c/busses/i2c-at91-core.c @@ -226,12 +226,11 @@ static int at91_twi_probe(struct platform_device *pdev) platform_set_drvdata(pdev, dev); - dev->clk = devm_clk_get(dev->dev, NULL); + dev->clk = devm_clk_get_enabled(dev->dev, NULL); if (IS_ERR(dev->clk)) { - dev_err(dev->dev, "no clock defined\n"); + dev_err(dev->dev, "failed to enable clock\n"); return -ENODEV; } - clk_prepare_enable(dev->clk); snprintf(dev->adapter.name, sizeof(dev->adapter.name), "AT91"); i2c_set_adapdata(&dev->adapter, dev); @@ -260,8 +259,6 @@ static int at91_twi_probe(struct platform_device *pdev) rc = i2c_add_numbered_adapter(&dev->adapter); if (rc) { - clk_disable_unprepare(dev->clk); - pm_runtime_disable(dev->dev); pm_runtime_set_suspended(dev->dev); @@ -278,7 +275,6 @@ static void at91_twi_remove(struct platform_device *pdev) struct at91_twi_dev *dev = platform_get_drvdata(pdev); i2c_del_adapter(&dev->adapter); - clk_disable_unprepare(dev->clk); pm_runtime_disable(dev->dev); pm_runtime_set_suspended(dev->dev);
Replace the pair of functions, devm_clk_get() and clk_prepare_enable(), with a single function devm_clk_get_enabled(). Signed-off-by: Andi Shyti <andi.shyti@kernel.org> Cc: Codrin Ciubotariu <codrin.ciubotariu@microchip.com> Cc: Nicolas Ferre <nicolas.ferre@microchip.com> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com> Cc: Claudiu Beznea <claudiu.beznea@microchip.com> --- drivers/i2c/busses/i2c-at91-core.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)