public inbox for linux-input@vger.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: LABBE Corentin <clabbe.montjoie@gmail.com>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] input: pixcir_i2c_ts: simplify code with of_device_get_match_data
Date: Fri, 19 Aug 2016 10:17:32 -0700	[thread overview]
Message-ID: <20160819171732.GH20499@dtor-ws> (raw)
In-Reply-To: <1471440134-23896-1-git-send-email-clabbe.montjoie@gmail.com>

On Wed, Aug 17, 2016 at 03:22:12PM +0200, LABBE Corentin wrote:
> The usage of of_device_get_match_data reduce the code size a bit.
> Furthermore, it is better to use a standard function for
> getting the match data.
> 
> Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com>

Applied, thank you.

> ---
>  drivers/input/touchscreen/pixcir_i2c_ts.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/pixcir_i2c_ts.c b/drivers/input/touchscreen/pixcir_i2c_ts.c
> index d159e14..b0a2dc2 100644
> --- a/drivers/input/touchscreen/pixcir_i2c_ts.c
> +++ b/drivers/input/touchscreen/pixcir_i2c_ts.c
> @@ -431,13 +431,7 @@ static const struct of_device_id pixcir_of_match[];
>  static int pixcir_parse_dt(struct device *dev,
>  			   struct pixcir_i2c_ts_data *tsdata)
>  {
> -	const struct of_device_id *match;
> -
> -	match = of_match_device(of_match_ptr(pixcir_of_match), dev);
> -	if (!match)
> -		return -EINVAL;
> -
> -	tsdata->chip = (const struct pixcir_i2c_chip_data *)match->data;
> +	tsdata->chip = of_device_get_match_data(dev);
>  	if (!tsdata->chip)
>  		return -EINVAL;
>  
> -- 
> 2.7.3
> 

-- 
Dmitry

      parent reply	other threads:[~2016-08-19 17:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-17 13:22 [PATCH 1/3] input: pixcir_i2c_ts: simplify code with of_device_get_match_data LABBE Corentin
2016-08-17 13:22 ` [PATCH 2/3] input: pixcir_i2c: Remove text about writing to Free Software Foundation LABBE Corentin
2016-08-19 17:17   ` Dmitry Torokhov
2016-08-17 13:22 ` [PATCH 3/3] input: pixcir_i2c: Remove a useless blank line LABBE Corentin
2016-08-19 17:19   ` Dmitry Torokhov
2016-08-19 17:17 ` Dmitry Torokhov [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=20160819171732.GH20499@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=clabbe.montjoie@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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