aboutsummaryrefslogtreecommitdiff
path: root/drivers/rng
diff options
context:
space:
mode:
authorSean Anderson2022-01-15 15:52:47 -0500
committerSean Anderson2022-02-25 01:41:04 -0500
commite96e2132f977aab738994c11162b14695029be6e (patch)
tree5a16211b6c2812f67a81083d85bd11d31a672e19 /drivers/rng
parenta0abea867a0d344d8e5290adf6380903b0f52e0f (diff)
clk: Add clk_get_by_name_optional
This adds a helper function for clk_get_by_name in cases where the clock is optional. Hopefully this helps point driver writers in the right direction. Also convert some existing users. Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Neil Armstrong <narmstrong@baylibre.com> Reviewed-by: Simon Glass <sjg@chromium.org> Link: https://lore.kernel.org/r/20220115205247.566210-2-seanga2@gmail.com
Diffstat (limited to 'drivers/rng')
-rw-r--r--drivers/rng/meson-rng.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/rng/meson-rng.c b/drivers/rng/meson-rng.c
index 5a4f45ad5af..e0a1e8c7e04 100644
--- a/drivers/rng/meson-rng.c
+++ b/drivers/rng/meson-rng.c
@@ -91,8 +91,8 @@ static int meson_rng_of_to_plat(struct udevice *dev)
return -ENODEV;
/* Get optional "core" clock */
- err = clk_get_by_name(dev, "core", &pdata->clk);
- if (err && err != -ENODATA)
+ err = clk_get_by_name_optional(dev, "core", &pdata->clk);
+ if (err)
return err;
return 0;