diff options
author | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2018-02-25 17:15:00 -0500 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2018-03-17 09:20:48 -0400 |
commit | e2c8e1a9f7e52203c9a2712a2e35326d212ad5d7 (patch) | |
tree | 677f786defa7158e330db66d526d287e084f454a | |
parent | 10d0c768cc6d581523d673b9d1b54213f8a5eb24 (diff) |
rtc: m41t80: remove useless indirection
m41t80_get_datetime and m41t80_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>
-rw-r--r-- | drivers/rtc/rtc-m41t80.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/drivers/rtc/rtc-m41t80.c b/drivers/rtc/rtc-m41t80.c index f77320948fc4..ad03e2f12f5d 100644 --- a/drivers/rtc/rtc-m41t80.c +++ b/drivers/rtc/rtc-m41t80.c | |||
@@ -198,9 +198,9 @@ static irqreturn_t m41t80_handle_irq(int irq, void *dev_id) | |||
198 | return IRQ_HANDLED; | 198 | return IRQ_HANDLED; |
199 | } | 199 | } |
200 | 200 | ||
201 | static int m41t80_get_datetime(struct i2c_client *client, | 201 | static int m41t80_rtc_read_time(struct device *dev, struct rtc_time *tm) |
202 | struct rtc_time *tm) | ||
203 | { | 202 | { |
203 | struct i2c_client *client = to_i2c_client(dev); | ||
204 | unsigned char buf[8]; | 204 | unsigned char buf[8]; |
205 | int err, flags; | 205 | int err, flags; |
206 | 206 | ||
@@ -232,9 +232,9 @@ static int m41t80_get_datetime(struct i2c_client *client, | |||
232 | return 0; | 232 | return 0; |
233 | } | 233 | } |
234 | 234 | ||
235 | /* Sets the given date and time to the real time clock. */ | 235 | static int m41t80_rtc_set_time(struct device *dev, struct rtc_time *tm) |
236 | static int m41t80_set_datetime(struct i2c_client *client, struct rtc_time *tm) | ||
237 | { | 236 | { |
237 | struct i2c_client *client = to_i2c_client(dev); | ||
238 | struct m41t80_data *clientdata = i2c_get_clientdata(client); | 238 | struct m41t80_data *clientdata = i2c_get_clientdata(client); |
239 | unsigned char buf[8]; | 239 | unsigned char buf[8]; |
240 | int err, flags; | 240 | int err, flags; |
@@ -297,16 +297,6 @@ static int m41t80_rtc_proc(struct device *dev, struct seq_file *seq) | |||
297 | return 0; | 297 | return 0; |
298 | } | 298 | } |
299 | 299 | ||
300 | static int m41t80_rtc_read_time(struct device *dev, struct rtc_time *tm) | ||
301 | { | ||
302 | return m41t80_get_datetime(to_i2c_client(dev), tm); | ||
303 | } | ||
304 | |||
305 | static int m41t80_rtc_set_time(struct device *dev, struct rtc_time *tm) | ||
306 | { | ||
307 | return m41t80_set_datetime(to_i2c_client(dev), tm); | ||
308 | } | ||
309 | |||
310 | static int m41t80_alarm_irq_enable(struct device *dev, unsigned int enabled) | 300 | static int m41t80_alarm_irq_enable(struct device *dev, unsigned int enabled) |
311 | { | 301 | { |
312 | struct i2c_client *client = to_i2c_client(dev); | 302 | struct i2c_client *client = to_i2c_client(dev); |
@@ -947,7 +937,7 @@ static int m41t80_probe(struct i2c_client *client, | |||
947 | 937 | ||
948 | if (rc >= 0 && rc & M41T80_ALHOUR_HT) { | 938 | if (rc >= 0 && rc & M41T80_ALHOUR_HT) { |
949 | if (m41t80_data->features & M41T80_FEATURE_HT) { | 939 | if (m41t80_data->features & M41T80_FEATURE_HT) { |
950 | m41t80_get_datetime(client, &tm); | 940 | m41t80_rtc_read_time(&client->dev, &tm); |
951 | dev_info(&client->dev, "HT bit was set!\n"); | 941 | dev_info(&client->dev, "HT bit was set!\n"); |
952 | dev_info(&client->dev, | 942 | dev_info(&client->dev, |
953 | "Power Down at %04i-%02i-%02i %02i:%02i:%02i\n", | 943 | "Power Down at %04i-%02i-%02i %02i:%02i:%02i\n", |