public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: <cgel.zte@gmail.com>
Cc: <jic23@kernel.org>, <lars@metafoo.de>,
	<tangbin@cmss.chinamobile.com>, <linux-iio@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>,
	Minghao Chi <chi.minghao@zte.com.cn>,
	Zeal Robot <zealci@zte.com.cn>
Subject: Re: [PATCH] iio:adc:twl6030: Use of_device_get_match_data()
Date: Sat, 5 Mar 2022 16:04:39 +0000	[thread overview]
Message-ID: <20220305160439.00000184@Huawei.com> (raw)
In-Reply-To: <20220304015932.2061712-1-chi.minghao@zte.com.cn>

On Fri,  4 Mar 2022 01:59:32 +0000
cgel.zte@gmail.com wrote:

> From: Minghao Chi (CGEL ZTE) <chi.minghao@zte.com.cn>
> 
> Use of_device_get_match_data() to simplify the code.
> 
> v1->v2:
>   iio:adc:->iio:adc:twl6030:
Hi,

For IIO please put the change log below the ---
A few areas of the kernel do this differently but we are consistent
in using link tags (generated when I apply the patch) to give
access to change logs rather than having them stored for ever
in the main git log.

> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Minghao Chi (CGEL ZTE) <chi.minghao@zte.com.cn>

You haven't addressed my request in reply to previous posting
to use device_get_match_data() and switch to the generic
properties interfaces.  I'd rather see that done in one step
then going via this cleanup.

Thanks,

Jonathan

> ---
>  drivers/iio/adc/twl6030-gpadc.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/drivers/iio/adc/twl6030-gpadc.c b/drivers/iio/adc/twl6030-gpadc.c
> index afdb59e0b526..6a022e583658 100644
> --- a/drivers/iio/adc/twl6030-gpadc.c
> +++ b/drivers/iio/adc/twl6030-gpadc.c
> @@ -867,16 +867,11 @@ static int twl6030_gpadc_probe(struct platform_device *pdev)
>  	struct device *dev = &pdev->dev;
>  	struct twl6030_gpadc_data *gpadc;
>  	const struct twl6030_gpadc_platform_data *pdata;
> -	const struct of_device_id *match;
>  	struct iio_dev *indio_dev;
>  	int irq;
>  	int ret;
>  
> -	match = of_match_device(of_twl6030_match_tbl, dev);
> -	if (!match)
> -		return -EINVAL;
> -
> -	pdata = match->data;
> +	pdata = of_device_get_match_data(dev);
>  
>  	indio_dev = devm_iio_device_alloc(dev, sizeof(*gpadc));
>  	if (!indio_dev)


      reply	other threads:[~2022-03-05 16:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-04  1:59 [PATCH] iio:adc:twl6030: Use of_device_get_match_data() cgel.zte
2022-03-05 16:04 ` Jonathan Cameron [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220305160439.00000184@Huawei.com \
    --to=jonathan.cameron@huawei.com \
    --cc=cgel.zte@gmail.com \
    --cc=chi.minghao@zte.com.cn \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tangbin@cmss.chinamobile.com \
    --cc=zealci@zte.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox