[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-482494a8d395877c4776a3d76f89342d7ad7c4c6@git.kernel.org>
Date: Fri, 3 Apr 2015 01:18:32 -0700
From: tip-bot for Xunlei Pang <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: a.zummo@...ertech.it, tglx@...utronix.de, hpa@...or.com,
mingo@...nel.org, john.stultz@...aro.org, pang.xunlei@...aro.org,
linux-kernel@...r.kernel.org, peterz@...radead.org
Subject: [tip:timers/core] drivers/rtc/mxc: Modify rtc_update_alarm()
not to touch the alarm time
Commit-ID: 482494a8d395877c4776a3d76f89342d7ad7c4c6
Gitweb: http://git.kernel.org/tip/482494a8d395877c4776a3d76f89342d7ad7c4c6
Author: Xunlei Pang <pang.xunlei@...aro.org>
AuthorDate: Wed, 1 Apr 2015 20:34:31 -0700
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Fri, 3 Apr 2015 08:18:27 +0200
drivers/rtc/mxc: Modify rtc_update_alarm() not to touch the alarm time
rtc_class_ops's set_alarm() shouldn't deal with the alarm date,
as this is handled in the rtc core.
See rtc_dev_ioctl()'s RTC_ALM_SET and RTC_WKALM_SET cases.
Signed-off-by: Xunlei Pang <pang.xunlei@...aro.org>
Signed-off-by: John Stultz <john.stultz@...aro.org>
Acked-by: Alessandro Zummo <a.zummo@...ertech.it>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Link: http://lkml.kernel.org/r/1427945681-29972-12-git-send-email-john.stultz@linaro.org
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
drivers/rtc/rtc-mxc.c | 22 ++++------------------
1 file changed, 4 insertions(+), 18 deletions(-)
diff --git a/drivers/rtc/rtc-mxc.c b/drivers/rtc/rtc-mxc.c
index 3c3f8d1..a7b218f 100644
--- a/drivers/rtc/rtc-mxc.c
+++ b/drivers/rtc/rtc-mxc.c
@@ -173,29 +173,18 @@ static void set_alarm_or_time(struct device *dev, int time_alarm, u32 time)
* This function updates the RTC alarm registers and then clears all the
* interrupt status bits.
*/
-static int rtc_update_alarm(struct device *dev, struct rtc_time *alrm)
+static void rtc_update_alarm(struct device *dev, struct rtc_time *alrm)
{
- struct rtc_time alarm_tm, now_tm;
- unsigned long now, time;
+ unsigned long time;
struct platform_device *pdev = to_platform_device(dev);
struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
void __iomem *ioaddr = pdata->ioaddr;
- now = get_alarm_or_time(dev, MXC_RTC_TIME);
- rtc_time_to_tm(now, &now_tm);
- alarm_tm.tm_year = now_tm.tm_year;
- alarm_tm.tm_mon = now_tm.tm_mon;
- alarm_tm.tm_mday = now_tm.tm_mday;
- alarm_tm.tm_hour = alrm->tm_hour;
- alarm_tm.tm_min = alrm->tm_min;
- alarm_tm.tm_sec = alrm->tm_sec;
- rtc_tm_to_time(&alarm_tm, &time);
+ rtc_tm_to_time(alrm, &time);
/* clear all the interrupt status bits */
writew(readw(ioaddr + RTC_RTCISR), ioaddr + RTC_RTCISR);
set_alarm_or_time(dev, MXC_RTC_ALARM, time);
-
- return 0;
}
static void mxc_rtc_irq_enable(struct device *dev, unsigned int bit,
@@ -346,11 +335,8 @@ static int mxc_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
{
struct platform_device *pdev = to_platform_device(dev);
struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
- int ret;
- ret = rtc_update_alarm(dev, &alrm->time);
- if (ret)
- return ret;
+ rtc_update_alarm(dev, &alrm->time);
memcpy(&pdata->g_rtc_alarm, &alrm->time, sizeof(struct rtc_time));
mxc_rtc_irq_enable(dev, RTC_ALM_BIT, alrm->enabled);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists