mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
extcon: Simplify extcon_dev_register() prototype by removing unnecessary parameter
This patch remove extcon_dev_register()'s second parameter which means the pointer of parent device to simplify prototype of this function. So, if extcon device has the parent device, it should set the pointer of parent device to edev.dev.parent in extcon device driver instead of in extcon_dev_register(). Cc: Graeme Gregory <[email protected]> Cc: Kishon Vijay Abraham I <[email protected]> Cc: Charles Keepax <[email protected]> Cc: Mark Brown <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]> Signed-off-by: Myungjoo Ham <[email protected]>
This commit is contained in:
parent
dae6165124
commit
42d7d7539a
9 changed files with 25 additions and 15 deletions
|
|
@ -110,6 +110,7 @@ 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 */
|
||||
|
|
@ -148,7 +149,7 @@ static int adc_jack_probe(struct platform_device *pdev)
|
|||
|
||||
platform_set_drvdata(pdev, data);
|
||||
|
||||
err = extcon_dev_register(&data->edev, &pdev->dev);
|
||||
err = extcon_dev_register(&data->edev);
|
||||
if (err)
|
||||
goto out;
|
||||
|
||||
|
|
|
|||
|
|
@ -1130,9 +1130,10 @@ 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, arizona->dev);
|
||||
ret = extcon_dev_register(&info->edev);
|
||||
if (ret < 0) {
|
||||
dev_err(arizona->dev, "extcon_dev_register() failed: %d\n",
|
||||
ret);
|
||||
|
|
|
|||
|
|
@ -566,14 +566,13 @@ static void dummy_sysfs_dev_release(struct device *dev)
|
|||
/**
|
||||
* extcon_dev_register() - Register a new extcon device
|
||||
* @edev : the new extcon device (should be allocated before calling)
|
||||
* @dev : the parent device for this extcon device.
|
||||
*
|
||||
* Among the members of edev struct, please set the "user initializing data"
|
||||
* in any case and set the "optional callbacks" if required. However, please
|
||||
* do not set the values of "internal data", which are initialized by
|
||||
* this function.
|
||||
*/
|
||||
int extcon_dev_register(struct extcon_dev *edev, struct device *dev)
|
||||
int extcon_dev_register(struct extcon_dev *edev)
|
||||
{
|
||||
int ret, index = 0;
|
||||
|
||||
|
|
@ -597,11 +596,15 @@ int extcon_dev_register(struct extcon_dev *edev, struct device *dev)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
edev->dev.parent = dev;
|
||||
edev->dev.class = extcon_class;
|
||||
edev->dev.release = extcon_dev_release;
|
||||
|
||||
edev->name = edev->name ? edev->name : dev_name(dev);
|
||||
edev->name = edev->name ? edev->name : dev_name(edev->dev.parent);
|
||||
if (IS_ERR_OR_NULL(edev->name)) {
|
||||
dev_err(&edev->dev,
|
||||
"extcon device name is null\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
dev_set_name(&edev->dev, "%s", edev->name);
|
||||
|
||||
if (edev->max_supported) {
|
||||
|
|
|
|||
|
|
@ -98,6 +98,7 @@ 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;
|
||||
|
|
@ -112,7 +113,7 @@ static int gpio_extcon_probe(struct platform_device *pdev)
|
|||
msecs_to_jiffies(pdata->debounce);
|
||||
}
|
||||
|
||||
ret = extcon_dev_register(&extcon_data->edev, &pdev->dev);
|
||||
ret = extcon_dev_register(&extcon_data->edev);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
|
|
|
|||
|
|
@ -1171,8 +1171,9 @@ 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, NULL);
|
||||
ret = extcon_dev_register(info->edev);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "failed to register extcon device\n");
|
||||
goto err_irq;
|
||||
|
|
|
|||
|
|
@ -705,8 +705,9 @@ 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, NULL);
|
||||
ret = extcon_dev_register(info->edev);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "failed to register extcon device\n");
|
||||
goto err_irq;
|
||||
|
|
|
|||
|
|
@ -178,9 +178,10 @@ 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, palmas_usb->dev);
|
||||
status = extcon_dev_register(&palmas_usb->edev);
|
||||
if (status) {
|
||||
dev_err(&pdev->dev, "failed to register extcon device\n");
|
||||
return status;
|
||||
|
|
|
|||
Loading…
Reference in a new issue