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@xxxxxxxxxxxxxxxxxxxxx> --- drivers/rtc/rtc-ab-eoz9.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; -- 2.34.1