Re: [PATCH] max730x: Added setup/teardown hooks

From: Grant Likely
Date: Thu Mar 03 2011 - 14:37:14 EST


On Thu, Mar 03, 2011 at 08:26:44PM +0100, Roland Stigge wrote:
> On 03/03/2011 07:59 PM, Grant Likely wrote:
> > On Fri, Feb 11, 2011 at 5:00 AM, <stigge@xxxxxxxxx> wrote:
> >> max730x: Added setup/teardown hooks
> >>
> >> This patch adds setup and teardown hooks for configuration of GPIO lines via
> >> platform_data, similar to the pca953x driver.
> >
> > Why? What actions are these hooks going to perform?
>
> In board configurations, ARM systems are set up with GPIO lines
> configured as Input or Output etc. See also arch/arm/*/*. See usage of
> pca953x - how it is already done there.

It appears to simply be notifying the platform code that the gpio chip
has been registered. My point is that it doesn't seem to make any
sense whatsoever to have driver specific hooks to inform platform code
that a gpio controller has shown up. It is something that should be
part of the infrastructure. I would much rather see this get
implemented with a notifier or something similar in gpiochip_add().

Other drivers may currently be doing driver-specific callbacks, but it
is a bad pattern and I don't want any more drivers to do so.

g.

--
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/