[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110407080404.GF6427@angua.secretlab.ca>
Date: Thu, 7 Apr 2011 01:04:04 -0700
From: Grant Likely <grant.likely@...retlab.ca>
To: Greg KH <gregkh@...e.de>
Cc: Andres Salomon <dilinger@...ued.net>,
Samuel Ortiz <sameo@...ux.intel.com>,
linux-kernel@...r.kernel.org,
Mark Brown <broonie@...nsource.wolfsonmicro.com>,
khali@...ux-fr.org, ben-linux@...ff.org,
Peter Korsgaard <jacmet@...site.dk>,
Mauro Carvalho Chehab <mchehab@...radead.org>,
David Brownell <dbrownell@...rs.sourceforge.net>,
linux-i2c@...r.kernel.org, linux-media@...r.kernel.org,
netdev@...r.kernel.org, spi-devel-general@...ts.sourceforge.net,
Mocean Laboratories <info@...ean-labs.com>
Subject: Re: [PATCH 07/19] timberdale: mfd_cell is now implicitly available
to drivers
On Wed, Apr 06, 2011 at 11:38:54AM -0700, Greg KH wrote:
> On Wed, Apr 06, 2011 at 11:25:57AM -0700, Andres Salomon wrote:
> > > > We've been faced with the problem of being able to pass both MFD
> > > > related data and a platform_data pointer to some of those drivers.
> > > > Squeezing the MFD bits in the sub driver platform_data pointer
> > > > doesn't work for drivers that know nothing about MFDs. It also adds
> > > > an additional dependency on the MFD API to all MFD sub drivers.
> > > > That prevents any of those drivers to eventually be used as plain
> > > > platform device drivers.
> > >
> > > Then they shouldn't be "plain" platform drivers, that should only be
> > > reserved for drivers that are the "lowest" type. Just make them MFD
> > > devices and go from there.
> >
> >
> > The problem is of mixing "plain" platform devices and MFD devices.
>
> Then don't do that.
>From my perspective, MFD devices are little more than a bag of
platform_devices, with the MFD layer provides infrastructure for
managing it. It isn't that there are 'plain' platform device and
'mfd' devices. There are only platform_devices, but some of the
drivers use additional data stored in a struct mfd.
Personally, I'm not thrilled with the approach of using struct mfd, or
more specifically making it available to drivers, but on the ugly
scale it isn't very high.
However, the changes on how struct mfd is passed that were merged in
2.6.39 were actively dangerous and are going to be reverted. Yet
a method is still needed to pass the struct mfd in a safe way. I
don't have a problem with adding the mfd pointer to struct
platform_device, even if it should just be a stop gap to something
better.
Independently, I have been experimenting with typesafe methods for
attaching data to devices which may very well be the long term
approach, but for the short term I see no problem with adding the mfd
pointer, particularly because it is by far safer than any of the other
immediately available options.
g.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists