[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240902222824.1145571-11-andy.shevchenko@gmail.com>
Date: Tue, 3 Sep 2024 01:16:55 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Jonathan Cameron <Jonathan.Cameron@...wei.com>,
David Lechner <dlechner@...libre.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Michael Hennerich <michael.hennerich@...log.com>,
Antoniu Miclaus <antoniu.miclaus@...log.com>,
Jinjie Ruan <ruanjinjie@...wei.com>,
Lorenzo Bianconi <lorenzo@...nel.org>,
Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>,
Basavaraj Natikar <Basavaraj.Natikar@....com>,
linux-input@...r.kernel.org,
linux-iio@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: Jiri Kosina <jikos@...nel.org>,
Jonathan Cameron <jic23@...nel.org>,
Lars-Peter Clausen <lars@...afoo.de>,
Michael Hennerich <Michael.Hennerich@...log.com>,
Andy Shevchenko <andy.shevchenko@...il.com>
Subject: [PATCH v1 10/22] iio: dac: max517: Get platform data via dev_get_platdata()
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Access to platform data via dev_get_platdata() getter to make code cleaner.
Signed-off-by: Andy Shevchenko <andy.shevchenko@...il.com>
---
drivers/iio/dac/max517.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iio/dac/max517.c b/drivers/iio/dac/max517.c
index 685980184d3c..96781ae04f9d 100644
--- a/drivers/iio/dac/max517.c
+++ b/drivers/iio/dac/max517.c
@@ -143,10 +143,10 @@ static const struct iio_chan_spec max517_channels[] = {
static int max517_probe(struct i2c_client *client)
{
+ const struct max517_platform_data *platform_data = dev_get_platdata(&client->dev);
const struct i2c_device_id *id = i2c_client_get_device_id(client);
struct max517_data *data;
struct iio_dev *indio_dev;
- struct max517_platform_data *platform_data = client->dev.platform_data;
int chan;
indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*data));
@@ -176,7 +176,7 @@ static int max517_probe(struct i2c_client *client)
/*
* Reference voltage on MAX518 and default is 5V, else take vref_mv
- * from platform_data
+ * from platform_data.
*/
for (chan = 0; chan < indio_dev->num_channels; chan++) {
if (id->driver_data == ID_MAX518 || !platform_data)
--
2.46.0
Powered by blists - more mailing lists