From c12e5182ad14cfc18a2cb25056a1e834de39ed67 Mon Sep 17 00:00:00 2001 From: Yonghua Yan Date: Thu, 26 Oct 2023 12:00:30 +0800 Subject: [PATCH] Fix compile issue on Kernel version 6.1.25 Fix compile issue on Kernel version 6.1.25 to use new remove function protype of i2c device driver. Change-Id: I9ba5254fd65da48be78a0bbd7362fcf2c92f2250 Signed-off-by: Yonghua Yan Reviewed-on: https://gerrit.mot.com/2777335 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Reviewed-by: Guobin Zhang Tested-by: Jira Key Submit-Approved: Jira Key --- drivers/power/sc760x_charger_mmi/sc760x_charger_mmi.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/power/sc760x_charger_mmi/sc760x_charger_mmi.c b/drivers/power/sc760x_charger_mmi/sc760x_charger_mmi.c index 0e0196f43d28..c3b6da56e971 100644 --- a/drivers/power/sc760x_charger_mmi/sc760x_charger_mmi.c +++ b/drivers/power/sc760x_charger_mmi/sc760x_charger_mmi.c @@ -56,6 +56,7 @@ #include #include #include +#include #include "sc760x_charger_mmi.h" @@ -902,6 +903,7 @@ static int sc760x_charger_get_property(struct power_supply *psy, case POWER_SUPPLY_PROP_ONLINE: val->intval = sc760x_is_enabled_charging(sc); + break; case POWER_SUPPLY_PROP_PRESENT: val->intval = sc->sc760x_enable; @@ -2067,8 +2069,11 @@ err_get_match: return ret; } - +#if (KERNEL_VERSION(6, 1, 25) > LINUX_VERSION_CODE) static int sc760x_charger_remove(struct i2c_client *client) +#else +static void sc760x_charger_remove(struct i2c_client *client) +#endif { struct sc760x_chip *sc = i2c_get_clientdata(client); sc760x_remove_device_node(&(client->dev)); @@ -2082,7 +2087,10 @@ static int sc760x_charger_remove(struct i2c_client *client) power_supply_unregister(sc->charger_psy); mutex_destroy(&sc->lock); + +#if (KERNEL_VERSION(6, 1, 25) > LINUX_VERSION_CODE) return 0; +#endif } #ifdef CONFIG_PM_SLEEP