Commit fb942f8c authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Jonathan Cameron
Browse files

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: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: default avatarSimon Horman <horms+renesas@verge.net.au>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent af5d716a
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -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);