Commit 859a6ddb authored by Alexandre Belloni's avatar Alexandre Belloni

rtc: max6900: remove useless indirection

max6900_i2c_read_time and max6900_i2c_set_time 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 ceed43f7
...@@ -139,8 +139,9 @@ static int max6900_i2c_write_regs(struct i2c_client *client, u8 const *buf) ...@@ -139,8 +139,9 @@ static int max6900_i2c_write_regs(struct i2c_client *client, u8 const *buf)
return -EIO; return -EIO;
} }
static int max6900_i2c_read_time(struct i2c_client *client, struct rtc_time *tm) static int max6900_rtc_read_time(struct device *dev, struct rtc_time *tm)
{ {
struct i2c_client *client = to_i2c_client(dev);
int rc; int rc;
u8 regs[MAX6900_REG_LEN]; u8 regs[MAX6900_REG_LEN];
...@@ -165,9 +166,9 @@ static int max6900_i2c_clear_write_protect(struct i2c_client *client) ...@@ -165,9 +166,9 @@ static int max6900_i2c_clear_write_protect(struct i2c_client *client)
return i2c_smbus_write_byte_data(client, MAX6900_REG_CONTROL_WRITE, 0); return i2c_smbus_write_byte_data(client, MAX6900_REG_CONTROL_WRITE, 0);
} }
static int static int max6900_rtc_set_time(struct device *dev, struct rtc_time *tm)
max6900_i2c_set_time(struct i2c_client *client, struct rtc_time const *tm)
{ {
struct i2c_client *client = to_i2c_client(dev);
u8 regs[MAX6900_REG_LEN]; u8 regs[MAX6900_REG_LEN];
int rc; int rc;
...@@ -193,16 +194,6 @@ max6900_i2c_set_time(struct i2c_client *client, struct rtc_time const *tm) ...@@ -193,16 +194,6 @@ max6900_i2c_set_time(struct i2c_client *client, struct rtc_time const *tm)
return 0; return 0;
} }
static int max6900_rtc_read_time(struct device *dev, struct rtc_time *tm)
{
return max6900_i2c_read_time(to_i2c_client(dev), tm);
}
static int max6900_rtc_set_time(struct device *dev, struct rtc_time *tm)
{
return max6900_i2c_set_time(to_i2c_client(dev), tm);
}
static const struct rtc_class_ops max6900_rtc_ops = { static const struct rtc_class_ops max6900_rtc_ops = {
.read_time = max6900_rtc_read_time, .read_time = max6900_rtc_read_time,
.set_time = max6900_rtc_set_time, .set_time = max6900_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