diff options
author | Paul Cercueil <paul@crapouillou.net> | 2023-01-29 12:04:41 +0000 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2023-02-09 23:38:00 +0100 |
commit | ff6fd3770e9687d7b849a0e826a32563bfcb98da (patch) | |
tree | 4e39a3a69e3d050c7b2f6afd46a8c057250d9d1d | |
parent | d644b133f78d6d8efd36f7b1703bebca09036f0b (diff) | |
download | linux-ff6fd3770e9687d7b849a0e826a32563bfcb98da.tar.gz linux-ff6fd3770e9687d7b849a0e826a32563bfcb98da.tar.bz2 linux-ff6fd3770e9687d7b849a0e826a32563bfcb98da.zip |
rtc: jz4740: Use dev_err_probe()
Use dev_err_probe() where it makes sense to simplify a bit the code.
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20230129120442.22858-4-paul@crapouillou.net
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-rw-r--r-- | drivers/rtc/rtc-jz4740.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/drivers/rtc/rtc-jz4740.c b/drivers/rtc/rtc-jz4740.c index 4ee6e5ee09b1..9ffa764aa71e 100644 --- a/drivers/rtc/rtc-jz4740.c +++ b/drivers/rtc/rtc-jz4740.c @@ -329,17 +329,13 @@ static int jz4740_rtc_probe(struct platform_device *pdev) device_init_wakeup(dev, 1); ret = dev_pm_set_wake_irq(dev, irq); - if (ret) { - dev_err(dev, "Failed to set wake irq: %d\n", ret); - return ret; - } + if (ret) + return dev_err_probe(dev, ret, "Failed to set wake irq\n"); rtc->rtc = devm_rtc_allocate_device(dev); - if (IS_ERR(rtc->rtc)) { - ret = PTR_ERR(rtc->rtc); - dev_err(dev, "Failed to allocate rtc device: %d\n", ret); - return ret; - } + if (IS_ERR(rtc->rtc)) + return dev_err_probe(dev, PTR_ERR(rtc->rtc), + "Failed to allocate rtc device\n"); rtc->rtc->ops = &jz4740_rtc_ops; rtc->rtc->range_max = U32_MAX; @@ -356,10 +352,8 @@ static int jz4740_rtc_probe(struct platform_device *pdev) ret = devm_request_irq(dev, irq, jz4740_rtc_irq, 0, pdev->name, rtc); - if (ret) { - dev_err(dev, "Failed to request rtc irq: %d\n", ret); - return ret; - } + if (ret) + return dev_err_probe(dev, ret, "Failed to request rtc irq\n"); if (of_device_is_system_power_controller(np)) { dev_for_power_off = dev; |