hwrng: meson - Improve error handling for core clock
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Mon, 20 Sep 2021 07:44:05 +0000 (09:44 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 1 Oct 2021 06:41:23 +0000 (14:41 +0800)
commitf7324d4ba9e846e96ac85fbe74afe3fbdacf3b75
treeeb4a8f1db2b91f1df2cc8a360247098ef3ec5364
parentadad556efcdd42a1d9e060cbe5f6161cccf1fa28
hwrng: meson - Improve error handling for core clock

-ENOENT (ie. "there is no clock") is fine to ignore for an optional
clock, other values are not supposed to be ignored and should be
escalated to the caller (e.g. -EPROBE_DEFER). Ignore -ENOENT by using
devm_clk_get_optional().

While touching this code also add an error message for the fatal errors.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/char/hw_random/meson-rng.c