linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Stefan Wahren <stefan.wahren@i2se.com>
Cc: Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	Marek Vasut <marex@denx.de>,
	Ksenija Stanojevic <ksenija.stanojevic@gmail.com>,
	Fabio Estevam <fabio.estevam@nxp.com>,
	Juergen Borleis <jbe@pengutronix.de>,
	linux-iio@vger.kernel.org, linux-input@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH V3 1/3] iio: mxs-lradc: simplify TS registration
Date: Wed, 4 May 2016 10:38:31 +0100	[thread overview]
Message-ID: <7cb1766c-a3c2-891a-9bb8-df8f7b7c3407@kernel.org> (raw)
In-Reply-To: <20160425210006.GA26059@dtor-ws>

On 25/04/16 22:00, Dmitry Torokhov wrote:
> On Sat, Apr 23, 2016 at 07:57:57PM +0000, Stefan Wahren wrote:
>> This patch simplifies the TS registration of mxs-lradc by
>> using devm_input_allocate_device.
>>
>> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
>> Reviewed-by: Marek Vasut <marex@denx.de>
> 
> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Applied to the togreg branch of iio.git - initially going
to be pushed out as testing though may not be until the weekend.

Jonathan
> 
>> ---
>>  drivers/iio/adc/mxs-lradc.c |   10 ++--------
>>  1 file changed, 2 insertions(+), 8 deletions(-)
>>
>> diff --git a/drivers/iio/adc/mxs-lradc.c b/drivers/iio/adc/mxs-lradc.c
>> index ad26da1..3d1d370 100644
>> --- a/drivers/iio/adc/mxs-lradc.c
>> +++ b/drivers/iio/adc/mxs-lradc.c
>> @@ -1120,18 +1120,16 @@ static int mxs_lradc_ts_register(struct mxs_lradc *lradc)
>>  {
>>  	struct input_dev *input;
>>  	struct device *dev = lradc->dev;
>> -	int ret;
>>  
>>  	if (!lradc->use_touchscreen)
>>  		return 0;
>>  
>> -	input = input_allocate_device();
>> +	input = devm_input_allocate_device(dev);
>>  	if (!input)
>>  		return -ENOMEM;
>>  
>>  	input->name = DRIVER_NAME;
>>  	input->id.bustype = BUS_HOST;
>> -	input->dev.parent = dev;
>>  	input->open = mxs_lradc_ts_open;
>>  	input->close = mxs_lradc_ts_close;
>>  
>> @@ -1146,11 +1144,8 @@ static int mxs_lradc_ts_register(struct mxs_lradc *lradc)
>>  
>>  	lradc->ts_input = input;
>>  	input_set_drvdata(input, lradc);
>> -	ret = input_register_device(input);
>> -	if (ret)
>> -		input_free_device(lradc->ts_input);
>>  
>> -	return ret;
>> +	return input_register_device(input);
>>  }
>>  
>>  static void mxs_lradc_ts_unregister(struct mxs_lradc *lradc)
>> @@ -1159,7 +1154,6 @@ static void mxs_lradc_ts_unregister(struct mxs_lradc *lradc)
>>  		return;
>>  
>>  	mxs_lradc_disable_ts(lradc);
>> -	input_unregister_device(lradc->ts_input);
>>  }
>>  
>>  /*
>> -- 
>> 1.7.9.5
>>
> 


  reply	other threads:[~2016-05-04 14:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-23 19:57 [PATCH V3 0/3] iio: mxs-lradc: simplify TS handling Stefan Wahren
2016-04-23 19:57 ` [PATCH V3 1/3] iio: mxs-lradc: simplify TS registration Stefan Wahren
     [not found]   ` <1461441479-23218-2-git-send-email-stefan.wahren-eS4NqCHxEME@public.gmane.org>
2016-04-25 21:00     ` Dmitry Torokhov
2016-05-04  9:38       ` Jonathan Cameron [this message]
2016-04-23 19:57 ` [PATCH V3 2/3] iio: mxs-lradc: remove mxs_lradc_ts_unregister Stefan Wahren
     [not found]   ` <1461441479-23218-3-git-send-email-stefan.wahren-eS4NqCHxEME@public.gmane.org>
2016-04-25 21:00     ` Dmitry Torokhov
2016-05-04  9:39       ` Jonathan Cameron
2016-04-23 19:57 ` [PATCH V3 3/3] iio: mxs-lradc: disable only masked channels in mxs_lradc_hw_stop Stefan Wahren
     [not found]   ` <1461441479-23218-4-git-send-email-stefan.wahren-eS4NqCHxEME@public.gmane.org>
2016-05-04  9:39     ` Jonathan Cameron
2016-05-01 20:08 ` [PATCH V3 0/3] iio: mxs-lradc: simplify TS handling Jonathan Cameron
     [not found]   ` <500c5874-4ef8-b37b-e12f-80fd5205c172-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2016-05-02  6:06     ` Ksenija Stanojević
     [not found]       ` <CAL7P5jJF9EL4Zk-AC9csyadfrmUp4R+6ceVAN_kNm7dKgo+ZgQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-05-04  9:40         ` Jonathan Cameron

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=7cb1766c-a3c2-891a-9bb8-df8f7b7c3407@kernel.org \
    --to=jic23@kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=fabio.estevam@nxp.com \
    --cc=jbe@pengutronix.de \
    --cc=knaack.h@gmx.de \
    --cc=ksenija.stanojevic@gmail.com \
    --cc=lars@metafoo.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=marex@denx.de \
    --cc=pmeerw@pmeerw.net \
    --cc=stefan.wahren@i2se.com \
    /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;
as well as URLs for NNTP newsgroup(s).