[PATCH] soc: aspeed: lpc-ctrl: Block error printing on probe defer cases
Winiarska, Iwona
iwona.winiarska at intel.com
Thu Nov 4 10:05:27 AEDT 2021
On Wed, 2021-11-03 at 14:54 -0700, jae.hyun.yoo at intel.com wrote:
> From: Jae Hyun Yoo <jae.hyun.yoo at linux.intel.com>
>
> Add a checking code when it gets -EPROBE_DEFER while getting a clock
> resource. In this case, it doesn't need to print out an error message
> because the probing will be re-visited.
>
> Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo at linux.intel.com>
> ---
> drivers/soc/aspeed/aspeed-lpc-ctrl.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/soc/aspeed/aspeed-lpc-ctrl.c b/drivers/soc/aspeed/aspeed-
> lpc-ctrl.c
> index 72771e018c42..e2262dbc7cf6 100644
> --- a/drivers/soc/aspeed/aspeed-lpc-ctrl.c
> +++ b/drivers/soc/aspeed/aspeed-lpc-ctrl.c
> @@ -307,8 +307,10 @@ static int aspeed_lpc_ctrl_probe(struct platform_device
> *pdev)
>
> lpc_ctrl->clk = devm_clk_get(dev, NULL);
> if (IS_ERR(lpc_ctrl->clk)) {
> - dev_err(dev, "couldn't get clock\n");
> - return PTR_ERR(lpc_ctrl->clk);
> + rc = PTR_ERR(lpc_ctrl->clk);
> + if (rc != -EPROBE_DEFER)
> + dev_err(dev, "couldn't get clock\n");
> + return rc;
> }
> rc = clk_prepare_enable(lpc_ctrl->clk);
> if (rc) {
This pattern should be handled using dev_err_probe()
Thanks
-Iwona
More information about the Linux-aspeed
mailing list