mbox series

[0/3] iio: adc: ad7124: Fixes and devm_ for all of probe

Message ID 20210508182319.488551-1-jic23@kernel.org (mailing list archive)
Headers show
Series iio: adc: ad7124: Fixes and devm_ for all of probe | expand

Message

Jonathan Cameron May 8, 2021, 6:23 p.m. UTC
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

I noticed an issue around regulator error handling and managed to
hit another with my hacked together test setup.  Hence let's fix
those two issues first then we might as well follow up by converting
the last few bits of this driver to use device managed functions so
we can simplify the error handling and cleanup.

Testing conducted with QEMU hacking and insertion of errors at relevant
locations in the code.

Jonathan Cameron (3):
  iio: adc: ad7124: Fix missbalanced regulator enable / disable on
    error.
  iio: adc: ad7124: Fix potential overflow due to non sequential channel
    numbers
  iio: adc: ad7124: Use devm_ managed calls for all of probe() + drop
    remove()

 drivers/iio/adc/ad7124.c | 89 ++++++++++++++++++++--------------------
 1 file changed, 44 insertions(+), 45 deletions(-)

Comments

Alexandru Ardelean May 9, 2021, 7:31 a.m. UTC | #1
On Sat, May 8, 2021 at 9:24 PM Jonathan Cameron <jic23@kernel.org> wrote:
>
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> I noticed an issue around regulator error handling and managed to
> hit another with my hacked together test setup.  Hence let's fix
> those two issues first then we might as well follow up by converting
> the last few bits of this driver to use device managed functions so
> we can simplify the error handling and cleanup.
>
> Testing conducted with QEMU hacking and insertion of errors at relevant
> locations in the code.

I guess the devm_ cleanup didn't catch-on much with others.
It means I'll probably resume it :)

>
> Jonathan Cameron (3):
>   iio: adc: ad7124: Fix missbalanced regulator enable / disable on
>     error.
>   iio: adc: ad7124: Fix potential overflow due to non sequential channel
>     numbers
>   iio: adc: ad7124: Use devm_ managed calls for all of probe() + drop
>     remove()
>
>  drivers/iio/adc/ad7124.c | 89 ++++++++++++++++++++--------------------
>  1 file changed, 44 insertions(+), 45 deletions(-)
>
> --
> 2.31.1
>
Jonathan Cameron May 9, 2021, 9:35 a.m. UTC | #2
On Sun, 9 May 2021 10:31:59 +0300
Alexandru Ardelean <ardeleanalex@gmail.com> wrote:

> On Sat, May 8, 2021 at 9:24 PM Jonathan Cameron <jic23@kernel.org> wrote:
> >
> > From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> >
> > I noticed an issue around regulator error handling and managed to
> > hit another with my hacked together test setup.  Hence let's fix
> > those two issues first then we might as well follow up by converting
> > the last few bits of this driver to use device managed functions so
> > we can simplify the error handling and cleanup.
> >
> > Testing conducted with QEMU hacking and insertion of errors at relevant
> > locations in the code.  
> 
> I guess the devm_ cleanup didn't catch-on much with others.
> It means I'll probably resume it :)

It's a fun one for when you have 20 mins left at the end of a day.

Though less fun when you then hit a random memory corruption bug and
loose an hour :(

Jonathan

> 
> >
> > Jonathan Cameron (3):
> >   iio: adc: ad7124: Fix missbalanced regulator enable / disable on
> >     error.
> >   iio: adc: ad7124: Fix potential overflow due to non sequential channel
> >     numbers
> >   iio: adc: ad7124: Use devm_ managed calls for all of probe() + drop
> >     remove()
> >
> >  drivers/iio/adc/ad7124.c | 89 ++++++++++++++++++++--------------------
> >  1 file changed, 44 insertions(+), 45 deletions(-)
> >
> > --
> > 2.31.1
> >