linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Mark Brown <broonie@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org, kernel@pengutronix.de,
	linux-spi@vger.kernel.org
Subject: Re: [PATCH 1/3] spi: fix resource leak for drivers without .remove callback
Date: Thu, 19 Nov 2020 17:04:12 +0100	[thread overview]
Message-ID: <20201119160412.nhu2rmwygyh6yg6e@pengutronix.de> (raw)
In-Reply-To: <20201119154139.GC5554@sirena.org.uk>

[-- Attachment #1: Type: text/plain, Size: 1328 bytes --]

Hello Mark,

On Thu, Nov 19, 2020 at 03:41:39PM +0000, Mark Brown wrote:
> On Thu, Nov 19, 2020 at 04:35:40PM +0100, Uwe Kleine-König wrote:
> 
> > Yes, I thought that this is not the final fix. I just sent the minimal
> > change to prevent the imbalance. So if I understand correctly, I will
> > have to respin with the following squashed into patch 1:
> 
> > -	if (sdrv->probe || sdrv->remove) {
> > -		sdrv->driver.probe = spi_drv_probe;
> > -		sdrv->driver.remove = spi_drv_remove;
> > -	}
> > +	sdrv->driver.probe = spi_drv_probe;
> > +	sdrv->driver.remove = spi_drv_remove;
> >  	if (sdrv->shutdown)
> >  		sdrv->driver.shutdown = spi_drv_shutdown;
> >  	return driver_register(&sdrv->driver);
> 
> I think so, I'd need to see the full patch to check of course.

ok.
 
> > (Not sure this makes a difference in real life, are there drivers
> > without a .probe callback?)
> 
> Your changelog seemed to say that it would make remove mandatory.

No, that's not what the patch did. It made unconditional use of
spi_drv_remove(), but an spi_driver without .remove() was still ok. I
will reword to make this clearer.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2020-11-19 16:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-19 15:20 [PATCH 1/3] spi: fix resource leak for drivers without .remove callback Uwe Kleine-König
2020-11-19 15:20 ` [PATCH 2/3] spi: Use bus_type functions for probe, remove and shutdown Uwe Kleine-König
2020-11-19 15:20 ` [PATCH 3/3] spi: Warn when a driver's remove callback returns an error Uwe Kleine-König
2020-11-19 15:24 ` [PATCH 1/3] spi: fix resource leak for drivers without .remove callback Mark Brown
2020-11-19 15:35   ` Uwe Kleine-König
2020-11-19 15:41     ` Mark Brown
2020-11-19 16:04       ` Uwe Kleine-König [this message]
2020-11-19 16:09         ` Mark Brown

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=20201119160412.nhu2rmwygyh6yg6e@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=broonie@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel@pengutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@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;
as well as URLs for NNTP newsgroup(s).