Bluetooth: hci_bcm: Switch to devm_acpi_dev_add_driver_gpios()
Switch to use managed variant of acpi_dev_add_driver_gpios() to simplify error path and fix potentially wrong assingment if ->probe() fails. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
This commit is contained in:
parent
b73f22695f
commit
fda7057f4b
@ -762,8 +762,7 @@ static int bcm_acpi_probe(struct bcm_device *dev)
|
|||||||
if (id)
|
if (id)
|
||||||
gpio_mapping = (const struct acpi_gpio_mapping *) id->driver_data;
|
gpio_mapping = (const struct acpi_gpio_mapping *) id->driver_data;
|
||||||
|
|
||||||
ret = acpi_dev_add_driver_gpios(ACPI_COMPANION(&pdev->dev),
|
ret = devm_acpi_dev_add_driver_gpios(&pdev->dev, gpio_mapping);
|
||||||
gpio_mapping);
|
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
@ -834,8 +833,6 @@ static int bcm_remove(struct platform_device *pdev)
|
|||||||
list_del(&dev->list);
|
list_del(&dev->list);
|
||||||
mutex_unlock(&bcm_device_lock);
|
mutex_unlock(&bcm_device_lock);
|
||||||
|
|
||||||
acpi_dev_remove_driver_gpios(ACPI_COMPANION(&pdev->dev));
|
|
||||||
|
|
||||||
dev_info(&pdev->dev, "%s device unregistered.\n", dev->name);
|
dev_info(&pdev->dev, "%s device unregistered.\n", dev->name);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user