RE: [PATCH] Documentation/pinctrl: various minor fixes

From: Stephen Warren
Date: Thu Dec 08 2011 - 17:25:08 EST


Uwe Kleine-KÃnig wrote at Thursday, December 08, 2011 3:22 PM:
> - add some consts
> - don't use the group index alone to determine the value to write to
> foo's mux register. For spi and i2c the group index is always 0.
> Additionally using the function index makes much more sense as it
> generates a different value for each function/group pair.
> - fix a few syntax errors

> @@ -600,7 +600,7 @@ static int foo_get_groups(struct pinctrl_dev *pctldev, unsigned selector,
> int foo_enable(struct pinctrl_dev *pctldev, unsigned selector,
> unsigned group)
> {
> - u8 regbit = (1 << group);
> + u8 regbit = (1 << selector + group);
>
> writeb((readb(MUX)|regbit), MUX)
> return 0;
> @@ -609,7 +609,7 @@ int foo_enable(struct pinctrl_dev *pctldev, unsigned selector,
> int foo_disable(struct pinctrl_dev *pctldev, unsigned selector,
> unsigned group)
> {
> - u8 regbit = (1 << group);
> + u8 regbit = (1 << selector);
>
> writeb((readb(MUX) & ~(regbit)), MUX)
> return 0;

Shouldn't those two regbit calculations match?

--
nvpublic

èº{.nÇ+‰·Ÿ®‰­†+%ŠËlzwm…ébëæìr¸›zX§»®w¥Š{ayºÊÚë,j­¢f£¢·hš‹àz¹®w¥¢¸ ¢·¦j:+v‰¨ŠwèjØm¶Ÿÿ¾«‘êçzZ+ƒùšŽŠÝj"ú!¶iO•æ¬z·švØ^¶m§ÿðà nÆàþY&—