Re: [PATCHv2 6/7] basic_mmio_gpio: support different input/outputregisters

From: Jamie Iles
Date: Fri Apr 08 2011 - 12:32:48 EST


On Fri, Apr 08, 2011 at 08:26:30PM +0400, Anton Vorontsov wrote:
> On Fri, Apr 08, 2011 at 05:11:13PM +0100, Jamie Iles wrote:
> [...]
> > > > +++ b/drivers/gpio/basic_mmio_gpio.c
> > > > @@ -70,6 +70,7 @@ struct bgpio_chip {
> > > > void __iomem *reg_dat;
> > > > void __iomem *reg_set;
> > > > void __iomem *reg_clr;
> > > > + void __iomem *reg_in;
> > >
> > > Btw, I wonder if it makes sense (and more logical) for separate output/
> > > input registers case to use "reg_dat" for 'input' and 'reg_set' for
> > > output?
> >
> > Sounds like a good idea. Something like this?
>
> Yep, exactly.
>
> [...]
> > + } else if (res_set && !res_clr) {
> > + if (resource_size(res_set) != resource_size(res_dat) ||
> > + resource_size(res_set) != bgc->bits / 8)
>
> We derive bgc->bits from resource_size(res_dat), so '!= bgc->bits / 8'
> condition is uneeded.

Doh! Not sure how I missed that! I'll fix these up and repost them all
on Monday.

Thanks,

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