aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKishon Vijay Abraham I <kishon@ti.com>2014-03-28 02:51:02 -0400
committerChanwoo Choi <cw00.choi@samsung.com>2014-04-22 02:41:10 -0400
commitf63d32d4080407176082ef2cc439a3c81b15af16 (patch)
tree9cd02f8155452c6cf1e6bf927310690694001761
parenta798c10faf62a505d24e5f6213fbaf904a39623f (diff)
extcon: palmas: explicitly set edev name as node name
commit ca488 (extcon: of: Remove unnecessary function call by using the name of device_node) started using node name instead of device name to get the extcon device. This breaks dwc3-omap since it's not able to get the extcon device anymore. Fixed it by setting edev name of palmas to be the same as its node name. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Reported-by: Felipe Balbi <balbi@ti.com> Reviewed-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
-rw-r--r--drivers/extcon/extcon-palmas.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/extcon/extcon-palmas.c b/drivers/extcon/extcon-palmas.c
index ddff2b72f0a8..51db5bcef720 100644
--- a/drivers/extcon/extcon-palmas.c
+++ b/drivers/extcon/extcon-palmas.c
@@ -23,6 +23,7 @@
23#include <linux/module.h> 23#include <linux/module.h>
24#include <linux/interrupt.h> 24#include <linux/interrupt.h>
25#include <linux/platform_device.h> 25#include <linux/platform_device.h>
26#include <linux/slab.h>
26#include <linux/err.h> 27#include <linux/err.h>
27#include <linux/mfd/palmas.h> 28#include <linux/mfd/palmas.h>
28#include <linux/of.h> 29#include <linux/of.h>
@@ -188,11 +189,13 @@ static int palmas_usb_probe(struct platform_device *pdev)
188 189
189 palmas_usb->edev.supported_cable = palmas_extcon_cable; 190 palmas_usb->edev.supported_cable = palmas_extcon_cable;
190 palmas_usb->edev.dev.parent = palmas_usb->dev; 191 palmas_usb->edev.dev.parent = palmas_usb->dev;
192 palmas_usb->edev.name = kstrdup(node->name, GFP_KERNEL);
191 palmas_usb->edev.mutually_exclusive = mutually_exclusive; 193 palmas_usb->edev.mutually_exclusive = mutually_exclusive;
192 194
193 status = extcon_dev_register(&palmas_usb->edev); 195 status = extcon_dev_register(&palmas_usb->edev);
194 if (status) { 196 if (status) {
195 dev_err(&pdev->dev, "failed to register extcon device\n"); 197 dev_err(&pdev->dev, "failed to register extcon device\n");
198 kfree(palmas_usb->edev.name);
196 return status; 199 return status;
197 } 200 }
198 201
@@ -230,6 +233,7 @@ static int palmas_usb_probe(struct platform_device *pdev)
230 233
231fail_extcon: 234fail_extcon:
232 extcon_dev_unregister(&palmas_usb->edev); 235 extcon_dev_unregister(&palmas_usb->edev);
236 kfree(palmas_usb->edev.name);
233 237
234 return status; 238 return status;
235} 239}
@@ -239,6 +243,7 @@ static int palmas_usb_remove(struct platform_device *pdev)
239 struct palmas_usb *palmas_usb = platform_get_drvdata(pdev); 243 struct palmas_usb *palmas_usb = platform_get_drvdata(pdev);
240 244
241 extcon_dev_unregister(&palmas_usb->edev); 245 extcon_dev_unregister(&palmas_usb->edev);
246 kfree(palmas_usb->edev.name);
242 247
243 return 0; 248 return 0;
244} 249}