Skip to contentSkip to conversation

media: cros-ec-cec: do not bail on device_init_wakeup failure

PATCH Superseded Dariusz Marcinkiewicz 1 participant 1 message Jun 16, 2020

Subsystems (3)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: cros-ec-cec: do not bail on device_init_wakeup failure

Do not fail probing when device_init_wakeup fails.

device_init_wakeup fails when the device is already enabled as wakeup device. Hence, the driver fails to probe the device if:
- The device has already been enabled for wakeup (via e.g. sysfs)
- The driver has been unloaded and is being loaded again.

This goal of the patch is to fix the above cases.

Overwhelming majority of the drivers do not check device_init_wakeup return value.

---
 drivers/media/cec/platform/cros-ec/cros-ec-cec.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/media/cec/platform/cros-ec/cros-ec-cec.c +1 -5
index 0e7e2772f08f..2d95e16cd248 100644
@@ -277,11 +277,7 @@ static int cros_ec_cec_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, cros_ec_cec);
 	cros_ec_cec->cros_ec = cros_ec;
 
-	ret = device_init_wakeup(&pdev->dev, 1);
-	if (ret) {
-		dev_err(&pdev->dev, "failed to initialize wakeup\n");
-		return ret;
-	}
+	device_init_wakeup(&pdev->dev, 1);
 
 	cros_ec_cec->adap = cec_allocate_adapter(&cros_ec_cec_ops, cros_ec_cec,
 						 DRV_NAME,
Signature · 1 line
2.27.0.290.gba653c62da-goog