[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150714101948.GA17240@earth>
Date: Tue, 14 Jul 2015 12:19:48 +0200
From: Sebastian Reichel <sre@...nel.org>
To: Johannes Thumshirn <jthumshirn@...e.de>
Cc: Pali Rohár <pali.rohar@...il.com>,
Dmitry Eremin-Solenikov <dbaryshkov@...il.com>,
David Woodhouse <dwmw2@...radead.org>,
linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
Tejun Heo <tj@...nel.org>
Subject: Re: [PATCH] power: Destroy IDRs on module exit
[+CC: Tejun Heo <tj@...nel.org>, for being very active in lib/idr.c]
Hi,
On Tue, Jul 14, 2015 at 11:16:14AM +0200, Johannes Thumshirn wrote:
> Destroy IDRs on module exit, freeing the resources for
> * bq2415x_charger.c
> * ds2782_battery.c
> * ltc2941-battery-gauge.c
You missed bq27x00_battery.c. Maybe a coccinelle script should be
written?
> The drivers had to be converted to "ordinary" module_init()/module_exit()
> style drivers instead of using module_i2c_driver.
mh I would prefer another solution. How about adding something
like this:
static void idr_remove_and_destroy(struct idr *idp, int id)
{
idr_remove(idp, id);
if (idr_is_empty(idp)
idr_destroy(idp);
}
If that is called by the drivers instead of idr_remove(), there
should be no need for adding idr_destroy to module_exit().
-- Sebastian
Download attachment "signature.asc" of type "application/pgp-signature" (820 bytes)
Powered by blists - more mailing lists