From patchwork Thu Apr 2 03:34:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 46687 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 95766216D1 for ; Thu, 2 Apr 2015 03:35:28 +0000 (UTC) Received: by widjs5 with SMTP id js5sf1327242wid.3 for ; Wed, 01 Apr 2015 20:35:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=fjfGd/WQlTpgdB4T+uC066NHnA7dpGxbSNTcUuZTFa4=; b=KzTe+293WZvSCClGzYLwXBttGsuFIMwKab4UCtRDcZCyyvoVCU5UQkAhbCeWIblx9n pz+831X1WUlaE2Sx2jfeOX6sMf7QpKePZ/rFTZ2zPwiX7rOuO7kFGrgtQ8i+0AZw34M2 ROf3tbTZo0JkpQfTl4BzRwu5JNw3mLkK+xdX2L2eDFH3l8d+eNUEffNAmo874k1XeVhO +FduH3Pb3o8hPXyOSakSMsX4DjXKhLq6fu2FhE3vsLNCXFQmkmX/+qQnIRpUPZSriJIC HpZmAQL1WEXRVSEIhai1C9hyb0xAe3LGl6ueSiuWYSQUQFHIBijVkNSTnoQYCNDiCGno refA== X-Gm-Message-State: ALoCoQnO3vGoA+C3cpPzJoFyq6FT4qu8aZupQ0NEMayEPx7IFbnIB3Z3jlOsaqNpOm3+e3x7d3hl X-Received: by 10.112.137.202 with SMTP id qk10mr3043687lbb.21.1427945727816; Wed, 01 Apr 2015 20:35:27 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.87.106 with SMTP id w10ls159398laz.62.gmail; Wed, 01 Apr 2015 20:35:27 -0700 (PDT) X-Received: by 10.152.8.17 with SMTP id n17mr27477327laa.63.1427945727532; Wed, 01 Apr 2015 20:35:27 -0700 (PDT) Received: from mail-la0-f42.google.com (mail-la0-f42.google.com. [209.85.215.42]) by mx.google.com with ESMTPS id lj8si3132725lab.82.2015.04.01.20.35.27 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Apr 2015 20:35:27 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) client-ip=209.85.215.42; Received: by lagg8 with SMTP id g8so51126583lag.1 for ; Wed, 01 Apr 2015 20:35:27 -0700 (PDT) X-Received: by 10.112.125.167 with SMTP id mr7mr12103983lbb.106.1427945727444; Wed, 01 Apr 2015 20:35:27 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.57.201 with SMTP id k9csp1063332lbq; Wed, 1 Apr 2015 20:35:26 -0700 (PDT) X-Received: by 10.66.237.35 with SMTP id uz3mr84303953pac.46.1427945701905; Wed, 01 Apr 2015 20:35:01 -0700 (PDT) Received: from mail-pd0-f172.google.com (mail-pd0-f172.google.com. [209.85.192.172]) by mx.google.com with ESMTPS id pk6si5478365pbc.162.2015.04.01.20.35.00 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Apr 2015 20:35:01 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.192.172 as permitted sender) client-ip=209.85.192.172; Received: by pdbni2 with SMTP id ni2so75633567pdb.1 for ; Wed, 01 Apr 2015 20:35:00 -0700 (PDT) X-Received: by 10.70.0.98 with SMTP id 2mr43714330pdd.55.1427945700197; Wed, 01 Apr 2015 20:35:00 -0700 (PDT) Received: from localhost.localdomain (c-67-170-153-23.hsd1.or.comcast.net. [67.170.153.23]) by mx.google.com with ESMTPSA id da10sm3572603pac.42.2015.04.01.20.34.59 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 01 Apr 2015 20:34:59 -0700 (PDT) From: John Stultz To: lkml Cc: Xunlei Pang , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , John Stultz Subject: [PATCH 11/21] rtc/mxc: Modify rtc_update_alarm() not to touch the alarm time Date: Wed, 1 Apr 2015 20:34:31 -0700 Message-Id: <1427945681-29972-12-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1427945681-29972-1-git-send-email-john.stultz@linaro.org> References: <1427945681-29972-1-git-send-email-john.stultz@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: john.stultz@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Xunlei Pang 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. Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Ingo Molnar Acked-by: Alessandro Zummo Signed-off-by: Xunlei Pang Signed-off-by: John Stultz --- 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);