linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Marco Felsch <m.felsch@pengutronix.de>
Cc: Daniel Mack <daniel@zonque.org>, linux-input@vger.kernel.org
Subject: Re: [PATCH v2 2/3] input: touch: ads7846: switch to devm initialization
Date: Tue, 5 May 2020 17:05:39 -0700	[thread overview]
Message-ID: <20200506000539.GA70193@dtor-ws> (raw)
In-Reply-To: <20200505083701.GB18755@pengutronix.de>

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.

> >  
> > -	kfree(ts->packet);
> > -	kfree(ts);
> > -
> >  	dev_dbg(&spi->dev, "unregistered touchscreen\n");
> >  
> >  	return 0;
> > -- 
> > 2.26.2
> > 

Thanks.

-- 
Dmitry

  reply	other threads:[~2020-05-06  0:05 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 [this message]
2020-05-06  6:38       ` Daniel Mack
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=20200506000539.GA70193@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=daniel@zonque.org \
    --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 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).