Commit 779e1aab authored by Alexandre Belloni's avatar Alexandre Belloni

rtc: s35390a: remove useless indirection

s35390a_set_datetime, s35390a_get_datetime, s35390a_set_alarm and
s35390a_read_alarm 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 bb530199
...@@ -210,8 +210,9 @@ static int s35390a_reg2hr(struct s35390a *s35390a, char reg) ...@@ -210,8 +210,9 @@ static int s35390a_reg2hr(struct s35390a *s35390a, char reg)
return hour; return hour;
} }
static int s35390a_set_datetime(struct i2c_client *client, struct rtc_time *tm) static int s35390a_rtc_set_time(struct device *dev, struct rtc_time *tm)
{ {
struct i2c_client *client = to_i2c_client(dev);
struct s35390a *s35390a = i2c_get_clientdata(client); struct s35390a *s35390a = i2c_get_clientdata(client);
int i, err; int i, err;
char buf[7], status; char buf[7], status;
...@@ -241,8 +242,9 @@ static int s35390a_set_datetime(struct i2c_client *client, struct rtc_time *tm) ...@@ -241,8 +242,9 @@ static int s35390a_set_datetime(struct i2c_client *client, struct rtc_time *tm)
return err; return err;
} }
static int s35390a_get_datetime(struct i2c_client *client, struct rtc_time *tm) static int s35390a_rtc_read_time(struct device *dev, struct rtc_time *tm)
{ {
struct i2c_client *client = to_i2c_client(dev);
struct s35390a *s35390a = i2c_get_clientdata(client); struct s35390a *s35390a = i2c_get_clientdata(client);
char buf[7], status; char buf[7], status;
int i, err; int i, err;
...@@ -274,8 +276,9 @@ static int s35390a_get_datetime(struct i2c_client *client, struct rtc_time *tm) ...@@ -274,8 +276,9 @@ static int s35390a_get_datetime(struct i2c_client *client, struct rtc_time *tm)
return 0; return 0;
} }
static int s35390a_set_alarm(struct i2c_client *client, struct rtc_wkalrm *alm) static int s35390a_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm)
{ {
struct i2c_client *client = to_i2c_client(dev);
struct s35390a *s35390a = i2c_get_clientdata(client); struct s35390a *s35390a = i2c_get_clientdata(client);
char buf[3], sts = 0; char buf[3], sts = 0;
int err, i; int err, i;
...@@ -329,8 +332,9 @@ static int s35390a_set_alarm(struct i2c_client *client, struct rtc_wkalrm *alm) ...@@ -329,8 +332,9 @@ static int s35390a_set_alarm(struct i2c_client *client, struct rtc_wkalrm *alm)
return err; return err;
} }
static int s35390a_read_alarm(struct i2c_client *client, struct rtc_wkalrm *alm) static int s35390a_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alm)
{ {
struct i2c_client *client = to_i2c_client(dev);
struct s35390a *s35390a = i2c_get_clientdata(client); struct s35390a *s35390a = i2c_get_clientdata(client);
char buf[3], sts; char buf[3], sts;
int i, err; int i, err;
...@@ -384,26 +388,6 @@ static int s35390a_read_alarm(struct i2c_client *client, struct rtc_wkalrm *alm) ...@@ -384,26 +388,6 @@ static int s35390a_read_alarm(struct i2c_client *client, struct rtc_wkalrm *alm)
return 0; return 0;
} }
static int s35390a_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alm)
{
return s35390a_read_alarm(to_i2c_client(dev), alm);
}
static int s35390a_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm)
{
return s35390a_set_alarm(to_i2c_client(dev), alm);
}
static int s35390a_rtc_read_time(struct device *dev, struct rtc_time *tm)
{
return s35390a_get_datetime(to_i2c_client(dev), tm);
}
static int s35390a_rtc_set_time(struct device *dev, struct rtc_time *tm)
{
return s35390a_set_datetime(to_i2c_client(dev), tm);
}
static int s35390a_rtc_ioctl(struct device *dev, unsigned int cmd, static int s35390a_rtc_ioctl(struct device *dev, unsigned int cmd,
unsigned long arg) unsigned long arg)
{ {
......
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