diff mbox series

rtc: ab-eoz9: disable wakeup in the error path

Message ID 20241126021153.3713330-1-joe@pf.is.s.u-tokyo.ac.jp
State Superseded
Headers show
Series rtc: ab-eoz9: disable wakeup in the error path | expand

Commit Message

Joe Hattori Nov. 26, 2024, 2:11 a.m. UTC
In the error path of abeoz9_probe(), the device is left enabled as a
wakeup device when it has "wakeup-source" property. Thus call
device_init_wakeup(dev, false) in the error path.

Fixes: e70e52e1bf1d ("rtc: ab-eoz9: add alarm support")
Signed-off-by: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
---
 drivers/rtc/rtc-ab-eoz9.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/rtc/rtc-ab-eoz9.c b/drivers/rtc/rtc-ab-eoz9.c
index 02f7d0711287..ef61c5d5549c 100644
--- a/drivers/rtc/rtc-ab-eoz9.c
+++ b/drivers/rtc/rtc-ab-eoz9.c
@@ -559,8 +559,11 @@  static int abeoz9_probe(struct i2c_client *client)
 	}
 
 	ret = devm_rtc_register_device(data->rtc);
-	if (ret)
+	if (ret) {
+		if (test_bit(RTC_FEATURE_ALARM, data->rtc->features))
+			device_init_wakeup(dev, false);
 		return ret;
+	}
 
 	abeoz9_hwmon_register(dev, data);
 	return 0;