]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
rtc: pcf85063: replace dev_err+return with return dev_err_probe
authorMaud Spierings <maudspierings@gocontroll.com>
Tue, 4 Mar 2025 08:14:52 +0000 (09:14 +0100)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Tue, 1 Apr 2025 10:01:53 +0000 (12:01 +0200)
Replace the dev_err plus return combo with return dev_err_probe() this
actually communicates the error type when it occurs and helps debugging
hardware issues.

Signed-off-by: Maud Spierings <maudspierings@gocontroll.com>
Link: https://lore.kernel.org/r/20250304-rtc_dev_err_probe-v1-1-9dcc042ad17e@gocontroll.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-pcf85063.c

index 73848f764559b492bf60b72676d7c4c3f0aef6df..4fa5c4ecdd5a340e6048b0d7d1d9590cff41e8fb 100644 (file)
@@ -591,10 +591,8 @@ static int pcf85063_probe(struct i2c_client *client)
        i2c_set_clientdata(client, pcf85063);
 
        err = regmap_read(pcf85063->regmap, PCF85063_REG_SC, &tmp);
-       if (err) {
-               dev_err(&client->dev, "RTC chip is not present\n");
-               return err;
-       }
+       if (err)
+               return dev_err_probe(&client->dev, err, "RTC chip is not present\n");
 
        pcf85063->rtc = devm_rtc_allocate_device(&client->dev);
        if (IS_ERR(pcf85063->rtc))