Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 11836494 authored by Wolfram Sang's avatar Wolfram Sang Committed by Linus Torvalds
Browse files

rtc: rs5c372: fix buffer size



Match the buffer size to the amount of initialized values.  Before, it was
one too big and thus destroyed the neighbouring register causing the clock
to run at false speeds.

Reported-by: default avatarAndre van Rooyen <a.v.rooyen@sercom.nl>
Signed-off-by: default avatarWolfram Sang <w.sang@pengutronix.de>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: <stable@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 69006096
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -207,7 +207,7 @@ static int rs5c372_get_datetime(struct i2c_client *client, struct rtc_time *tm)
static int rs5c372_set_datetime(struct i2c_client *client, struct rtc_time *tm)
static int rs5c372_set_datetime(struct i2c_client *client, struct rtc_time *tm)
{
{
	struct rs5c372	*rs5c = i2c_get_clientdata(client);
	struct rs5c372	*rs5c = i2c_get_clientdata(client);
	unsigned char	buf[8];
	unsigned char	buf[7];
	int		addr;
	int		addr;


	dev_dbg(&client->dev, "%s: tm is secs=%d, mins=%d, hours=%d "
	dev_dbg(&client->dev, "%s: tm is secs=%d, mins=%d, hours=%d "