From 3d22cf39d37525c2c2e8808e1e5dbe3667112860 Mon Sep 17 00:00:00 2001 From: John Stultz Date: Tue, 6 Mar 2012 17:16:09 -0800 Subject: [PATCH] --- yaml --- r: 297384 b: refs/heads/master c: 4a649903f91232d02284d53724b0a45728111767 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/rtc/interface.c | 5 +++++ trunk/drivers/rtc/rtc-mpc5121.c | 2 ++ trunk/include/linux/rtc.h | 3 ++- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 86719555f1b1..efc52a4a0b98 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 74a622be3db2898251cb524d1edbeaea589f2723 +refs/heads/master: 4a649903f91232d02284d53724b0a45728111767 diff --git a/trunk/drivers/rtc/interface.c b/trunk/drivers/rtc/interface.c index dc87eda65814..eb415bd76494 100644 --- a/trunk/drivers/rtc/interface.c +++ b/trunk/drivers/rtc/interface.c @@ -458,6 +458,11 @@ int rtc_update_irq_enable(struct rtc_device *rtc, unsigned int enabled) if (rtc->uie_rtctimer.enabled == enabled) goto out; + if (rtc->uie_unsupported) { + err = -EINVAL; + goto out; + } + if (enabled) { struct rtc_time tm; ktime_t now, onesec; diff --git a/trunk/drivers/rtc/rtc-mpc5121.c b/trunk/drivers/rtc/rtc-mpc5121.c index 9d3caccfc250..613447abdbe5 100644 --- a/trunk/drivers/rtc/rtc-mpc5121.c +++ b/trunk/drivers/rtc/rtc-mpc5121.c @@ -360,6 +360,8 @@ static int __devinit mpc5121_rtc_probe(struct platform_device *op) &mpc5200_rtc_ops, THIS_MODULE); } + rtc->rtc->uie_unsupported = 1; + if (IS_ERR(rtc->rtc)) { err = PTR_ERR(rtc->rtc); goto out_free_irq; diff --git a/trunk/include/linux/rtc.h b/trunk/include/linux/rtc.h index 93f4d035076b..fcabfb4873c8 100644 --- a/trunk/include/linux/rtc.h +++ b/trunk/include/linux/rtc.h @@ -202,7 +202,8 @@ struct rtc_device struct hrtimer pie_timer; /* sub second exp, so needs hrtimer */ int pie_enabled; struct work_struct irqwork; - + /* Some hardware can't support UIE mode */ + int uie_unsupported; #ifdef CONFIG_RTC_INTF_DEV_UIE_EMUL struct work_struct uie_task;