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

Martin Blumenstingl martin.blumenstingl at googlemail.com
Sun Sep 19 13:07:15 PDT 2021


Hi Uwe,

On Tue, Sep 14, 2021 at 4:24 PM Uwe Kleine-König
<u.kleine-koenig at pengutronix.de> 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



More information about the linux-arm-kernel mailing list