All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Mack <daniel@zonque.org>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Marco Felsch <m.felsch@pengutronix.de>
Cc: linux-input@vger.kernel.org
Subject: Re: [PATCH v2 2/3] input: touch: ads7846: switch to devm initialization
Date: Wed, 6 May 2020 08:38:40 +0200	[thread overview]
Message-ID: <2e5ae797-c89f-f8a1-eb92-d7e504ad3f32@zonque.org> (raw)
In-Reply-To: <20200506000539.GA70193@dtor-ws>

Hi Dmitry,

Thanks for having a look!

On 5/6/20 2:05 AM, Dmitry Torokhov wrote:
> On Tue, May 05, 2020 at 10:37:01AM +0200, Marco Felsch wrote:
>> On 20-05-04 19:37, Daniel Mack wrote:
>>> @@ -1488,30 +1472,11 @@ static int ads7846_remove(struct spi_device *spi)
>>>  	struct ads7846 *ts = spi_get_drvdata(spi);
>>>  
>>>  	sysfs_remove_group(&spi->dev.kobj, &ads784x_attr_group);
>>> -
>>>  	ads7846_disable(ts);
>>> -	free_irq(ts->spi->irq, ts);
>>> -
>>> -	input_unregister_device(ts->input);
>>> -
>>> -	ads784x_hwmon_unregister(spi, ts);
>>> -
>>> -	regulator_put(ts->reg);
>>> -
>>> -	if (!ts->get_pendown_state) {
>>> -		/*
>>> -		 * If we are not using specialized pendown method we must
>>> -		 * have been relying on gpio we set up ourselves.
>>> -		 */
>>> -		gpio_free(ts->gpio_pendown);
>>> -	}
>>>  
>>>  	if (ts->filter_cleanup)
>>>  		ts->filter_cleanup(ts->filter_data);
> 
> This makes filter_cleanup() be called much earlier now, before we free
> interrupt, unregister input device, etc.
> 
> I am very concerned with mixing manual unwinding and devm and would
> very much prefer if everything would be converted to devm.

Yes, I see. These filter_init()/filter_cleanup() functions can
potentially be set by pdata users, hence I thought it's easiest if we
keep it as-is.

However, turns out this pdata logic has no active user in mainline, so I
can just add a patch to remove it completely and simplify the code further.

Will pick up yours and Marco's comments and put them in a v3.


Thanks!
Daniel

  reply	other threads:[~2020-05-06  6:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-04 17:37 [PATCH v2 1/3] input: touch: ads7846: add short-hand for spi->dev in probe() function Daniel Mack
2020-05-04 17:37 ` [PATCH v2 2/3] input: touch: ads7846: switch to devm initialization Daniel Mack
2020-05-05  8:37   ` Marco Felsch
2020-05-06  0:05     ` Dmitry Torokhov
2020-05-06  6:38       ` Daniel Mack [this message]
2020-05-06  6:54     ` Daniel Mack
2020-05-04 17:37 ` [PATCH v2 3/3] input: touchscreen: ads7846: switch to gpiod API Daniel Mack
2020-05-05  9:16   ` Marco Felsch
2020-05-05  8:19 ` [PATCH v2 1/3] input: touch: ads7846: add short-hand for spi->dev in probe() function Marco Felsch

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=2e5ae797-c89f-f8a1-eb92-d7e504ad3f32@zonque.org \
    --to=daniel@zonque.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=m.felsch@pengutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.