diff options
author | Chanwoo Choi <cw00.choi@samsung.com> | 2014-05-29 21:13:15 -0400 |
---|---|---|
committer | Chanwoo Choi <cw00.choi@samsung.com> | 2014-06-16 00:33:19 -0400 |
commit | ac65a625a0961e7a96f2e5e182073691d0474c04 (patch) | |
tree | 5eb4f46f622366621a0d965569add88a830a6a97 | |
parent | 24a279b1cae0af0eb4bf0dd8b3ef85956a96ff7a (diff) |
extcon: Set parent device of extcon device using prameter of devm_extcon_dev_allocate
This patch set the parent device of extcon device using first parameter of
devm_extco_dev_allocate() to remove duplicate code on all of extcon provider
drivers.
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Reported-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Tested-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Cc: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Graeme Gregory <gg@slimlogic.co.uk>
Cc: Kishon Vijay Abraham I <kishon@ti.com>
Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>
-rw-r--r-- | drivers/extcon/extcon-adc-jack.c | 1 | ||||
-rw-r--r-- | drivers/extcon/extcon-arizona.c | 1 | ||||
-rw-r--r-- | drivers/extcon/extcon-class.c | 2 | ||||
-rw-r--r-- | drivers/extcon/extcon-gpio.c | 1 | ||||
-rw-r--r-- | drivers/extcon/extcon-max77693.c | 1 | ||||
-rw-r--r-- | drivers/extcon/extcon-max8997.c | 1 | ||||
-rw-r--r-- | drivers/extcon/extcon-palmas.c | 1 |
7 files changed, 2 insertions, 6 deletions
diff --git a/drivers/extcon/extcon-adc-jack.c b/drivers/extcon/extcon-adc-jack.c index e18f95be3733..d860229e4de1 100644 --- a/drivers/extcon/extcon-adc-jack.c +++ b/drivers/extcon/extcon-adc-jack.c | |||
@@ -112,7 +112,6 @@ static int adc_jack_probe(struct platform_device *pdev) | |||
112 | dev_err(&pdev->dev, "failed to allocate extcon device\n"); | 112 | dev_err(&pdev->dev, "failed to allocate extcon device\n"); |
113 | return -ENOMEM; | 113 | return -ENOMEM; |
114 | } | 114 | } |
115 | data->edev->dev.parent = &pdev->dev; | ||
116 | data->edev->name = pdata->name; | 115 | data->edev->name = pdata->name; |
117 | 116 | ||
118 | /* Check the length of array and set num_cables */ | 117 | /* Check the length of array and set num_cables */ |
diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c index c2eed30cfc3a..0b1ee9f55378 100644 --- a/drivers/extcon/extcon-arizona.c +++ b/drivers/extcon/extcon-arizona.c | |||
@@ -1170,7 +1170,6 @@ static int arizona_extcon_probe(struct platform_device *pdev) | |||
1170 | return -ENOMEM; | 1170 | return -ENOMEM; |
1171 | } | 1171 | } |
1172 | info->edev->name = "Headset Jack"; | 1172 | info->edev->name = "Headset Jack"; |
1173 | info->edev->dev.parent = arizona->dev; | ||
1174 | 1173 | ||
1175 | ret = devm_extcon_dev_register(&pdev->dev, info->edev); | 1174 | ret = devm_extcon_dev_register(&pdev->dev, info->edev); |
1176 | if (ret < 0) { | 1175 | if (ret < 0) { |
diff --git a/drivers/extcon/extcon-class.c b/drivers/extcon/extcon-class.c index 18d42c0e4581..4c2f2c543bb7 100644 --- a/drivers/extcon/extcon-class.c +++ b/drivers/extcon/extcon-class.c | |||
@@ -645,6 +645,8 @@ struct extcon_dev *devm_extcon_dev_allocate(struct device *dev, | |||
645 | return edev; | 645 | return edev; |
646 | } | 646 | } |
647 | 647 | ||
648 | edev->dev.parent = dev; | ||
649 | |||
648 | *ptr = edev; | 650 | *ptr = edev; |
649 | devres_add(dev, ptr); | 651 | devres_add(dev, ptr); |
650 | 652 | ||
diff --git a/drivers/extcon/extcon-gpio.c b/drivers/extcon/extcon-gpio.c index 645b28356819..5b7ec274cb63 100644 --- a/drivers/extcon/extcon-gpio.c +++ b/drivers/extcon/extcon-gpio.c | |||
@@ -105,7 +105,6 @@ static int gpio_extcon_probe(struct platform_device *pdev) | |||
105 | return -ENOMEM; | 105 | return -ENOMEM; |
106 | } | 106 | } |
107 | extcon_data->edev->name = pdata->name; | 107 | extcon_data->edev->name = pdata->name; |
108 | extcon_data->edev->dev.parent = &pdev->dev; | ||
109 | 108 | ||
110 | extcon_data->gpio = pdata->gpio; | 109 | extcon_data->gpio = pdata->gpio; |
111 | extcon_data->gpio_active_low = pdata->gpio_active_low; | 110 | extcon_data->gpio_active_low = pdata->gpio_active_low; |
diff --git a/drivers/extcon/extcon-max77693.c b/drivers/extcon/extcon-max77693.c index 2c7c3e191591..e9ec6ae8b0d8 100644 --- a/drivers/extcon/extcon-max77693.c +++ b/drivers/extcon/extcon-max77693.c | |||
@@ -1183,7 +1183,6 @@ static int max77693_muic_probe(struct platform_device *pdev) | |||
1183 | goto err_irq; | 1183 | goto err_irq; |
1184 | } | 1184 | } |
1185 | info->edev->name = DEV_NAME; | 1185 | info->edev->name = DEV_NAME; |
1186 | info->edev->dev.parent = &pdev->dev; | ||
1187 | 1186 | ||
1188 | ret = devm_extcon_dev_register(&pdev->dev, info->edev); | 1187 | ret = devm_extcon_dev_register(&pdev->dev, info->edev); |
1189 | if (ret) { | 1188 | if (ret) { |
diff --git a/drivers/extcon/extcon-max8997.c b/drivers/extcon/extcon-max8997.c index d9f7f1baaa03..d22c379766dd 100644 --- a/drivers/extcon/extcon-max8997.c +++ b/drivers/extcon/extcon-max8997.c | |||
@@ -706,7 +706,6 @@ static int max8997_muic_probe(struct platform_device *pdev) | |||
706 | goto err_irq; | 706 | goto err_irq; |
707 | } | 707 | } |
708 | info->edev->name = DEV_NAME; | 708 | info->edev->name = DEV_NAME; |
709 | info->edev->dev.parent = &pdev->dev; | ||
710 | 709 | ||
711 | ret = devm_extcon_dev_register(&pdev->dev, info->edev); | 710 | ret = devm_extcon_dev_register(&pdev->dev, info->edev); |
712 | if (ret) { | 711 | if (ret) { |
diff --git a/drivers/extcon/extcon-palmas.c b/drivers/extcon/extcon-palmas.c index 5efa96c00196..230e1220ce48 100644 --- a/drivers/extcon/extcon-palmas.c +++ b/drivers/extcon/extcon-palmas.c | |||
@@ -194,7 +194,6 @@ static int palmas_usb_probe(struct platform_device *pdev) | |||
194 | return -ENOMEM; | 194 | return -ENOMEM; |
195 | } | 195 | } |
196 | palmas_usb->edev->name = kstrdup(node->name, GFP_KERNEL); | 196 | palmas_usb->edev->name = kstrdup(node->name, GFP_KERNEL); |
197 | palmas_usb->edev->dev.parent = palmas_usb->dev; | ||
198 | palmas_usb->edev->mutually_exclusive = mutually_exclusive; | 197 | palmas_usb->edev->mutually_exclusive = mutually_exclusive; |
199 | 198 | ||
200 | status = devm_extcon_dev_register(&pdev->dev, palmas_usb->edev); | 199 | status = devm_extcon_dev_register(&pdev->dev, palmas_usb->edev); |