Re: [PATCH] pwm: sun4i: Propagate errors in .get_state() to the caller

Samuel Holland
2022-12-03T01:57:37Z

On 12/1/22 09:22, Andre Przywara wrote:
> .get_state() can return an error indication now. Make use of it to
> propagate an impossible prescaler encoding, should that have sneaked in
> somehow.
> Also check the return value of clk_get_rate(). That's unlikely to fail,
> but we use that in two divide operations down in the code, so let's
> avoid a divide-by-zero condition on the way.
>
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> ---
> Hi,
>
> this goes on top of Uwe's series to introduce and observe .get_state
> failures: https://lore.kernel.org/linux-pwm/20221130152148.2769768-12-u.kleine-koenig@pengutronix.de/T/#m9af39aa03bbd9bb7b31b3600f110c65ee0e8e70b
> Actually it only relies on patch 01/11 from that.
>
> Cheers,
> Andre
>
> drivers/pwm/pwm-sun4i.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)

Reviewed-by: Samuel Holland <samuel@sholland.org>