From: Alexandru Ardelean <aardelean@deviqon.com>
To: linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org
Cc: jic23@kernel.org, andreas@kemnade.info,
Alexandru Ardelean <aardelean@deviqon.com>
Subject: [PATCH] iio: adc: rn5t618-adc: use devm_iio_map_array_register() function
Date: Sun, 26 Sep 2021 19:28:59 +0300 [thread overview]
Message-ID: <20210926162859.3567685-1-aardelean@deviqon.com> (raw)
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
next reply other threads:[~2021-09-26 16:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-26 16:28 Alexandru Ardelean [this message]
2021-09-27 20:08 ` [PATCH] iio: adc: rn5t618-adc: use devm_iio_map_array_register() function Andreas Kemnade
2021-09-30 16:15 ` Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210926162859.3567685-1-aardelean@deviqon.com \
--to=aardelean@deviqon.com \
--cc=andreas@kemnade.info \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox