Re: [PATCH] add missing intialisation of bgc->dir

From: Lothar WaÃmann
Date: Mon Jul 04 2011 - 05:38:08 EST


Hi,

Grant Likely writes:
> On Fri, Jul 01, 2011 at 02:08:51PM +0200, Lothar WaÃmann wrote:
> > ---
> > drivers/gpio/basic_mmio_gpio.c | 1 +
> > 1 files changed, 1 insertions(+), 0 deletions(-)
> >
> > diff --git a/drivers/gpio/basic_mmio_gpio.c b/drivers/gpio/basic_mmio_gpio.c
> > index 8152e9f..e69a453 100644
> > --- a/drivers/gpio/basic_mmio_gpio.c
> > +++ b/drivers/gpio/basic_mmio_gpio.c
> > @@ -399,6 +399,7 @@ int __devinit bgpio_init(struct bgpio_chip *bgc,
> > return ret;
> >
> > bgc->data = bgc->read_reg(bgc->reg_dat);
> > + bgc->dir = bgc->read_reg(bgc->reg_dir);
>
> Hi Lothar.
>
> You'll need to double check your email setup. The patch got emailed
> separately from the description.
>
git-send-email did that.

> I don't know if this is a valid thing to do or not. Not every GPIO
> controller supports reading back the initial state from the direction
> register. I suspect it is better to leave initialization of the
> direction to the gpio controller driver itself.
>
That would mean, that external software would have to have access to
the bgpio internal data structures which is a Bad Thing(TM) IMO. Or we
need a function that allows to explicitly initialize the internal
shadow registers.



Lothar WaÃmann
--
___________________________________________________________

Ka-Ro electronics GmbH | PascalstraÃe 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
GeschÃftsfÃhrer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | info@xxxxxxxxxxxxxxxxxxx
___________________________________________________________
--
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/