[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201119152416.GB5554@sirena.org.uk>
Date: Thu, 19 Nov 2020 15:24:16 +0000
From: Mark Brown <broonie@...nel.org>
To: Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>
Cc: linux-spi@...r.kernel.org, linux-kernel@...r.kernel.org,
kernel@...gutronix.de,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [PATCH 1/3] spi: fix resource leak for drivers without .remove
callback
On Thu, Nov 19, 2020 at 04:20:57PM +0100, Uwe Kleine-König wrote:
> Consider an spi driver with a .probe but without a .remove callback (e.g.
> rtc-ds1347). The function spi_drv_probe() is called to bind a device and
> so some init routines like dev_pm_domain_attach() are used. As there is
> no remove callback spi_drv_remove() isn't called at unbind time however
> and so calling dev_pm_domain_detach() is missed and the pm domain keeps
> active.
> To fix this always use either both or none of the functions and make
> them handle the callback not being set.
Why would we want to tie configuring PM domains to either of these
functions? We certainly don't want to force drivers to have empty
remove functions to trigger cleanup of domains, this would be
counterintuitive and this stuff should be transparent to the driver.
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists