On Wed, Mar 24, 2021 at 09:22:32PM +0100, Uwe Kleine-König wrote: > On Wed, Mar 24, 2021 at 09:12:23PM +0100, Uwe Kleine-König wrote: > > devm_clk_get_prepared returns the clk already prepared and the > > automatically called cleanup cares for unpreparing. So simplify .probe > > and .remove accordingly. > > > > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx> > > --- > > Hello, > > > > this simplification depends on a patch set that introduces > > devm_clk_get_prepared() and friends. > > > > The most recent version of this patch set can be found at > > > > https://lore.kernel.org/r/20210301135053.1462168-1-u.kleine-koenig@xxxxxxxxxxxxxx > > > > Unfortunately I didn't get any feedback at all from the clk maintainers > > on it, so I try to make other maintainers aware of it in the expectation > > that the simplifications are welcome and so lure the clk maintainers to > > share their thoughts. > > > > Best regards > > Uwe > > > > drivers/i2c/busses/i2c-imx.c | 11 ++--------- > > 1 file changed, 2 insertions(+), 9 deletions(-) > > > > diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c > > index b80fdc1f0092..c0e18a6caa38 100644 > > --- a/drivers/i2c/busses/i2c-imx.c > > +++ b/drivers/i2c/busses/i2c-imx.c > > @@ -1405,16 +1405,10 @@ static int i2c_imx_probe(struct platform_device *pdev) > > ACPI_COMPANION_SET(&i2c_imx->adapter.dev, ACPI_COMPANION(&pdev->dev)); > > > > /* Get I2C clock */ > > - i2c_imx->clk = devm_clk_get(&pdev->dev, NULL); > > + i2c_imx->clk = devm_clk_get_prepared(&pdev->dev, NULL); > > oops, I got that wrong, this must be devm_clk_get_enabled, not > devm_clk_get_prepared. So if the clk patches go in, please let me resend > a fixed patch (or adapt yourself, whatever you prefer). Hi, please send fixed version :) regards, Oleksij -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |