aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-ds1672.c
diff options
context:
space:
mode:
authorAlessandro Zummo <a.zummo@towertech.it>2009-01-06 17:42:21 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-01-06 18:59:25 -0500
commitbbccf83f6c4e1a0de5bdf51ec9ec708d3a1ce933 (patch)
tree8c9797c7914b0f7fc78e5878ef33ae5f3219a202 /drivers/rtc/rtc-ds1672.c
parentf60091575d43e5a27b26f4d6fa4251cdd6b9ae8a (diff)
rtc: use set_mmss when set_time is not available
Drivers should only need to implement either set_mmss (counter based RTCs) or set_time (most RTCs). The RTC subsystem will handle them appropriately. Signed-off-by: Alessandro Zummo <a.zummo@towertech.it> Cc: Kumar Gala <galak@kernel.crashing.org> Cc: David Brownell <david-b@pacbell.net> Cc: Lennert Buytenhek <buytenh@wantstofly.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rtc/rtc-ds1672.c')
-rw-r--r--drivers/rtc/rtc-ds1672.c22
1 files changed, 0 insertions, 22 deletions
diff --git a/drivers/rtc/rtc-ds1672.c b/drivers/rtc/rtc-ds1672.c
index 4e91419e8911..06dfb54f99b6 100644
--- a/drivers/rtc/rtc-ds1672.c
+++ b/drivers/rtc/rtc-ds1672.c
@@ -83,32 +83,11 @@ static int ds1672_set_mmss(struct i2c_client *client, unsigned long secs)
83 return 0; 83 return 0;
84} 84}
85 85
86static int ds1672_set_datetime(struct i2c_client *client, struct rtc_time *tm)
87{
88 unsigned long secs;
89
90 dev_dbg(&client->dev,
91 "%s: secs=%d, mins=%d, hours=%d, "
92 "mday=%d, mon=%d, year=%d, wday=%d\n",
93 __func__,
94 tm->tm_sec, tm->tm_min, tm->tm_hour,
95 tm->tm_mday, tm->tm_mon, tm->tm_year, tm->tm_wday);
96
97 rtc_tm_to_time(tm, &secs);
98
99 return ds1672_set_mmss(client, secs);
100}
101
102static int ds1672_rtc_read_time(struct device *dev, struct rtc_time *tm) 86static int ds1672_rtc_read_time(struct device *dev, struct rtc_time *tm)
103{ 87{
104 return ds1672_get_datetime(to_i2c_client(dev), tm); 88 return ds1672_get_datetime(to_i2c_client(dev), tm);
105} 89}
106 90
107static int ds1672_rtc_set_time(struct device *dev, struct rtc_time *tm)
108{
109 return ds1672_set_datetime(to_i2c_client(dev), tm);
110}
111
112static int ds1672_rtc_set_mmss(struct device *dev, unsigned long secs) 91static int ds1672_rtc_set_mmss(struct device *dev, unsigned long secs)
113{ 92{
114 return ds1672_set_mmss(to_i2c_client(dev), secs); 93 return ds1672_set_mmss(to_i2c_client(dev), secs);
@@ -152,7 +131,6 @@ static DEVICE_ATTR(control, S_IRUGO, show_control, NULL);
152 131
153static const struct rtc_class_ops ds1672_rtc_ops = { 132static const struct rtc_class_ops ds1672_rtc_ops = {
154 .read_time = ds1672_rtc_read_time, 133 .read_time = ds1672_rtc_read_time,
155 .set_time = ds1672_rtc_set_time,
156 .set_mmss = ds1672_rtc_set_mmss, 134 .set_mmss = ds1672_rtc_set_mmss,
157}; 135};
158 136