On Tue, May 08, 2018 at 11:44:57AM +0200, Christian Gromm wrote:
> This patch prevents the driver from falling back to polling mode
> in case of IRQ misconfiguration.
> 
> Signed-off-by: Christian Gromm <christian.gr...@microchip.com>
> ---
>  drivers/staging/most/i2c/i2c.c | 18 ++++++++++--------
>  1 file changed, 10 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/staging/most/i2c/i2c.c b/drivers/staging/most/i2c/i2c.c
> index a993e8e..e03cb6c 100644
> --- a/drivers/staging/most/i2c/i2c.c
> +++ b/drivers/staging/most/i2c/i2c.c
> @@ -90,22 +90,24 @@ static int configure_channel(struct most_interface 
> *most_iface,
>       }
>  
>       if (channel_config->direction == MOST_CH_RX) {
> -             dev->polling_mode = polling_req || dev->client->irq <= 0;
> +             dev->polling_mode = polling_req;
>               if (!dev->polling_mode) {
> -                     pr_info("Requesting IRQ: %d\n", dev->client->irq);
> +                     if (dev->client->irq <= 0) {
> +                             pr_err("bad irq: %d\n", dev->client->irq);
> +                             return -ENOENT;
> +                     }

I was wondering about this at the time...  It would have been better to
fold this in with the earlier patch and it's pretty easy to fold patches
together with `git rebase -i`.

regards,
dan carpenter


_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to