[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZsijIGTtHynR_jrm@smile.fi.intel.com>
Date: Fri, 23 Aug 2024 17:56:32 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Ye Zhang <ye.zhang@...k-chips.com>
Cc: linus.walleij@...aro.org, brgl@...ev.pl, heiko@...ech.de,
linux-gpio@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-rockchip@...ts.infradead.org, linux-kernel@...r.kernel.org,
mika.westerberg@...ux.intel.com, tao.huang@...k-chips.com,
finley.xiao@...k-chips.com, tim.chen@...k-chips.com,
elaine.zhang@...k-chips.com
Subject: Re: [PATCH v2] gpio: rockchip: support 'clock-names' from dt nodes
On Fri, Aug 23, 2024 at 11:43:10AM +0800, Ye Zhang wrote:
> Added support for retrieving clocks using 'clock-names' from dt nodes
...
> + bank->clk = devm_clk_get(dev, "bus");
> + if (IS_ERR(bank->clk)) {
> + bank->clk = of_clk_get(dev->of_node, 0);
> + if (IS_ERR(bank->clk)) {
> + dev_err(dev, "fail to get apb clock\n");
> + return PTR_ERR(bank->clk);
return dev_err_probe(...);
> + }
> + }
...
> + clk_prepare_enable(bank->clk);
> + clk_prepare_enable(bank->db_clk);
Any of this may fail. You perhaps want
bank->...clk = devm_clk_get_enabled(dev, "...");
Not sure for the fallback case (of_clk_get() should be killed as we almost done
in GPIO library for GPIO APIs).
...
> +err_unlock:
> + mutex_unlock(&bank->deferred_lock);
Don't you want to use guard()/scoped_guard() at some point?
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists