[PATCH 1/2] mfd: max8925: request resource region

Arnd Bergmann arnd at arndb.de
Mon May 7 15:26:08 EDT 2012


On Monday 07 May 2012, Mark Brown wrote:
> On Mon, May 07, 2012 at 03:09:54PM +0000, Arnd Bergmann wrote:
> > On Monday 07 May 2012, Mark Brown wrote:
> 
> > > Given what I'm saying about platform devices above perhaps we should be
> > > factoring some of the platform device stuff up to struct device level.
> > > Another option would be to work on separating the management of the
> > > number spaces and the interfaces for getting the numbers back out to
> > > make it easier to add more number spaces.
> 
> > Isn't that what devres is for? We should be able to just attach arbitrary
> > data to a device with this, e.g. a struct regmap to use for doing I/O
> > that a driver can use. Maybe we should add some wrappers around that
> > to make it more obvious to use.
> 
> Not as far as I understand it, it's more about making error handling and
> unregistration code less error prone by automating the freeing of
> things when a device goes away or probe() fails.  The managed versions
> wrap the unmanaged allocators but don't generally otherwise change the
> interface except by adding a struct device.  Unless I'm missing
> something, of course.

Yes, it also does that, but have a look at how drivers/pci/pci.c uses
devres to attach auxiliary attributes to a device. We can do the same
thing for other devices to attach any data.

	Arnd



More information about the linux-arm-kernel mailing list