diff --git a/drivers/power/p938x_charger/p938x_charger.c b/drivers/power/p938x_charger/p938x_charger.c index cc93350e6a3f..f62b6c5fa8da 100644 --- a/drivers/power/p938x_charger/p938x_charger.c +++ b/drivers/power/p938x_charger/p938x_charger.c @@ -52,6 +52,7 @@ #include #include #include +#include #define CHIP_ID_REG 0x0000 #define HW_VER_REG 0x0002 @@ -2942,7 +2943,11 @@ static int p938x_charger_probe(struct i2c_client *client, mutex_init(&chip->disconnect_lock); mutex_init(&chip->txmode_lock); +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 110)) chip->wls_wake_source = wakeup_source_register(chip->dev, "p938x wireless charger"); +#else + chip->wls_wake_source = wakeup_source_register("p938x wireless charger"); +#endif if (!chip->wls_wake_source) { p938x_err(chip, "failed to allocate wakeup source\n"); diff --git a/drivers/power/qpnp-smbcharger-mmi/qpnp-smbcharger-mmi.c b/drivers/power/qpnp-smbcharger-mmi/qpnp-smbcharger-mmi.c index 8ccb9ea4a67f..fd4d0eaa6854 100644 --- a/drivers/power/qpnp-smbcharger-mmi/qpnp-smbcharger-mmi.c +++ b/drivers/power/qpnp-smbcharger-mmi/qpnp-smbcharger-mmi.c @@ -26,6 +26,7 @@ #include #include #include +#include #define MODULE_LOG "SMBMMI" @@ -4122,7 +4123,11 @@ static int smb_mmi_probe(struct platform_device *pdev) INIT_DELAYED_WORK(&chip->heartbeat_work, mmi_heartbeat_work); INIT_DELAYED_WORK(&chip->weakcharger_work, mmi_weakcharger_work); +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 110)) chip->smb_mmi_hb_wake_source = wakeup_source_register(chip->dev, "smb_mmi_hb_wake"); +#else + chip->smb_mmi_hb_wake_source = wakeup_source_register("smb_mmi_hb_wake"); +#endif if (!chip->smb_mmi_hb_wake_source) { mmi_err(chip, "failed to allocate wakeup source\n"); return -ENOMEM;