提交 83ab7dad 编写于 作者: C Christophe JAILLET 提交者: Alexandre Belloni

rtc: pcf2123: Add missing error code assignment before test

It is likely that checking the result of 'pcf2123_write_reg' is expected
here.
Also fix a small style issue. The '{' at the beginning of the function
is misplaced.

Fixes: 809b453b ("rtc: pcf2123: clean up writes to the rtc chip")
Signed-off-by: NChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
上级 04940631
......@@ -182,7 +182,8 @@ static ssize_t pcf2123_show(struct device *dev, struct device_attribute *attr,
}
static ssize_t pcf2123_store(struct device *dev, struct device_attribute *attr,
const char *buffer, size_t count) {
const char *buffer, size_t count)
{
struct pcf2123_sysfs_reg *r;
unsigned long reg;
unsigned long val;
......@@ -199,7 +200,7 @@ static ssize_t pcf2123_store(struct device *dev, struct device_attribute *attr,
if (ret)
return ret;
pcf2123_write_reg(dev, reg, val);
ret = pcf2123_write_reg(dev, reg, val);
if (ret < 0)
return -EIO;
return count;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册