]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
rtc: hid-sensor-time: remove some dead code
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 12 Apr 2017 08:32:53 +0000 (11:32 +0300)
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>
Sat, 22 Apr 2017 15:56:18 +0000 (17:56 +0200)
devm_rtc_device_register() doesn't ever return NULL so there is no need
to check.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
drivers/rtc/rtc-hid-sensor-time.c

index c398f74234c6914c3ebd4c3a80732f90e2d8b302..2751dba850c614f452d4f297e8bdbb461e9ae15d 100644 (file)
@@ -291,9 +291,9 @@ static int hid_time_probe(struct platform_device *pdev)
                                        "hid-sensor-time", &hid_time_rtc_ops,
                                        THIS_MODULE);
 
-       if (IS_ERR_OR_NULL(time_state->rtc)) {
+       if (IS_ERR(time_state->rtc)) {
                hid_device_io_stop(hsdev->hdev);
-               ret = time_state->rtc ? PTR_ERR(time_state->rtc) : -ENODEV;
+               ret = PTR_ERR(time_state->rtc);
                time_state->rtc = NULL;
                dev_err(&pdev->dev, "rtc device register failed!\n");
                goto err_rtc;