Re: [PATCH 16/17] mc13xxx: mfd_cell is now implicitly available todrivers

From: Andres Salomon
Date: Fri Feb 18 2011 - 12:50:40 EST


On Fri, 18 Feb 2011 09:39:28 +0100
Uwe Kleine-KÃnig <u.kleine-koenig@xxxxxxxxxxxxxx> wrote:

> On Wed, Feb 16, 2011 at 09:00:36AM -0800, Andres Salomon wrote:
> > On Wed, 16 Feb 2011 10:41:54 +0100
> > Uwe Kleine-KÃnig <u.kleine-koenig@xxxxxxxxxxxxxx> wrote:
> >
> > > On Fri, Feb 11, 2011 at 06:19:21PM -0800, Andres Salomon wrote:
> > > >
> > > > The cell's platform_data is now accessed with a helper function;
> > > > change clients to use that, and remove the now-unused data_size.
> > > >
> > > > Note that mfd-core no longer makes a copy of platform_data, but
> > > > the
> > > why was this changed and where? I'm not able to find your
> > > complete series via gmane.
> >
> > http://permalink.gmane.org/gmane.linux.kernel/1099164
> I still don't get the motivation of your patch set. For drivers that
> don't need the mfd_cells you introduce another level of indirection.
> And drivers that want to use mfd_cells as platform_data, they can
> already now.
>
> Best regards
> Uwe
>

The main motivation for making mfd_cell available to all was to be able
to provide functions within mfd-core (introduced in later
patches/patchsets) that accept platform devices and operate on their
mfd_cells. The mfd_cell used to be automatically carried by the pdevs,
and I'm not entirely sure the reason for getting rid of that. It also
(imo) cleans up a lot of things. For example, the mfd_cell API
platform_data/driver_data stuff was unclear when I first
encountered it, as various drivers were doing things completely
differently (some incorrectly, as witnessed by some of the drivers
that I modified that were using driver_data and had clients later
calling set_drvdata on the same pdev). This is clearer, and provides
a uniform way to do things that, afaict, sacrifices absolutely no
flexibility or functionality. Yes, it adds some overhead by having a
copy of the mfd_cell around in memory, but if that's really an issue it
could be optimized further by not making a full copy of the mfd_cell.
With the new wrappers (mfd_get_data/mfd_get_cell), this could be done
without having to mess with drivers.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/