Commit e350f804 authored by Chanwoo Choi's avatar Chanwoo Choi

extcon: palmas: Fix NULL pointer error

This patch fixes NULL pointer error by removing the unneeded kfree() call
of edev->name because extcon-palmas no longer allocate the memory for edev->name.

Fixes: d71aadda ("extcon: Remove the optional name of extcon device")
Signed-off-by: default avatarChanwoo Choi <cw00.choi@samsung.com>
Reviewed-by: default avatarKrzysztof Kozlowski <k.kozlowski@samsung.com>
parent cbfe8fa6
...@@ -200,7 +200,6 @@ static int palmas_usb_probe(struct platform_device *pdev) ...@@ -200,7 +200,6 @@ static int palmas_usb_probe(struct platform_device *pdev)
status = devm_extcon_dev_register(&pdev->dev, palmas_usb->edev); status = devm_extcon_dev_register(&pdev->dev, palmas_usb->edev);
if (status) { if (status) {
dev_err(&pdev->dev, "failed to register extcon device\n"); dev_err(&pdev->dev, "failed to register extcon device\n");
kfree(palmas_usb->edev->name);
return status; return status;
} }
...@@ -214,7 +213,6 @@ static int palmas_usb_probe(struct platform_device *pdev) ...@@ -214,7 +213,6 @@ static int palmas_usb_probe(struct platform_device *pdev)
if (status < 0) { if (status < 0) {
dev_err(&pdev->dev, "can't get IRQ %d, err %d\n", dev_err(&pdev->dev, "can't get IRQ %d, err %d\n",
palmas_usb->id_irq, status); palmas_usb->id_irq, status);
kfree(palmas_usb->edev->name);
return status; return status;
} }
} }
...@@ -229,7 +227,6 @@ static int palmas_usb_probe(struct platform_device *pdev) ...@@ -229,7 +227,6 @@ static int palmas_usb_probe(struct platform_device *pdev)
if (status < 0) { if (status < 0) {
dev_err(&pdev->dev, "can't get IRQ %d, err %d\n", dev_err(&pdev->dev, "can't get IRQ %d, err %d\n",
palmas_usb->vbus_irq, status); palmas_usb->vbus_irq, status);
kfree(palmas_usb->edev->name);
return status; return status;
} }
} }
...@@ -239,15 +236,6 @@ static int palmas_usb_probe(struct platform_device *pdev) ...@@ -239,15 +236,6 @@ static int palmas_usb_probe(struct platform_device *pdev)
return 0; return 0;
} }
static int palmas_usb_remove(struct platform_device *pdev)
{
struct palmas_usb *palmas_usb = platform_get_drvdata(pdev);
kfree(palmas_usb->edev->name);
return 0;
}
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_SLEEP
static int palmas_usb_suspend(struct device *dev) static int palmas_usb_suspend(struct device *dev)
{ {
...@@ -288,7 +276,6 @@ static const struct of_device_id of_palmas_match_tbl[] = { ...@@ -288,7 +276,6 @@ static const struct of_device_id of_palmas_match_tbl[] = {
static struct platform_driver palmas_usb_driver = { static struct platform_driver palmas_usb_driver = {
.probe = palmas_usb_probe, .probe = palmas_usb_probe,
.remove = palmas_usb_remove,
.driver = { .driver = {
.name = "palmas-usb", .name = "palmas-usb",
.of_match_table = of_palmas_match_tbl, .of_match_table = of_palmas_match_tbl,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment