diff options
author | Chanwoo Choi <cw00.choi@samsung.com> | 2014-05-30 10:13:15 +0900 |
---|---|---|
committer | Marcel Ziswiler <marcel.ziswiler@toradex.com> | 2015-09-18 13:38:23 +0200 |
commit | 388cd149fef4b33eeb599846f0b47ad1035b1a1d (patch) | |
tree | cca0feda1351a730f37885fa8fbf3f6593458832 | |
parent | 4573e94d26d8bf0e21a2f5345f50f5b49fdf54b7 (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>
(cherry picked from commit ac65a625a0961e7a96f2e5e182073691d0474c04)
-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 e23f1c2e5053..4cbcb627785a 100644 --- a/drivers/extcon/extcon-adc-jack.c +++ b/drivers/extcon/extcon-adc-jack.c @@ -110,7 +110,6 @@ static int adc_jack_probe(struct platform_device *pdev) goto out; } - data->edev.dev.parent = &pdev->dev; data->edev.supported_cable = pdata->cable_names; /* Check the length of array and set num_cables */ diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c index 98a14f6143a7..9a55ee134ec6 100644 --- a/drivers/extcon/extcon-arizona.c +++ b/drivers/extcon/extcon-arizona.c @@ -1152,7 +1152,6 @@ static int arizona_extcon_probe(struct platform_device *pdev) } info->edev.name = "Headset Jack"; - info->edev.dev.parent = arizona->dev; info->edev.supported_cable = arizona_cable; ret = extcon_dev_register(&info->edev); 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, return edev; } + edev->dev.parent = dev; + *ptr = edev; devres_add(dev, ptr); diff --git a/drivers/extcon/extcon-gpio.c b/drivers/extcon/extcon-gpio.c index a63a6b21c9ad..79357447f002 100644 --- a/drivers/extcon/extcon-gpio.c +++ b/drivers/extcon/extcon-gpio.c @@ -99,7 +99,6 @@ static int gpio_extcon_probe(struct platform_device *pdev) return -ENOMEM; extcon_data->edev.name = pdata->name; - extcon_data->edev.dev.parent = &pdev->dev; extcon_data->gpio = pdata->gpio; extcon_data->gpio_active_low = pdata->gpio_active_low; extcon_data->state_on = pdata->state_on; diff --git a/drivers/extcon/extcon-max77693.c b/drivers/extcon/extcon-max77693.c index 4657a91acf56..8868abef86d8 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) goto err_irq; } info->edev->name = DEV_NAME; - info->edev->dev.parent = &pdev->dev; info->edev->supported_cable = max77693_extcon_cable; ret = extcon_dev_register(info->edev); if (ret) { diff --git a/drivers/extcon/extcon-max8997.c b/drivers/extcon/extcon-max8997.c index 5e1b88cecb76..cd4f0fd57915 100644 --- a/drivers/extcon/extcon-max8997.c +++ b/drivers/extcon/extcon-max8997.c @@ -707,7 +707,6 @@ static int max8997_muic_probe(struct platform_device *pdev) goto err_irq; } info->edev->name = DEV_NAME; - info->edev->dev.parent = &pdev->dev; info->edev->supported_cable = max8997_extcon_cable; ret = extcon_dev_register(info->edev); if (ret) { diff --git a/drivers/extcon/extcon-palmas.c b/drivers/extcon/extcon-palmas.c index 2aea4bcdd7f3..664e6fbf212b 100644 --- a/drivers/extcon/extcon-palmas.c +++ b/drivers/extcon/extcon-palmas.c @@ -187,7 +187,6 @@ static int palmas_usb_probe(struct platform_device *pdev) platform_set_drvdata(pdev, palmas_usb); palmas_usb->edev.supported_cable = palmas_extcon_cable; - palmas_usb->edev.dev.parent = palmas_usb->dev; palmas_usb->edev.mutually_exclusive = mutually_exclusive; status = extcon_dev_register(&palmas_usb->edev); |