summary refs log tree commit diff
path: root/drivers/iio
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert+renesas@glider.be>2017-10-04 14:08:26 +0200
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2017-10-09 20:50:49 +0100
commitfb942f8ce6cdbacc087b808d89d09ff138c25bbe (patch)
tree6229893703b6153ceefff44479432af3bf35fe6b /drivers/iio
parentaf5d716a90ba55635bbdcbf145465b5fdc5a5530 (diff)
downloadlinux-fb942f8ce6cdbacc087b808d89d09ff138c25bbe.tar.gz
iio: adc: rcar-gyroadc: Use of_device_get_match_data() helper
Use the of_device_get_match_data() helper instead of open coding.
Note that the rcar-gyroadc driver is used with DT only, so there's
always a valid match.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/adc/rcar-gyroadc.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/iio/adc/rcar-gyroadc.c b/drivers/iio/adc/rcar-gyroadc.c
index 0098c66a1957..dcb50172186f 100644
--- a/drivers/iio/adc/rcar-gyroadc.c
+++ b/drivers/iio/adc/rcar-gyroadc.c
@@ -487,8 +487,6 @@ err:
 
 static int rcar_gyroadc_probe(struct platform_device *pdev)
 {
-	const struct of_device_id *of_id =
-		of_match_device(rcar_gyroadc_match, &pdev->dev);
 	struct device *dev = &pdev->dev;
 	struct rcar_gyroadc *priv;
 	struct iio_dev *indio_dev;
@@ -525,7 +523,8 @@ static int rcar_gyroadc_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
-	priv->model = (enum rcar_gyroadc_model)of_id->data;
+	priv->model = (enum rcar_gyroadc_model)
+		of_device_get_match_data(&pdev->dev);
 
 	platform_set_drvdata(pdev, indio_dev);