diff mbox

pinctrl: pinctrl-single: Fix the pins debug output

Message ID 509BEF60.1030805@ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

Benoit Cousson Nov. 8, 2012, 5:44 p.m. UTC
The offset parameter is in fact the pin index. The printed
value is then most of the time wrong.
Multiply that value by the width to get the proper offset.

Signed-off-by: Benoit Cousson <b-cousson@ti.com>
---

Hi Tony,

I guess that should probably go for 3.7-rc.

Regards,
Benoit

 drivers/pinctrl/pinctrl-single.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Tony Lindgren Nov. 8, 2012, 5:58 p.m. UTC | #1
* Benoit Cousson <b-cousson@ti.com> [121108 09:46]:
> The offset parameter is in fact the pin index. The printed
> value is then most of the time wrong.
> Multiply that value by the width to get the proper offset.
> 
> Signed-off-by: Benoit Cousson <b-cousson@ti.com>
> ---
> 
> Hi Tony,
> 
> I guess that should probably go for 3.7-rc.
> 
> Regards,
> Benoit

There is a similar patch already posted by Haojian at:

http://www.spinics.net/lists/arm-kernel/msg205682.html

Linus' take was that by definition a debug output fix
is not a fix, so not for the -rc cycle.

Haojian is adding support for pinconf, so let's use his
version as it also removes the fmask allowing it to
show the whole register.

Regards,

Tony
 
>  drivers/pinctrl/pinctrl-single.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c
> index 726a729..aeca3bd 100644
> --- a/drivers/pinctrl/pinctrl-single.c
> +++ b/drivers/pinctrl/pinctrl-single.c
> @@ -251,7 +251,7 @@ static void pcs_pin_dbg_show(struct pinctrl_dev *pctldev,
>  
>  	pcs = pinctrl_dev_get_drvdata(pctldev);
>  
> -	val = pcs->read(pcs->base + offset);
> +	val = pcs->read(pcs->base + offset * (pcs->width / BITS_PER_BYTE));
>  	val &= pcs->fmask;
>  
>  	seq_printf(s, "%08x %s " , val, DRIVER_NAME);
> -- 
> 1.7.0.4
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c
index 726a729..aeca3bd 100644
--- a/drivers/pinctrl/pinctrl-single.c
+++ b/drivers/pinctrl/pinctrl-single.c
@@ -251,7 +251,7 @@  static void pcs_pin_dbg_show(struct pinctrl_dev *pctldev,
 
 	pcs = pinctrl_dev_get_drvdata(pctldev);
 
-	val = pcs->read(pcs->base + offset);
+	val = pcs->read(pcs->base + offset * (pcs->width / BITS_PER_BYTE));
 	val &= pcs->fmask;
 
 	seq_printf(s, "%08x %s " , val, DRIVER_NAME);