Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ac65a625 authored by Chanwoo Choi's avatar Chanwoo Choi
Browse files

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: default avatarChanwoo Choi <cw00.choi@samsung.com>
Reported-by: default avatarCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Tested-by: default avatarCharles 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>
parent 24a279b1
Loading
Loading
Loading
Loading
+0 −1
Original line number Original line Diff line number Diff line
@@ -112,7 +112,6 @@ static int adc_jack_probe(struct platform_device *pdev)
		dev_err(&pdev->dev, "failed to allocate extcon device\n");
		dev_err(&pdev->dev, "failed to allocate extcon device\n");
		return -ENOMEM;
		return -ENOMEM;
	}
	}
	data->edev->dev.parent = &pdev->dev;
	data->edev->name = pdata->name;
	data->edev->name = pdata->name;


	/* Check the length of array and set num_cables */
	/* Check the length of array and set num_cables */
+0 −1
Original line number Original line Diff line number Diff line
@@ -1170,7 +1170,6 @@ static int arizona_extcon_probe(struct platform_device *pdev)
		return -ENOMEM;
		return -ENOMEM;
	}
	}
	info->edev->name = "Headset Jack";
	info->edev->name = "Headset Jack";
	info->edev->dev.parent = arizona->dev;


	ret = devm_extcon_dev_register(&pdev->dev, info->edev);
	ret = devm_extcon_dev_register(&pdev->dev, info->edev);
	if (ret < 0) {
	if (ret < 0) {
+2 −0
Original line number Original line Diff line number Diff line
@@ -645,6 +645,8 @@ struct extcon_dev *devm_extcon_dev_allocate(struct device *dev,
		return edev;
		return edev;
	}
	}


	edev->dev.parent = dev;

	*ptr = edev;
	*ptr = edev;
	devres_add(dev, ptr);
	devres_add(dev, ptr);


+0 −1
Original line number Original line Diff line number Diff line
@@ -105,7 +105,6 @@ static int gpio_extcon_probe(struct platform_device *pdev)
		return -ENOMEM;
		return -ENOMEM;
	}
	}
	extcon_data->edev->name = pdata->name;
	extcon_data->edev->name = pdata->name;
	extcon_data->edev->dev.parent = &pdev->dev;


	extcon_data->gpio = pdata->gpio;
	extcon_data->gpio = pdata->gpio;
	extcon_data->gpio_active_low = pdata->gpio_active_low;
	extcon_data->gpio_active_low = pdata->gpio_active_low;
+0 −1
Original line number Original line Diff line number Diff line
@@ -1183,7 +1183,6 @@ static int max77693_muic_probe(struct platform_device *pdev)
		goto err_irq;
		goto err_irq;
	}
	}
	info->edev->name = DEV_NAME;
	info->edev->name = DEV_NAME;
	info->edev->dev.parent = &pdev->dev;


	ret = devm_extcon_dev_register(&pdev->dev, info->edev);
	ret = devm_extcon_dev_register(&pdev->dev, info->edev);
	if (ret) {
	if (ret) {
Loading