Commit 965271df authored by Alexandre Belloni's avatar Alexandre Belloni

rtc: pcf85063: remove useless indirection

pcf85063_get_datetime and pcf85063_set_datetime are only used after casting
dev to an i2c_client. Remove that useless indirection.
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
parent 0a6b8886
...@@ -81,8 +81,9 @@ static int pcf85063_start_clock(struct i2c_client *client, u8 ctrl1) ...@@ -81,8 +81,9 @@ static int pcf85063_start_clock(struct i2c_client *client, u8 ctrl1)
return 0; return 0;
} }
static int pcf85063_get_datetime(struct i2c_client *client, struct rtc_time *tm) static int pcf85063_rtc_read_time(struct device *dev, struct rtc_time *tm)
{ {
struct i2c_client *client = to_i2c_client(dev);
int rc; int rc;
u8 regs[7]; u8 regs[7];
...@@ -117,8 +118,9 @@ static int pcf85063_get_datetime(struct i2c_client *client, struct rtc_time *tm) ...@@ -117,8 +118,9 @@ static int pcf85063_get_datetime(struct i2c_client *client, struct rtc_time *tm)
return 0; return 0;
} }
static int pcf85063_set_datetime(struct i2c_client *client, struct rtc_time *tm) static int pcf85063_rtc_set_time(struct device *dev, struct rtc_time *tm)
{ {
struct i2c_client *client = to_i2c_client(dev);
int rc; int rc;
u8 regs[7]; u8 regs[7];
u8 ctrl1; u8 ctrl1;
...@@ -172,16 +174,6 @@ static int pcf85063_set_datetime(struct i2c_client *client, struct rtc_time *tm) ...@@ -172,16 +174,6 @@ static int pcf85063_set_datetime(struct i2c_client *client, struct rtc_time *tm)
return 0; return 0;
} }
static int pcf85063_rtc_read_time(struct device *dev, struct rtc_time *tm)
{
return pcf85063_get_datetime(to_i2c_client(dev), tm);
}
static int pcf85063_rtc_set_time(struct device *dev, struct rtc_time *tm)
{
return pcf85063_set_datetime(to_i2c_client(dev), tm);
}
static const struct rtc_class_ops pcf85063_rtc_ops = { static const struct rtc_class_ops pcf85063_rtc_ops = {
.read_time = pcf85063_rtc_read_time, .read_time = pcf85063_rtc_read_time,
.set_time = pcf85063_rtc_set_time .set_time = pcf85063_rtc_set_time
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment