mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
drivers/rtc/rtc-rv3029c2.c: fix potential race condition
RTC drivers must not return an error after device registration. Signed-off-by: Gregory Hermant <[email protected]> Acked-by: Alessandro Zummo <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
617b26a0e1
commit
67ab2440b4
1 changed files with 6 additions and 6 deletions
|
|
@ -395,6 +395,12 @@ static int rv3029c2_probe(struct i2c_client *client,
|
|||
if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_EMUL))
|
||||
return -ENODEV;
|
||||
|
||||
rc = rv3029c2_i2c_get_sr(client, buf);
|
||||
if (rc < 0) {
|
||||
dev_err(&client->dev, "reading status failed\n");
|
||||
return rc;
|
||||
}
|
||||
|
||||
rtc = devm_rtc_device_register(&client->dev, client->name,
|
||||
&rv3029c2_rtc_ops, THIS_MODULE);
|
||||
|
||||
|
|
@ -403,12 +409,6 @@ static int rv3029c2_probe(struct i2c_client *client,
|
|||
|
||||
i2c_set_clientdata(client, rtc);
|
||||
|
||||
rc = rv3029c2_i2c_get_sr(client, buf);
|
||||
if (rc < 0) {
|
||||
dev_err(&client->dev, "reading status failed\n");
|
||||
return rc;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue