]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
rtc: pcf2123: Add missing error code assignment before test
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Tue, 9 Aug 2016 11:58:27 +0000 (13:58 +0200)
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>
Wed, 31 Aug 2016 16:21:34 +0000 (18:21 +0200)
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: 809b453b76e15 ("rtc: pcf2123: clean up writes to the rtc chip")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
drivers/rtc/rtc-pcf2123.c

index b4478cc92b55dbd76731ea8ec6a4228677adcebb..8895f77726e8da5444afcd602dceff8f25a9b3fd 100644 (file)
@@ -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;