mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
rtc/pxa: remove unnecessary private ops->ioctl()
We shouldn't implement private ops->ioctl() unless absolutely necessary. pxa series RTC driver's ioctl() is unnecessary, since RTC subsystem has implement the ioctl() very well,so we can only use the API of '.alarm_irq_enable' and '.update_irq_enable' to do enable irq action. Signed-off-by: Wan ZongShun <mcuos.com@gmail.com> Acked-by: Robert Jarzmik <robert.jarzmik@free.fr> Acked-by: Eric Miao <eric.y.miao@gmail.com> Cc: Paul Gortmaker <p_gortmaker@yahoo.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
f3f99cf391
commit
93b1384fb2
@ -235,32 +235,34 @@ static int pxa_periodic_irq_set_state(struct device *dev, int enabled)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int pxa_rtc_ioctl(struct device *dev, unsigned int cmd,
|
static int pxa_alarm_irq_enable(struct device *dev, unsigned int enabled)
|
||||||
unsigned long arg)
|
|
||||||
{
|
{
|
||||||
struct pxa_rtc *pxa_rtc = dev_get_drvdata(dev);
|
struct pxa_rtc *pxa_rtc = dev_get_drvdata(dev);
|
||||||
int ret = 0;
|
|
||||||
|
|
||||||
spin_lock_irq(&pxa_rtc->lock);
|
spin_lock_irq(&pxa_rtc->lock);
|
||||||
switch (cmd) {
|
|
||||||
case RTC_AIE_OFF:
|
if (enabled)
|
||||||
rtsr_clear_bits(pxa_rtc, RTSR_RDALE1);
|
|
||||||
break;
|
|
||||||
case RTC_AIE_ON:
|
|
||||||
rtsr_set_bits(pxa_rtc, RTSR_RDALE1);
|
rtsr_set_bits(pxa_rtc, RTSR_RDALE1);
|
||||||
break;
|
else
|
||||||
case RTC_UIE_OFF:
|
rtsr_clear_bits(pxa_rtc, RTSR_RDALE1);
|
||||||
rtsr_clear_bits(pxa_rtc, RTSR_HZE);
|
|
||||||
break;
|
|
||||||
case RTC_UIE_ON:
|
|
||||||
rtsr_set_bits(pxa_rtc, RTSR_HZE);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
ret = -ENOIOCTLCMD;
|
|
||||||
}
|
|
||||||
|
|
||||||
spin_unlock_irq(&pxa_rtc->lock);
|
spin_unlock_irq(&pxa_rtc->lock);
|
||||||
return ret;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int pxa_update_irq_enable(struct device *dev, unsigned int enabled)
|
||||||
|
{
|
||||||
|
struct pxa_rtc *pxa_rtc = dev_get_drvdata(dev);
|
||||||
|
|
||||||
|
spin_lock_irq(&pxa_rtc->lock);
|
||||||
|
|
||||||
|
if (enabled)
|
||||||
|
rtsr_set_bits(pxa_rtc, RTSR_HZE);
|
||||||
|
else
|
||||||
|
rtsr_clear_bits(pxa_rtc, RTSR_HZE);
|
||||||
|
|
||||||
|
spin_unlock_irq(&pxa_rtc->lock);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int pxa_rtc_read_time(struct device *dev, struct rtc_time *tm)
|
static int pxa_rtc_read_time(struct device *dev, struct rtc_time *tm)
|
||||||
@ -339,11 +341,12 @@ static int pxa_rtc_proc(struct device *dev, struct seq_file *seq)
|
|||||||
static const struct rtc_class_ops pxa_rtc_ops = {
|
static const struct rtc_class_ops pxa_rtc_ops = {
|
||||||
.open = pxa_rtc_open,
|
.open = pxa_rtc_open,
|
||||||
.release = pxa_rtc_release,
|
.release = pxa_rtc_release,
|
||||||
.ioctl = pxa_rtc_ioctl,
|
|
||||||
.read_time = pxa_rtc_read_time,
|
.read_time = pxa_rtc_read_time,
|
||||||
.set_time = pxa_rtc_set_time,
|
.set_time = pxa_rtc_set_time,
|
||||||
.read_alarm = pxa_rtc_read_alarm,
|
.read_alarm = pxa_rtc_read_alarm,
|
||||||
.set_alarm = pxa_rtc_set_alarm,
|
.set_alarm = pxa_rtc_set_alarm,
|
||||||
|
.alarm_irq_enable = pxa_alarm_irq_enable,
|
||||||
|
.update_irq_enable = pxa_update_irq_enable,
|
||||||
.proc = pxa_rtc_proc,
|
.proc = pxa_rtc_proc,
|
||||||
.irq_set_state = pxa_periodic_irq_set_state,
|
.irq_set_state = pxa_periodic_irq_set_state,
|
||||||
.irq_set_freq = pxa_periodic_irq_set_freq,
|
.irq_set_freq = pxa_periodic_irq_set_freq,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user