From: Abdelnasser Hussein <abdelnasserhussein11@gmail.com>
To: jic23@kernel.org, linux-iio@vger.kernel.org
Cc: dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org,
nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com,
claudiu.beznea@tuxon.dev, giorgitchankvetadze1997@gmail.com,
amin.gattout@gmail.com, antoniu.miclaus@analog.com,
gregkh@linuxfoundation.org, mripard@kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
Abdelnasser Hussein <abdelnasserhussein11@gmail.com>
Subject: [PATCH v5 6/8] iio: adc: at91_adc: pass struct device to at91_ts_register()
Date: Mon, 23 Nov 2026 09:00:59 +0200 [thread overview]
Message-ID: <20261123070101.53868-7-abdelnasserhussein11@gmail.com> (raw)
In-Reply-To: <20261123070101.53868-1-abdelnasserhussein11@gmail.com>
The at91_ts_register() helper only uses its platform_device argument to
obtain the parent struct device. Pass that device directly and simplify
the function signature and its call site.
Signed-off-by: Abdelnasser Hussein <abdelnasserhussein11@gmail.com>
---
drivers/iio/adc/at91_adc.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/iio/adc/at91_adc.c b/drivers/iio/adc/at91_adc.c
index 3d9ae99a2ce6..05e8b3deb043 100644
--- a/drivers/iio/adc/at91_adc.c
+++ b/drivers/iio/adc/at91_adc.c
@@ -925,8 +925,7 @@ static int at91_ts_hw_init(struct iio_dev *idev, u32 adc_clk_khz)
return 0;
}
-static int at91_ts_register(struct iio_dev *idev,
- struct platform_device *pdev)
+static int at91_ts_register(struct iio_dev *idev, struct device *dev)
{
struct at91_adc_state *st = iio_priv(idev);
struct input_dev *input;
@@ -940,7 +939,7 @@ static int at91_ts_register(struct iio_dev *idev,
input->name = DRIVER_NAME;
input->id.bustype = BUS_HOST;
- input->dev.parent = &pdev->dev;
+ input->dev.parent = dev;
input->open = atmel_ts_open;
input->close = atmel_ts_close;
@@ -955,7 +954,7 @@ static int at91_ts_register(struct iio_dev *idev,
input_set_abs_params(input, ABS_PRESSURE, 0, 0xffffff, 0, 0);
} else {
if (st->touchscreen_type != ATMEL_ADC_TOUCHSCREEN_4WIRE) {
- dev_err(&pdev->dev,
+ dev_err(dev,
"This touchscreen controller only support 4 wires\n");
ret = -EINVAL;
goto err;
@@ -1154,7 +1153,7 @@ static int at91_adc_probe(struct platform_device *pdev)
return ret;
}
} else {
- ret = at91_ts_register(idev, pdev);
+ ret = at91_ts_register(idev, dev);
if (ret)
return ret;
--
2.56.0
next prev parent reply other threads:[~2026-11-23 7:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-23 7:00 [PATCH v5 0/8] iio: adc: at91_adc: fix NULL trigger dereference and convert to devm Abdelnasser Hussein
2026-11-23 7:00 ` [PATCH v5 1/8] iio: adc: at91_adc: skip unpopulated triggers on teardown Abdelnasser Hussein
2026-11-23 7:00 ` [PATCH v5 2/8] iio: adc: at91_adc: drop duplicate IRQ allocation error message Abdelnasser Hussein
2026-11-23 7:00 ` [PATCH v5 3/8] iio: adc: at91_adc: switch to device_get_match_data() Abdelnasser Hussein
2026-11-23 7:00 ` [PATCH v5 4/8] iio: adc: at91_adc: convert to device_property_*() APIs Abdelnasser Hussein
2026-11-23 7:00 ` [PATCH v5 5/8] iio: adc: at91_adc: use local struct device pointer in probe Abdelnasser Hussein
2026-11-23 7:00 ` Abdelnasser Hussein [this message]
2026-11-23 7:01 ` [PATCH v5 7/8] iio: adc: at91_adc: use HZ_PER_KHZ instead of raw 1000 Abdelnasser Hussein
2026-11-23 7:01 ` [PATCH v5 8/8] iio: adc: at91_adc: convert to device-managed resources Abdelnasser Hussein
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=20261123070101.53868-7-abdelnasserhussein11@gmail.com \
--to=abdelnasserhussein11@gmail.com \
--cc=alexandre.belloni@bootlin.com \
--cc=amin.gattout@gmail.com \
--cc=andy@kernel.org \
--cc=antoniu.miclaus@analog.com \
--cc=claudiu.beznea@tuxon.dev \
--cc=dlechner@baylibre.com \
--cc=giorgitchankvetadze1997@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=jic23@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mripard@kernel.org \
--cc=nicolas.ferre@microchip.com \
--cc=nuno.sa@analog.com \
/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