summaryrefslogtreecommitdiffstats
path: root/drivers/power/supply/charger-manager.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 17:35:05 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 17:39:31 +0000
commit85c675d0d09a45a135bddd15d7b385f8758c32fb (patch)
tree76267dbc9b9a130337be3640948fe397b04ac629 /drivers/power/supply/charger-manager.c
parentAdding upstream version 6.6.15. (diff)
downloadlinux-85c675d0d09a45a135bddd15d7b385f8758c32fb.tar.xz
linux-85c675d0d09a45a135bddd15d7b385f8758c32fb.zip
Adding upstream version 6.7.7.upstream/6.7.7
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'drivers/power/supply/charger-manager.c')
-rw-r--r--drivers/power/supply/charger-manager.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/power/supply/charger-manager.c b/drivers/power/supply/charger-manager.c
index 5fa6ba7f41..96f0a7fbf1 100644
--- a/drivers/power/supply/charger-manager.c
+++ b/drivers/power/supply/charger-manager.c
@@ -1516,9 +1516,11 @@ static int charger_manager_probe(struct platform_device *pdev)
memcpy(&cm->charger_psy_desc, &psy_default, sizeof(psy_default));
if (!desc->psy_name)
- strncpy(cm->psy_name_buf, psy_default.name, PSY_NAME_MAX);
+ strscpy(cm->psy_name_buf, psy_default.name,
+ sizeof(cm->psy_name_buf));
else
- strncpy(cm->psy_name_buf, desc->psy_name, PSY_NAME_MAX);
+ strscpy(cm->psy_name_buf, desc->psy_name,
+ sizeof(cm->psy_name_buf));
cm->charger_psy_desc.name = cm->psy_name_buf;
/* Allocate for psy properties because they may vary */
@@ -1628,7 +1630,7 @@ err_reg_extcon:
return ret;
}
-static int charger_manager_remove(struct platform_device *pdev)
+static void charger_manager_remove(struct platform_device *pdev)
{
struct charger_manager *cm = platform_get_drvdata(pdev);
struct charger_desc *desc = cm->desc;
@@ -1648,8 +1650,6 @@ static int charger_manager_remove(struct platform_device *pdev)
power_supply_unregister(cm->charger_psy);
try_charger_enable(cm, false);
-
- return 0;
}
static const struct platform_device_id charger_manager_id[] = {
@@ -1740,7 +1740,7 @@ static struct platform_driver charger_manager_driver = {
.of_match_table = charger_manager_match,
},
.probe = charger_manager_probe,
- .remove = charger_manager_remove,
+ .remove_new = charger_manager_remove,
.id_table = charger_manager_id,
};