diff mbox series

iio: mma8452: Use correct type for return variable in IRQ handler

Message ID 20211101102734.32291-1-lars@metafoo.de (mailing list archive)
State Accepted
Headers show
Series iio: mma8452: Use correct type for return variable in IRQ handler | expand

Commit Message

Lars-Peter Clausen Nov. 1, 2021, 10:27 a.m. UTC
The IRQ handler's return type is irqreturn_t. The mma8452 uses a variable
to store the return value, but the variable is of type int. Change this to
irqreturn_t. This makes it easier to verify that the code is correct.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 drivers/iio/accel/mma8452.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andy Shevchenko Nov. 1, 2021, 10:37 a.m. UTC | #1
On Mon, Nov 1, 2021 at 12:28 PM Lars-Peter Clausen <lars@metafoo.de> wrote:
>
> The IRQ handler's return type is irqreturn_t. The mma8452 uses a variable
> to store the return value, but the variable is of type int. Change this to
> irqreturn_t. This makes it easier to verify that the code is correct.

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
> ---
>  drivers/iio/accel/mma8452.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c
> index 09c7f10fefb6..64b82b4503ad 100644
> --- a/drivers/iio/accel/mma8452.c
> +++ b/drivers/iio/accel/mma8452.c
> @@ -1053,7 +1053,7 @@ static irqreturn_t mma8452_interrupt(int irq, void *p)
>  {
>         struct iio_dev *indio_dev = p;
>         struct mma8452_data *data = iio_priv(indio_dev);
> -       int ret = IRQ_NONE;
> +       irqreturn_t ret = IRQ_NONE;
>         int src;
>
>         src = i2c_smbus_read_byte_data(data->client, MMA8452_INT_SRC);
> --
> 2.20.1
>
Jonathan Cameron Nov. 3, 2021, 6:22 p.m. UTC | #2
On Mon, 1 Nov 2021 12:37:19 +0200
Andy Shevchenko <andy.shevchenko@gmail.com> wrote:

> On Mon, Nov 1, 2021 at 12:28 PM Lars-Peter Clausen <lars@metafoo.de> wrote:
> >
> > The IRQ handler's return type is irqreturn_t. The mma8452 uses a variable
> > to store the return value, but the variable is of type int. Change this to
> > irqreturn_t. This makes it easier to verify that the code is correct.  
> 
> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Applied. Thanks,
> 
> > Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
> > ---
> >  drivers/iio/accel/mma8452.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c
> > index 09c7f10fefb6..64b82b4503ad 100644
> > --- a/drivers/iio/accel/mma8452.c
> > +++ b/drivers/iio/accel/mma8452.c
> > @@ -1053,7 +1053,7 @@ static irqreturn_t mma8452_interrupt(int irq, void *p)
> >  {
> >         struct iio_dev *indio_dev = p;
> >         struct mma8452_data *data = iio_priv(indio_dev);
> > -       int ret = IRQ_NONE;
> > +       irqreturn_t ret = IRQ_NONE;
> >         int src;
> >
> >         src = i2c_smbus_read_byte_data(data->client, MMA8452_INT_SRC);
> > --
> > 2.20.1
> >  
> 
>
diff mbox series

Patch

diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c
index 09c7f10fefb6..64b82b4503ad 100644
--- a/drivers/iio/accel/mma8452.c
+++ b/drivers/iio/accel/mma8452.c
@@ -1053,7 +1053,7 @@  static irqreturn_t mma8452_interrupt(int irq, void *p)
 {
 	struct iio_dev *indio_dev = p;
 	struct mma8452_data *data = iio_priv(indio_dev);
-	int ret = IRQ_NONE;
+	irqreturn_t ret = IRQ_NONE;
 	int src;
 
 	src = i2c_smbus_read_byte_data(data->client, MMA8452_INT_SRC);