Message ID | 1507118906-8946-4-git-send-email-geert+renesas@glider.be (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Wed, Oct 04, 2017 at 02:08:26PM +0200, Geert Uytterhoeven wrote: > 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> -- To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Thu, 5 Oct 2017 11:12:59 +0200 Simon Horman <horms@verge.net.au> wrote: > On Wed, Oct 04, 2017 at 02:08:26PM +0200, Geert Uytterhoeven wrote: > > 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> > Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it. Thanks, Jonathan -- To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/iio/adc/rcar-gyroadc.c b/drivers/iio/adc/rcar-gyroadc.c index 0098c66a19572400..dcb50172186f49ab 100644 --- a/drivers/iio/adc/rcar-gyroadc.c +++ b/drivers/iio/adc/rcar-gyroadc.c @@ -487,8 +487,6 @@ static int rcar_gyroadc_init_supplies(struct iio_dev *indio_dev) 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);
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> --- drivers/iio/adc/rcar-gyroadc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)