diff options
author | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2019-08-29 17:25:46 -0400 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2019-09-01 03:18:50 -0400 |
commit | c7d5f6dbd9f9a68374f3d24c63a99691d792fd29 (patch) | |
tree | 2034cacaea955a1b9bfea0ad1c16a240de1f0bb2 | |
parent | 8d3f805e6896798a1a40173d3734463363431b8e (diff) |
rtc: pcf8563: remove useless indirection
pcf8563_rtc_read_time and pcf8563_set_datetime are only used after casting
dev to an i2c_client. Remove that useless indirection.
Link: https://lore.kernel.org/r/20190829212547.19185-4-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-rw-r--r-- | drivers/rtc/rtc-pcf8563.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/drivers/rtc/rtc-pcf8563.c b/drivers/rtc/rtc-pcf8563.c index 0e375e19c149..45462ec460a3 100644 --- a/drivers/rtc/rtc-pcf8563.c +++ b/drivers/rtc/rtc-pcf8563.c | |||
@@ -196,8 +196,9 @@ static irqreturn_t pcf8563_irq(int irq, void *dev_id) | |||
196 | * In the routines that deal directly with the pcf8563 hardware, we use | 196 | * In the routines that deal directly with the pcf8563 hardware, we use |
197 | * rtc_time -- month 0-11, hour 0-23, yr = calendar year-epoch. | 197 | * rtc_time -- month 0-11, hour 0-23, yr = calendar year-epoch. |
198 | */ | 198 | */ |
199 | static int pcf8563_get_datetime(struct i2c_client *client, struct rtc_time *tm) | 199 | static int pcf8563_rtc_read_time(struct device *dev, struct rtc_time *tm) |
200 | { | 200 | { |
201 | struct i2c_client *client = to_i2c_client(dev); | ||
201 | struct pcf8563 *pcf8563 = i2c_get_clientdata(client); | 202 | struct pcf8563 *pcf8563 = i2c_get_clientdata(client); |
202 | unsigned char buf[9]; | 203 | unsigned char buf[9]; |
203 | int err; | 204 | int err; |
@@ -244,8 +245,9 @@ static int pcf8563_get_datetime(struct i2c_client *client, struct rtc_time *tm) | |||
244 | return 0; | 245 | return 0; |
245 | } | 246 | } |
246 | 247 | ||
247 | static int pcf8563_set_datetime(struct i2c_client *client, struct rtc_time *tm) | 248 | static int pcf8563_rtc_set_time(struct device *dev, struct rtc_time *tm) |
248 | { | 249 | { |
250 | struct i2c_client *client = to_i2c_client(dev); | ||
249 | struct pcf8563 *pcf8563 = i2c_get_clientdata(client); | 251 | struct pcf8563 *pcf8563 = i2c_get_clientdata(client); |
250 | unsigned char buf[9]; | 252 | unsigned char buf[9]; |
251 | 253 | ||
@@ -299,8 +301,8 @@ static int pcf8563_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long | |||
299 | * because of the cached voltage_low value but do it | 301 | * because of the cached voltage_low value but do it |
300 | * anyway for consistency. | 302 | * anyway for consistency. |
301 | */ | 303 | */ |
302 | if (pcf8563_get_datetime(to_i2c_client(dev), &tm)) | 304 | if (pcf8563_rtc_read_time(dev, &tm)) |
303 | pcf8563_set_datetime(to_i2c_client(dev), &tm); | 305 | pcf8563_rtc_set_time(dev, &tm); |
304 | 306 | ||
305 | /* Clear the cached value. */ | 307 | /* Clear the cached value. */ |
306 | pcf8563->voltage_low = 0; | 308 | pcf8563->voltage_low = 0; |
@@ -314,16 +316,6 @@ static int pcf8563_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long | |||
314 | #define pcf8563_rtc_ioctl NULL | 316 | #define pcf8563_rtc_ioctl NULL |
315 | #endif | 317 | #endif |
316 | 318 | ||
317 | static int pcf8563_rtc_read_time(struct device *dev, struct rtc_time *tm) | ||
318 | { | ||
319 | return pcf8563_get_datetime(to_i2c_client(dev), tm); | ||
320 | } | ||
321 | |||
322 | static int pcf8563_rtc_set_time(struct device *dev, struct rtc_time *tm) | ||
323 | { | ||
324 | return pcf8563_set_datetime(to_i2c_client(dev), tm); | ||
325 | } | ||
326 | |||
327 | static int pcf8563_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *tm) | 319 | static int pcf8563_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *tm) |
328 | { | 320 | { |
329 | struct i2c_client *client = to_i2c_client(dev); | 321 | struct i2c_client *client = to_i2c_client(dev); |