* [PATCH] iio: adc: rn5t618-adc: use devm_iio_map_array_register() function
@ 2021-09-26 16:28 Alexandru Ardelean
2021-09-27 20:08 ` Andreas Kemnade
0 siblings, 1 reply; 3+ messages in thread
From: Alexandru Ardelean @ 2021-09-26 16:28 UTC (permalink / raw)
To: linux-kernel, linux-iio; +Cc: jic23, andreas, Alexandru Ardelean
This driver already hooks a similar unwind callback via
devm_add_action_or_reset().
They pretty much do the same thing, so this change converts it to the
devm_iio_map_array_register().
Signed-off-by: Alexandru Ardelean <aardelean@deviqon.com>
---
drivers/iio/adc/rn5t618-adc.c | 13 +------------
1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/drivers/iio/adc/rn5t618-adc.c b/drivers/iio/adc/rn5t618-adc.c
index c56fccb2c8e1..7d891b4ea461 100644
--- a/drivers/iio/adc/rn5t618-adc.c
+++ b/drivers/iio/adc/rn5t618-adc.c
@@ -197,13 +197,6 @@ static struct iio_map rn5t618_maps[] = {
{ /* sentinel */ }
};
-static void unregister_map(void *data)
-{
- struct iio_dev *iio_dev = (struct iio_dev *) data;
-
- iio_map_array_unregister(iio_dev);
-}
-
static int rn5t618_adc_probe(struct platform_device *pdev)
{
int ret;
@@ -254,11 +247,7 @@ static int rn5t618_adc_probe(struct platform_device *pdev)
return ret;
}
- ret = iio_map_array_register(iio_dev, rn5t618_maps);
- if (ret < 0)
- return ret;
-
- ret = devm_add_action_or_reset(adc->dev, unregister_map, iio_dev);
+ ret = devm_iio_map_array_register(adc->dev, iio_dev, rn5t618_maps);
if (ret < 0)
return ret;
--
2.31.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] iio: adc: rn5t618-adc: use devm_iio_map_array_register() function
2021-09-26 16:28 [PATCH] iio: adc: rn5t618-adc: use devm_iio_map_array_register() function Alexandru Ardelean
@ 2021-09-27 20:08 ` Andreas Kemnade
2021-09-30 16:15 ` Jonathan Cameron
0 siblings, 1 reply; 3+ messages in thread
From: Andreas Kemnade @ 2021-09-27 20:08 UTC (permalink / raw)
To: Alexandru Ardelean; +Cc: linux-kernel, linux-iio, jic23
On Sun, 26 Sep 2021 19:28:59 +0300
Alexandru Ardelean <aardelean@deviqon.com> wrote:
> This driver already hooks a similar unwind callback via
> devm_add_action_or_reset().
>
> They pretty much do the same thing, so this change converts it to the
> devm_iio_map_array_register().
>
> Signed-off-by: Alexandru Ardelean <aardelean@deviqon.com>
> ---
> drivers/iio/adc/rn5t618-adc.c | 13 +------------
> 1 file changed, 1 insertion(+), 12 deletions(-)
yes, looks sane, the patches it depens on are not in linux-next yet.
But it seems that they are accepted, so:
Reviewed-by: Andreas Kemnade <andreas@kemnade.info>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] iio: adc: rn5t618-adc: use devm_iio_map_array_register() function
2021-09-27 20:08 ` Andreas Kemnade
@ 2021-09-30 16:15 ` Jonathan Cameron
0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2021-09-30 16:15 UTC (permalink / raw)
To: Andreas Kemnade; +Cc: Alexandru Ardelean, linux-kernel, linux-iio
On Mon, 27 Sep 2021 22:08:34 +0200
Andreas Kemnade <andreas@kemnade.info> wrote:
> On Sun, 26 Sep 2021 19:28:59 +0300
> Alexandru Ardelean <aardelean@deviqon.com> wrote:
>
> > This driver already hooks a similar unwind callback via
> > devm_add_action_or_reset().
> >
> > They pretty much do the same thing, so this change converts it to the
> > devm_iio_map_array_register().
> >
> > Signed-off-by: Alexandru Ardelean <aardelean@deviqon.com>
> > ---
> > drivers/iio/adc/rn5t618-adc.c | 13 +------------
> > 1 file changed, 1 insertion(+), 12 deletions(-)
>
> yes, looks sane, the patches it depens on are not in linux-next yet.
I was waiting for 0-day confirmation which for some reason has gone astray
(not problems reported either). Ah well - I'll assume it's fine and
risk next breakage.
> But it seems that they are accepted, so:
>
> Reviewed-by: Andreas Kemnade <andreas@kemnade.info>
Thanks and applied to the togreg branch of iio.git, pushed out as testing to
see if 0-day notices this time.
Thanks,
Jonathan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-09-30 16:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-26 16:28 [PATCH] iio: adc: rn5t618-adc: use devm_iio_map_array_register() function Alexandru Ardelean
2021-09-27 20:08 ` Andreas Kemnade
2021-09-30 16:15 ` Jonathan Cameron
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.