aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-hid-sensor-time.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc/rtc-hid-sensor-time.c')
-rw-r--r--drivers/rtc/rtc-hid-sensor-time.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/rtc/rtc-hid-sensor-time.c b/drivers/rtc/rtc-hid-sensor-time.c
index b5a2874b15ef..4e2a81854f51 100644
--- a/drivers/rtc/rtc-hid-sensor-time.c
+++ b/drivers/rtc/rtc-hid-sensor-time.c
@@ -279,9 +279,11 @@ static int hid_time_probe(struct platform_device *pdev)
279 "hid-sensor-time", &hid_time_rtc_ops, 279 "hid-sensor-time", &hid_time_rtc_ops,
280 THIS_MODULE); 280 THIS_MODULE);
281 281
282 if (IS_ERR(time_state->rtc)) { 282 if (IS_ERR_OR_NULL(time_state->rtc)) {
283 ret = time_state->rtc ? PTR_ERR(time_state->rtc) : -ENODEV;
284 time_state->rtc = NULL;
285 sensor_hub_remove_callback(hsdev, HID_USAGE_SENSOR_TIME);
283 dev_err(&pdev->dev, "rtc device register failed!\n"); 286 dev_err(&pdev->dev, "rtc device register failed!\n");
284 return PTR_ERR(time_state->rtc);
285 } 287 }
286 288
287 return ret; 289 return ret;