aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@bootlin.com>2018-02-21 09:47:14 -0500
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2018-03-17 09:20:45 -0400
commit44db5c92a7110e70b45a5caa1d56f8706b7fc76d (patch)
treeee75a3e32fd50fdb5de848e5e7e7e621f84576b3 /drivers/rtc
parent57f454fb52f631fb94fc64bcc7e77bf9ed52be9e (diff)
rtc: rs5c372: remove useless indirection
rs5c372_get_datetime and rs5c372_set_datetime are only used after casting dev to an i2c_client. Remove that useless indirection. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-rs5c372.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/drivers/rtc/rtc-rs5c372.c b/drivers/rtc/rtc-rs5c372.c
index ae7fa4324b0a..c5038329058c 100644
--- a/drivers/rtc/rtc-rs5c372.c
+++ b/drivers/rtc/rtc-rs5c372.c
@@ -207,8 +207,9 @@ static unsigned rs5c_hr2reg(struct rs5c372 *rs5c, unsigned hour)
207 return bin2bcd(hour); 207 return bin2bcd(hour);
208} 208}
209 209
210static int rs5c372_get_datetime(struct i2c_client *client, struct rtc_time *tm) 210static int rs5c372_rtc_read_time(struct device *dev, struct rtc_time *tm)
211{ 211{
212 struct i2c_client *client = to_i2c_client(dev);
212 struct rs5c372 *rs5c = i2c_get_clientdata(client); 213 struct rs5c372 *rs5c = i2c_get_clientdata(client);
213 int status = rs5c_get_regs(rs5c); 214 int status = rs5c_get_regs(rs5c);
214 215
@@ -237,8 +238,9 @@ static int rs5c372_get_datetime(struct i2c_client *client, struct rtc_time *tm)
237 return 0; 238 return 0;
238} 239}
239 240
240static int rs5c372_set_datetime(struct i2c_client *client, struct rtc_time *tm) 241static int rs5c372_rtc_set_time(struct device *dev, struct rtc_time *tm)
241{ 242{
243 struct i2c_client *client = to_i2c_client(dev);
242 struct rs5c372 *rs5c = i2c_get_clientdata(client); 244 struct rs5c372 *rs5c = i2c_get_clientdata(client);
243 unsigned char buf[7]; 245 unsigned char buf[7];
244 int addr; 246 int addr;
@@ -304,17 +306,6 @@ static int rs5c372_get_trim(struct i2c_client *client, int *osc, int *trim)
304} 306}
305#endif 307#endif
306 308
307static int rs5c372_rtc_read_time(struct device *dev, struct rtc_time *tm)
308{
309 return rs5c372_get_datetime(to_i2c_client(dev), tm);
310}
311
312static int rs5c372_rtc_set_time(struct device *dev, struct rtc_time *tm)
313{
314 return rs5c372_set_datetime(to_i2c_client(dev), tm);
315}
316
317
318static int rs5c_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled) 309static int rs5c_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
319{ 310{
320 struct i2c_client *client = to_i2c_client(dev); 311 struct i2c_client *client = to_i2c_client(dev);