diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2016-08-09 07:58:27 -0400 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@free-electrons.com> | 2016-08-31 12:21:34 -0400 |
commit | 83ab7dad06b74e390c2ce0e7b5136daf286e1f5e (patch) | |
tree | a4bf88d07522aee184b67dcfdb3f57eeffab86cf /drivers/rtc | |
parent | 04940631b8d2b2e57a13b6d4ca50dfe5994b514f (diff) |
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: 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>
Diffstat (limited to 'drivers/rtc')
-rw-r--r-- | drivers/rtc/rtc-pcf2123.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/rtc/rtc-pcf2123.c b/drivers/rtc/rtc-pcf2123.c index b4478cc92b55..8895f77726e8 100644 --- a/drivers/rtc/rtc-pcf2123.c +++ b/drivers/rtc/rtc-pcf2123.c | |||
@@ -182,7 +182,8 @@ static ssize_t pcf2123_show(struct device *dev, struct device_attribute *attr, | |||
182 | } | 182 | } |
183 | 183 | ||
184 | static ssize_t pcf2123_store(struct device *dev, struct device_attribute *attr, | 184 | static ssize_t pcf2123_store(struct device *dev, struct device_attribute *attr, |
185 | const char *buffer, size_t count) { | 185 | const char *buffer, size_t count) |
186 | { | ||
186 | struct pcf2123_sysfs_reg *r; | 187 | struct pcf2123_sysfs_reg *r; |
187 | unsigned long reg; | 188 | unsigned long reg; |
188 | unsigned long val; | 189 | unsigned long val; |
@@ -199,7 +200,7 @@ static ssize_t pcf2123_store(struct device *dev, struct device_attribute *attr, | |||
199 | if (ret) | 200 | if (ret) |
200 | return ret; | 201 | return ret; |
201 | 202 | ||
202 | pcf2123_write_reg(dev, reg, val); | 203 | ret = pcf2123_write_reg(dev, reg, val); |
203 | if (ret < 0) | 204 | if (ret < 0) |
204 | return -EIO; | 205 | return -EIO; |
205 | return count; | 206 | return count; |