From: Alexandre Belloni Date: Sun, 25 Feb 2018 22:15:00 +0000 (+0100) Subject: rtc: m41t80: remove useless indirection X-Git-Tag: v5.15~9060^2~34 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e2c8e1a9f7e52203c9a2712a2e35326d212ad5d7;p=platform%2Fkernel%2Flinux-starfive.git 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 --- diff --git a/drivers/rtc/rtc-m41t80.c b/drivers/rtc/rtc-m41t80.c index f773209..ad03e2f 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) return IRQ_HANDLED; } -static int m41t80_get_datetime(struct i2c_client *client, - struct rtc_time *tm) +static int m41t80_rtc_read_time(struct device *dev, struct rtc_time *tm) { + struct i2c_client *client = to_i2c_client(dev); unsigned char buf[8]; int err, flags; @@ -232,9 +232,9 @@ static int m41t80_get_datetime(struct i2c_client *client, return 0; } -/* Sets the given date and time to the real time clock. */ -static int m41t80_set_datetime(struct i2c_client *client, struct rtc_time *tm) +static int m41t80_rtc_set_time(struct device *dev, struct rtc_time *tm) { + struct i2c_client *client = to_i2c_client(dev); struct m41t80_data *clientdata = i2c_get_clientdata(client); unsigned char buf[8]; int err, flags; @@ -297,16 +297,6 @@ static int m41t80_rtc_proc(struct device *dev, struct seq_file *seq) return 0; } -static int m41t80_rtc_read_time(struct device *dev, struct rtc_time *tm) -{ - return m41t80_get_datetime(to_i2c_client(dev), tm); -} - -static int m41t80_rtc_set_time(struct device *dev, struct rtc_time *tm) -{ - return m41t80_set_datetime(to_i2c_client(dev), tm); -} - static int m41t80_alarm_irq_enable(struct device *dev, unsigned int enabled) { struct i2c_client *client = to_i2c_client(dev); @@ -947,7 +937,7 @@ static int m41t80_probe(struct i2c_client *client, if (rc >= 0 && rc & M41T80_ALHOUR_HT) { if (m41t80_data->features & M41T80_FEATURE_HT) { - m41t80_get_datetime(client, &tm); + m41t80_rtc_read_time(&client->dev, &tm); dev_info(&client->dev, "HT bit was set!\n"); dev_info(&client->dev, "Power Down at %04i-%02i-%02i %02i:%02i:%02i\n",