Commit d0b00d3f authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Merge tag 'extcon-linus-for-3.13-rc2' of...

Merge tag 'extcon-linus-for-3.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon into char-misc-linus

Chanwoo writes:

Update extcon for 3.13-rc2

This patchset fix NULL pointer error of extcon-arizona driver and fix issue
about memory of device groups when calling extcon_dev_unregister function.
parents 3441cded 7585ca0d
...@@ -1082,7 +1082,7 @@ static void arizona_micd_set_level(struct arizona *arizona, int index, ...@@ -1082,7 +1082,7 @@ static void arizona_micd_set_level(struct arizona *arizona, int index,
static int arizona_extcon_probe(struct platform_device *pdev) static int arizona_extcon_probe(struct platform_device *pdev)
{ {
struct arizona *arizona = dev_get_drvdata(pdev->dev.parent); struct arizona *arizona = dev_get_drvdata(pdev->dev.parent);
struct arizona_pdata *pdata; struct arizona_pdata *pdata = &arizona->pdata;
struct arizona_extcon_info *info; struct arizona_extcon_info *info;
unsigned int val; unsigned int val;
int jack_irq_fall, jack_irq_rise; int jack_irq_fall, jack_irq_rise;
...@@ -1091,8 +1091,6 @@ static int arizona_extcon_probe(struct platform_device *pdev) ...@@ -1091,8 +1091,6 @@ static int arizona_extcon_probe(struct platform_device *pdev)
if (!arizona->dapm || !arizona->dapm->card) if (!arizona->dapm || !arizona->dapm->card)
return -EPROBE_DEFER; return -EPROBE_DEFER;
pdata = dev_get_platdata(arizona->dev);
info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL); info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL);
if (!info) { if (!info) {
dev_err(&pdev->dev, "Failed to allocate memory\n"); dev_err(&pdev->dev, "Failed to allocate memory\n");
......
...@@ -792,6 +792,8 @@ void extcon_dev_unregister(struct extcon_dev *edev) ...@@ -792,6 +792,8 @@ void extcon_dev_unregister(struct extcon_dev *edev)
return; return;
} }
device_unregister(&edev->dev);
if (edev->mutually_exclusive && edev->max_supported) { if (edev->mutually_exclusive && edev->max_supported) {
for (index = 0; edev->mutually_exclusive[index]; for (index = 0; edev->mutually_exclusive[index];
index++) index++)
...@@ -812,7 +814,6 @@ void extcon_dev_unregister(struct extcon_dev *edev) ...@@ -812,7 +814,6 @@ void extcon_dev_unregister(struct extcon_dev *edev)
if (switch_class) if (switch_class)
class_compat_remove_link(switch_class, &edev->dev, NULL); class_compat_remove_link(switch_class, &edev->dev, NULL);
#endif #endif
device_unregister(&edev->dev);
put_device(&edev->dev); put_device(&edev->dev);
} }
EXPORT_SYMBOL_GPL(extcon_dev_unregister); EXPORT_SYMBOL_GPL(extcon_dev_unregister);
......
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