summaryrefslogtreecommitdiff
path: root/drivers/rtc/rtc-rx8581.c
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@bootlin.com>2018-05-17 23:33:28 +0300
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2018-05-17 23:37:18 +0300
commit2d2b300b3875cb76b67e5aa6ba39b58519942411 (patch)
tree2c8c3737b1b7cd53acca61c732b79155c70c867b /drivers/rtc/rtc-rx8581.c
parentc6e3c297a1948095c248058fd4ba51b1f9d12e7f (diff)
downloadlinux-2d2b300b3875cb76b67e5aa6ba39b58519942411.tar.xz
rtc: rx8581: remove useless indirection
rx8581_get_datetime and rx8581_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/rtc-rx8581.c')
-rw-r--r--drivers/rtc/rtc-rx8581.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/drivers/rtc/rtc-rx8581.c b/drivers/rtc/rtc-rx8581.c
index 171ee241bd2f..a91fbb86a110 100644
--- a/drivers/rtc/rtc-rx8581.c
+++ b/drivers/rtc/rtc-rx8581.c
@@ -93,8 +93,9 @@ static int rx8581_write_block_data(const struct i2c_client *client, u8 command,
* In the routines that deal directly with the rx8581 hardware, we use
* rtc_time -- month 0-11, hour 0-23, yr = calendar year-epoch.
*/
-static int rx8581_get_datetime(struct i2c_client *client, struct rtc_time *tm)
+static int rx8581_rtc_read_time(struct device *dev, struct rtc_time *tm)
{
+ struct i2c_client *client = to_i2c_client(dev);
unsigned char date[7];
int data, err;
struct rx8581 *rx8581 = i2c_get_clientdata(client);
@@ -164,8 +165,9 @@ static int rx8581_get_datetime(struct i2c_client *client, struct rtc_time *tm)
return 0;
}
-static int rx8581_set_datetime(struct i2c_client *client, struct rtc_time *tm)
+static int rx8581_rtc_set_time(struct device *dev, struct rtc_time *tm)
{
+ struct i2c_client *client = to_i2c_client(dev);
int data, err;
unsigned char buf[7];
struct rx8581 *rx8581 = i2c_get_clientdata(client);
@@ -242,16 +244,6 @@ static int rx8581_set_datetime(struct i2c_client *client, struct rtc_time *tm)
return 0;
}
-static int rx8581_rtc_read_time(struct device *dev, struct rtc_time *tm)
-{
- return rx8581_get_datetime(to_i2c_client(dev), tm);
-}
-
-static int rx8581_rtc_set_time(struct device *dev, struct rtc_time *tm)
-{
- return rx8581_set_datetime(to_i2c_client(dev), tm);
-}
-
static const struct rtc_class_ops rx8581_rtc_ops = {
.read_time = rx8581_rtc_read_time,
.set_time = rx8581_rtc_set_time,