Re: [PATCH] hwrng: meson - Improve error handling for core clock

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Uwe,

On Tue, Sep 14, 2021 at 4:24 PM Uwe Kleine-König
<u.kleine-koenig@xxxxxxxxxxxxxx> wrote:
[...]
> -       data->core_clk = devm_clk_get(dev, "core");
> -       if (IS_ERR(data->core_clk))
> -               data->core_clk = NULL;
> +       data->core_clk = devm_clk_get_optional(dev, "core");
> +       if (IS_ERR(data->core_clk)) {
> +               ret = PTR_ERR(data->core_clk);
> +               if (ret != -EPROBE_DEFER)
> +                       dev_err(dev, "Failed to get core clock: %pe\n",
> +                               data->core_clk);
> +
> +               return ret;
I suggest simplifying this by using dev_err_probe as this:
- allows you to get rid of the if (ret != -EPROBE_DEFER)
- means that the message is shown in debugfs' "devices_deferred"


Best regards,
Martin




[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux