diff mbox series

[2/3] iio: adc: max9611: Use of_device_get_match_data to simplify code

Message ID 20211019100013.27312-3-tangbin@cmss.chinamobile.com (mailing list archive)
State Changes Requested
Headers show
Series iio: Use of_device_get_match_data to clean code | expand

Commit Message

Tang Bin Oct. 19, 2021, 10 a.m. UTC
Retrieve OF match data, it's better and cleaner to use
'of_device_get_match_data' over 'of_match_device'.

Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
---
 drivers/iio/adc/max9611.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/drivers/iio/adc/max9611.c b/drivers/iio/adc/max9611.c
index 052ab23f1..4e754c072 100644
--- a/drivers/iio/adc/max9611.c
+++ b/drivers/iio/adc/max9611.c
@@ -514,8 +514,6 @@  static int max9611_probe(struct i2c_client *client,
 {
 	const char * const shunt_res_prop = "shunt-resistor-micro-ohms";
 	const struct device_node *of_node = client->dev.of_node;
-	const struct of_device_id *of_id =
-		of_match_device(max9611_of_table, &client->dev);
 	struct max9611_dev *max9611;
 	struct iio_dev *indio_dev;
 	unsigned int of_shunt;
@@ -545,7 +543,7 @@  static int max9611_probe(struct i2c_client *client,
 	if (ret)
 		return ret;
 
-	indio_dev->name		= of_id->data;
+	indio_dev->name		= of_device_get_match_data(&client->dev);
 	indio_dev->modes	= INDIO_DIRECT_MODE;
 	indio_dev->info		= &indio_info;
 	indio_dev->channels	= max9611_channels;