Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Geert Uytterhoeven and committed by
Jonathan Cameron
fb942f8c af5d716a

+2 -3
+2 -3
drivers/iio/adc/rcar-gyroadc.c
··· 487 487 488 488 static int rcar_gyroadc_probe(struct platform_device *pdev) 489 489 { 490 - const struct of_device_id *of_id = 491 - of_match_device(rcar_gyroadc_match, &pdev->dev); 492 490 struct device *dev = &pdev->dev; 493 491 struct rcar_gyroadc *priv; 494 492 struct iio_dev *indio_dev; ··· 523 525 if (ret) 524 526 return ret; 525 527 526 - priv->model = (enum rcar_gyroadc_model)of_id->data; 528 + priv->model = (enum rcar_gyroadc_model) 529 + of_device_get_match_data(&pdev->dev); 527 530 528 531 platform_set_drvdata(pdev, indio_dev); 529 532