Re: [PATCH] clocksource/drivers/sh_mtu2: Do not loop using platform_get_irq_by_name()

From: Daniel Lezcano
Date: Wed Oct 16 2019 - 11:06:45 EST


On 16/10/2019 16:30, Geert Uytterhoeven wrote:
> As platform_get_irq_by_name() now prints an error when the interrupt
> does not exist, looping over possibly non-existing interrupts causes the
> printing of scary messages like:
>
> sh_mtu2 fcff0000.timer: IRQ tgi1a not found
> sh_mtu2 fcff0000.timer: IRQ tgi2a not found
>
> Fix this by using the platform_irq_count() helper, to avoid touching
> non-existent interrupts. Limit the returned number of interrupts to the
> maximum number of channels currently supported by the driver in a
> future-proof way, i.e. using ARRAY_SIZE() instead of a hardcoded number.
>
> Fixes: 7723f4c5ecdb8d83 ("driver core: platform: Add an error message to platform_get_irq*()")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>
> ---
> This is a fix for v5.4.
> ---

Applied, thanks!


--
<http://www.linaro.org/> Linaro.org â Open source software for ARM SoCs

Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog