diff options
author | Sachin Kamat <sachin.kamat@linaro.org> | 2013-07-03 18:07:48 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-07-03 19:07:59 -0400 |
commit | 11f54d05865c009a468e9d7adaa7414749daa6ca (patch) | |
tree | 0baf286b650d01aa09f6c53df02cde36a0846e6e /drivers/rtc/rtc-da9052.c | |
parent | ad87a766479d027f5966c781605bc9f7bf8bab67 (diff) |
drivers/rtc/rtc-da9052.c: use PTR_RET()
Use of PTR_RET() simplifies the code.
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: David Dajun Chen <dchen@diasemi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rtc/rtc-da9052.c')
-rw-r--r-- | drivers/rtc/rtc-da9052.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/rtc/rtc-da9052.c b/drivers/rtc/rtc-da9052.c index 2f7fdd77a6f0..9c8c19441cc6 100644 --- a/drivers/rtc/rtc-da9052.c +++ b/drivers/rtc/rtc-da9052.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/module.h> | 15 | #include <linux/module.h> |
16 | #include <linux/platform_device.h> | 16 | #include <linux/platform_device.h> |
17 | #include <linux/rtc.h> | 17 | #include <linux/rtc.h> |
18 | #include <linux/err.h> | ||
18 | 19 | ||
19 | #include <linux/mfd/da9052/da9052.h> | 20 | #include <linux/mfd/da9052/da9052.h> |
20 | #include <linux/mfd/da9052/reg.h> | 21 | #include <linux/mfd/da9052/reg.h> |
@@ -249,10 +250,7 @@ static int da9052_rtc_probe(struct platform_device *pdev) | |||
249 | 250 | ||
250 | rtc->rtc = devm_rtc_device_register(&pdev->dev, pdev->name, | 251 | rtc->rtc = devm_rtc_device_register(&pdev->dev, pdev->name, |
251 | &da9052_rtc_ops, THIS_MODULE); | 252 | &da9052_rtc_ops, THIS_MODULE); |
252 | if (IS_ERR(rtc->rtc)) | 253 | return PTR_RET(rtc->rtc); |
253 | return PTR_ERR(rtc->rtc); | ||
254 | |||
255 | return 0; | ||
256 | } | 254 | } |
257 | 255 | ||
258 | static struct platform_driver da9052_rtc_driver = { | 256 | static struct platform_driver da9052_rtc_driver = { |