[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210406201616.GI3122@kunai>
Date: Tue, 6 Apr 2021 22:16:16 +0200
From: Wolfram Sang <wsa@...nel.org>
To: Yicong Yang <yangyicong@...ilicon.com>
Cc: andriy.shevchenko@...ux.intel.com, linux-i2c@...r.kernel.org,
Sergey.Semin@...kalelectronics.ru, linux-kernel@...r.kernel.org,
digetx@...il.com, treding@...dia.com,
jarkko.nikula@...ux.intel.com, rmk+kernel@...linux.org.uk,
song.bao.hua@...ilicon.com, john.garry@...wei.com,
mika.westerberg@...ux.intel.com, prime.zeng@...wei.com,
linuxarm@...wei.com
Subject: Re: [PATCH v6 1/5] i2c: core: add managed function for adding i2c
adapters
On Wed, Mar 31, 2021 at 09:36:26PM +0800, Yicong Yang wrote:
> Some I2C controller drivers will only unregister the I2C
> adapter in their .remove() callback, which can be done
> by simply using a managed variant to add the I2C adapter.
>
> So add the managed functions for adding the I2C adapter.
Yes, I think we can do this. We just need to pay attention that people
make sure interrupts are disabled and/or freed when the adapter gets
removed. But this is also true for the current situation. I.e. removing
the adapter manually in remove() and then relying on devm_ to free the
interrupt is a bit dangerous.
> + return devm_add_action_or_reset(dev, devm_i2c_del_adapter, adapter);
Cool, I didn't know this function.
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists