Skip to contentSkip to conversation

rtc: hid-sensor-time: remove some dead code

PATCH Applied Dan Carpenter 2 participants 2 messages Apr 12, 2017 – Apr 25, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rtc: hid-sensor-time: remove some dead code

devm_rtc_device_register() doesn't ever return NULL so there is no need to check.

drivers/rtc/rtc-hid-sensor-time.c +2 -2
index c398f74234c6..2751dba850c6 100644
@@ -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;
#1 lore raw
Quoted 5 lines · Dan Carpenter

devm_rtc_device_register() doesn't ever return NULL so there is no need to check.

Applied, thanks.

Signature · 3 lines
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com