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

Submitted by Dan Carpenter on April 12, 2017, 8:32 a.m.

Details

Message ID 20170412083253.GB3250@mwanda
State Accepted
Headers show

Commit Message

Dan Carpenter April 12, 2017, 8:32 a.m.
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>

Comments

Alexandre Belloni April 25, 2017, 10:50 a.m.
On 12/04/2017 at 11:32:53 +0300, Dan Carpenter wrote:
> 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>
> 
Applied, thanks.

Patch hide | download patch | download mbox

diff --git a/drivers/rtc/rtc-hid-sensor-time.c b/drivers/rtc/rtc-hid-sensor-time.c
index c398f74234c6..2751dba850c6 100644
--- a/drivers/rtc/rtc-hid-sensor-time.c
+++ b/drivers/rtc/rtc-hid-sensor-time.c
@@ -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;