aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCharles Keepax <ckeepax@opensource.wolfsonmicro.com>2013-09-28 10:34:57 -0400
committerChanwoo Choi <cw00.choi@samsung.com>2013-11-26 00:30:10 -0500
commit6ac6b475c56ce4bbaf36b02db7d1372f2e17aeec (patch)
tree8fa413596153bc9116d3a94fa6e3d646d9df47fc
parent6ce4eac1f600b34f2f7f58f9cd8f0503d79e42ae (diff)
extcon: arizona: Get pdata from arizona structure not device
In the case of a device tree system there will be no pdata attached to the device, causing us to deference a NULL pointer. Better to take the pdata from the Arizona structure as this will always exist and we know will have been populated since it is populated by the MFD device which binds in the extcon driver. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
-rw-r--r--drivers/extcon/extcon-arizona.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c
index 3c55ec856e39..a287cece0593 100644
--- a/drivers/extcon/extcon-arizona.c
+++ b/drivers/extcon/extcon-arizona.c
@@ -1082,7 +1082,7 @@ static void arizona_micd_set_level(struct arizona *arizona, int index,
1082static int arizona_extcon_probe(struct platform_device *pdev) 1082static int arizona_extcon_probe(struct platform_device *pdev)
1083{ 1083{
1084 struct arizona *arizona = dev_get_drvdata(pdev->dev.parent); 1084 struct arizona *arizona = dev_get_drvdata(pdev->dev.parent);
1085 struct arizona_pdata *pdata; 1085 struct arizona_pdata *pdata = &arizona->pdata;
1086 struct arizona_extcon_info *info; 1086 struct arizona_extcon_info *info;
1087 unsigned int val; 1087 unsigned int val;
1088 int jack_irq_fall, jack_irq_rise; 1088 int jack_irq_fall, jack_irq_rise;
@@ -1091,8 +1091,6 @@ static int arizona_extcon_probe(struct platform_device *pdev)
1091 if (!arizona->dapm || !arizona->dapm->card) 1091 if (!arizona->dapm || !arizona->dapm->card)
1092 return -EPROBE_DEFER; 1092 return -EPROBE_DEFER;
1093 1093
1094 pdata = dev_get_platdata(arizona->dev);
1095
1096 info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL); 1094 info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL);
1097 if (!info) { 1095 if (!info) {
1098 dev_err(&pdev->dev, "Failed to allocate memory\n"); 1096 dev_err(&pdev->dev, "Failed to allocate memory\n");