Skip to content

Commit 8d53427

Browse files
M-Vaittinenjic23
authored andcommitted
iio: adc: ti-ads7924 Drop unnecessary function parameters
Device pointer is the only variable which is used by the ads7924_get_channels_config() and which is declared outside this function. Still, the function gets the iio_device and i2c_client as parameters. The sole caller of this function (probe) already has the device pointer which it can directly pass to the function. Simplify code by passing the device pointer directly as a parameter instead of digging it from the iio_device's private data. Signed-off-by: Matti Vaittinen <[email protected]> Link: https://patch.msgid.link/2bb4c61122eca2f3a35f6087e7d9815675013f66.1740993491.git.mazziesaccount@gmail.com Signed-off-by: Jonathan Cameron <[email protected]>
1 parent cc26591 commit 8d53427

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

drivers/iio/adc/ti-ads7924.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -251,11 +251,8 @@ static const struct iio_info ads7924_info = {
251251
.read_raw = ads7924_read_raw,
252252
};
253253

254-
static int ads7924_get_channels_config(struct i2c_client *client,
255-
struct iio_dev *indio_dev)
254+
static int ads7924_get_channels_config(struct device *dev)
256255
{
257-
struct ads7924_data *priv = iio_priv(indio_dev);
258-
struct device *dev = priv->dev;
259256
struct fwnode_handle *node;
260257
int num_channels = 0;
261258

@@ -380,7 +377,7 @@ static int ads7924_probe(struct i2c_client *client)
380377
indio_dev->num_channels = ARRAY_SIZE(ads7924_channels);
381378
indio_dev->info = &ads7924_info;
382379

383-
ret = ads7924_get_channels_config(client, indio_dev);
380+
ret = ads7924_get_channels_config(dev);
384381
if (ret < 0)
385382
return dev_err_probe(dev, ret,
386383
"failed to get channels configuration\n");

0 commit comments

Comments
 (0)