提交 ce1ae8eb 编写于 作者: A Alexandre Belloni

rtc: rv8803: fix possible race condition

The probe function is not allowed to fail after registering the RTC. Call
rtc_register_device() at the end.
Signed-off-by: NAlexandre Belloni <alexandre.belloni@bootlin.com>
上级 c07fd9de
......@@ -590,14 +590,6 @@ static int rv8803_probe(struct i2c_client *client,
}
}
rv8803->rtc->ops = &rv8803_rtc_ops;
rv8803->rtc->nvram_old_abi = true;
err = rtc_register_device(rv8803->rtc);
if (err)
return err;
rtc_nvmem_register(rv8803->rtc, &nvmem_cfg);
err = rv8803_write_reg(rv8803->client, RV8803_EXT, RV8803_EXT_WADA);
if (err)
return err;
......@@ -608,6 +600,14 @@ static int rv8803_probe(struct i2c_client *client,
return err;
}
rv8803->rtc->ops = &rv8803_rtc_ops;
rv8803->rtc->nvram_old_abi = true;
err = rtc_register_device(rv8803->rtc);
if (err)
return err;
rtc_nvmem_register(rv8803->rtc, &nvmem_cfg);
rv8803->rtc->max_user_freq = 1;
return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册