Quoting Uwe Kleine-König (2018-11-13 01:52:10)
> 
> I wonder if it would make sense to introduce functions like:
> 
>         struct clk *clk_get_optional(struct device *dev, const char *id)
> 
> that return NULL instead of ERR_PTR(-ENODEV).
> 
> Then the above would simplify to:
> 
>         pc->clks[i] = devm_clk_get_optional(&pdev->dev, mtk_pwm_clk_name[i]);
>         if (IS_ERR(pc->clks[i]) {
>                 if (PTR_ERR(pc->clks[i]) == -EPROBE_DEFER)
>                         dev_err(...);
>                 return PTR_ERR(pc->clks[i]);
>         }
> 
> (added the clk people to Cc for this question).
> 

Such a patch is already on the list and not getting much review.

http://lkml.kernel.org/r/1535724443-21150-1-git-send-email-phil.edwor...@renesas.com

Reply via email to