diff mbox

rtc-v3020: fix mmio read access

Message ID 4A5C3DBD.3040306@compulab.co.il
State Superseded, archived
Headers show

Commit Message

Mike Rapoport July 14, 2009, 8:11 a.m. UTC
>From: Bob Dunlop <rdunlop@guralp.com>

Changes to support GPIO broke memory mapped IO in cases where
chip->leftshift != 0.
Fix it.

Signed-off-by: Mike Rapoport <mike@compulab.co.il>
---
 drivers/rtc/rtc-v3020.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

 static struct v3020_chip_ops v3020_mmio_ops = {

Comments

Mike Rapoport July 19, 2009, 8:12 a.m. UTC | #1
Alessandro,
Any updates on this?

Mike Rapoport wrote:
>> From: Bob Dunlop <rdunlop@guralp.com>
> 
> Changes to support GPIO broke memory mapped IO in cases where
> chip->leftshift != 0.
> Fix it.
> 
> Signed-off-by: Mike Rapoport <mike@compulab.co.il>
> ---
>  drivers/rtc/rtc-v3020.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/rtc/rtc-v3020.c b/drivers/rtc/rtc-v3020.c
> index ad16405..c167b3d 100644
> --- a/drivers/rtc/rtc-v3020.c
> +++ b/drivers/rtc/rtc-v3020.c
> @@ -96,7 +96,7 @@ static void v3020_mmio_write_bit(struct v3020 *chip, unsigned
> char bit)
> 
>  static unsigned char v3020_mmio_read_bit(struct v3020 *chip)
>  {
> -	return readl(chip->ioaddress) & (1 << chip->leftshift);
> +	return (readl(chip->ioaddress) >> chip->leftshift) & 1;
>  }
> 
>  static struct v3020_chip_ops v3020_mmio_ops = {
Alessandro Zummo July 19, 2009, 1 p.m. UTC | #2
On Sun, 19 Jul 2009 11:12:54 +0300
Mike Rapoport <mike@compulab.co.il> wrote:

> Alessandro,
> Any updates on this?

 it's in my queue, if you have a Tested-by and need it to be included
 earlier, you might want to send to to linux-kernel and I'll
 ack it there. Andrew usually picks it up.
diff mbox

Patch

diff --git a/drivers/rtc/rtc-v3020.c b/drivers/rtc/rtc-v3020.c
index ad16405..c167b3d 100644
--- a/drivers/rtc/rtc-v3020.c
+++ b/drivers/rtc/rtc-v3020.c
@@ -96,7 +96,7 @@  static void v3020_mmio_write_bit(struct v3020 *chip, unsigned
char bit)

 static unsigned char v3020_mmio_read_bit(struct v3020 *chip)
 {
-	return readl(chip->ioaddress) & (1 << chip->leftshift);
+	return (readl(chip->ioaddress) >> chip->leftshift) & 1;
 }