diff mbox

[V2,2/4] rtc: fix 88pm860x rtc irq enable callback

Message ID 1331259874-26503-1-git-send-email-jtzhou@marvell.com
State Accepted
Headers show

Commit Message

Jett.Zhou March 9, 2012, 2:24 a.m. UTC
According to 88pm860x spec, rtc alarm irq enable control is bit3 for
RTC_ALARM_EN, so fix it.

Signed-off-by: Jett.Zhou <jtzhou@marvell.com>
---
 drivers/rtc/rtc-88pm860x.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Comments

Andrew Morton March 27, 2012, 11:47 p.m. UTC | #1
On Fri,  9 Mar 2012 10:24:34 +0800
"Jett.Zhou" <jtzhou@marvell.com> wrote:

> According to 88pm860x spec, rtc alarm irq enable control is bit3 for
> RTC_ALARM_EN, so fix it.
> 
> Signed-off-by: Jett.Zhou <jtzhou@marvell.com>
> ---
>  drivers/rtc/rtc-88pm860x.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/rtc/rtc-88pm860x.c b/drivers/rtc/rtc-88pm860x.c
> index f04761e..8b72b4c 100644
> --- a/drivers/rtc/rtc-88pm860x.c
> +++ b/drivers/rtc/rtc-88pm860x.c
> @@ -72,9 +72,9 @@ static int pm860x_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
>  	struct pm860x_rtc_info *info = dev_get_drvdata(dev);
>  
>  	if (enabled)
> -		pm860x_set_bits(info->i2c, PM8607_RTC1, ALARM, ALARM);
> +		pm860x_set_bits(info->i2c, PM8607_RTC1, ALARM_EN, ALARM_EN);
>  	else
> -		pm860x_set_bits(info->i2c, PM8607_RTC1, ALARM, 0);
> +		pm860x_set_bits(info->i2c, PM8607_RTC1, ALARM_EN, 0);
>  	return 0;
>  }

It's surprising that the driver has been in-tree for a year and nobody
has noticed this bug.  This makes me wonder if the fix is wrong.

Has the patch been runtime tested?
Mark Brown March 28, 2012, 10:06 a.m. UTC | #2
On Tue, Mar 27, 2012 at 04:47:59PM -0700, Andrew Morton wrote:

> It's surprising that the driver has been in-tree for a year and nobody
> has noticed this bug.  This makes me wonder if the fix is wrong.

I rather suspect few of the boards that use this chip ever run mainline
and we're seeing the effects of Android's ICS release rolling out here -
it's using 3.0 as the default kernel which was the first version which
included this driver as standard.
diff mbox

Patch

diff --git a/drivers/rtc/rtc-88pm860x.c b/drivers/rtc/rtc-88pm860x.c
index f04761e..8b72b4c 100644
--- a/drivers/rtc/rtc-88pm860x.c
+++ b/drivers/rtc/rtc-88pm860x.c
@@ -72,9 +72,9 @@  static int pm860x_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
 	struct pm860x_rtc_info *info = dev_get_drvdata(dev);
 
 	if (enabled)
-		pm860x_set_bits(info->i2c, PM8607_RTC1, ALARM, ALARM);
+		pm860x_set_bits(info->i2c, PM8607_RTC1, ALARM_EN, ALARM_EN);
 	else
-		pm860x_set_bits(info->i2c, PM8607_RTC1, ALARM, 0);
+		pm860x_set_bits(info->i2c, PM8607_RTC1, ALARM_EN, 0);
 	return 0;
 }