mirror of
https://kernel.googlesource.com/pub/scm/linux/kernel/git/stable/linux-stable.git
synced 2025-10-02 20:59:01 +10:00
rtc: s35390a: Remove the unneeded result variable
Return the value s35390a_set_reg() directly instead of storing it in another redundant variable. Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn> Link: https://lore.kernel.org/r/20220905090119.335121-1-ye.xingchen@zte.com.cn Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
This commit is contained in:
parent
c69bffe199
commit
f8513363b0
@ -211,7 +211,7 @@ static int s35390a_rtc_set_time(struct device *dev, struct rtc_time *tm)
|
|||||||
{
|
{
|
||||||
struct i2c_client *client = to_i2c_client(dev);
|
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;
|
||||||
char buf[7], status;
|
char buf[7], status;
|
||||||
|
|
||||||
dev_dbg(&client->dev, "%s: tm is secs=%d, mins=%d, hours=%d mday=%d, "
|
dev_dbg(&client->dev, "%s: tm is secs=%d, mins=%d, hours=%d mday=%d, "
|
||||||
@ -234,9 +234,7 @@ static int s35390a_rtc_set_time(struct device *dev, struct rtc_time *tm)
|
|||||||
for (i = 0; i < 7; ++i)
|
for (i = 0; i < 7; ++i)
|
||||||
buf[i] = bitrev8(buf[i]);
|
buf[i] = bitrev8(buf[i]);
|
||||||
|
|
||||||
err = s35390a_set_reg(s35390a, S35390A_CMD_TIME1, buf, sizeof(buf));
|
return s35390a_set_reg(s35390a, S35390A_CMD_TIME1, buf, sizeof(buf));
|
||||||
|
|
||||||
return err;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int s35390a_rtc_read_time(struct device *dev, struct rtc_time *tm)
|
static int s35390a_rtc_read_time(struct device *dev, struct rtc_time *tm)
|
||||||
|
Loading…
Reference in New Issue
Block a user