[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <632269cc-db60-d405-d31f-b80a7faf1791@collabora.com>
Date: Wed, 17 May 2023 12:34:01 +0200
From: AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>
To: Shreeya Patel <shreeya.patel@...labora.com>, jic23@...nel.org,
lars@...afoo.de, heiko@...ech.de, robh+dt@...nel.org,
krzysztof.kozlowski+dt@...aro.org, sebastian.reichel@...labora.com
Cc: linux-iio@...r.kernel.org, devicetree@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-rockchip@...ts.infradead.org, linux-kernel@...r.kernel.org,
kernel@...labora.com, gustavo.padovan@...labora.com,
serge.broslavsky@...labora.com
Subject: Re: [PATCH 3/7] iio: adc: rockchip_saradc: Use
of_device_get_match_data
Il 17/05/23 01:00, Shreeya Patel ha scritto:
> Use of_device_get_match_data() to simplify the code.
>
> Signed-off-by: Shreeya Patel <shreeya.patel@...labora.com>
> ---
> drivers/iio/adc/rockchip_saradc.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/iio/adc/rockchip_saradc.c b/drivers/iio/adc/rockchip_saradc.c
> index 05b66eff9a44..05ea823a8f16 100644
> --- a/drivers/iio/adc/rockchip_saradc.c
> +++ b/drivers/iio/adc/rockchip_saradc.c
> @@ -408,10 +408,10 @@ static void rockchip_saradc_regulator_unreg_notifier(void *data)
>
> static int rockchip_saradc_probe(struct platform_device *pdev)
> {
> + const struct rockchip_saradc_data *match_data;
s/match_data/data/g maybe?
Regardless of that,
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>
> struct rockchip_saradc *info = NULL;
> struct device_node *np = pdev->dev.of_node;
> struct iio_dev *indio_dev = NULL;
> - const struct of_device_id *match;
> int ret;
> int irq;
>
> @@ -425,13 +425,13 @@ static int rockchip_saradc_probe(struct platform_device *pdev)
> }
> info = iio_priv(indio_dev);
>
> - match = of_match_device(rockchip_saradc_match, &pdev->dev);
> - if (!match) {
> + match_data = of_device_get_match_data(&pdev->dev);
> + if (!match_data) {
> dev_err(&pdev->dev, "failed to match device\n");
> return -ENODEV;
> }
>
> - info->data = match->data;
> + info->data = match_data;
>
> /* Sanity check for possible later IP variants with more channels */
> if (info->data->num_channels > SARADC_MAX_CHANNELS) {
Powered by blists - more mailing lists