Bluetooth: btbcm: Read the local name in setup stage
[firefly-linux-kernel-4.4.55.git] / drivers / bluetooth / hci_bcm.c
index 1a538ad6bf2b6de2b795ac5ef7911bb894ee2ffa..512873262055fd38d2bd19c5e2015712ccbe5dbe 100644 (file)
@@ -647,16 +647,10 @@ static int bcm_resource(struct acpi_resource *ares, void *data)
 static int bcm_acpi_probe(struct bcm_device *dev)
 {
        struct platform_device *pdev = dev->pdev;
-       const struct acpi_device_id *id;
-       struct acpi_device *adev;
        LIST_HEAD(resources);
        const struct dmi_system_id *dmi_id;
        int ret;
 
-       id = acpi_match_device(pdev->dev.driver->acpi_match_table, &pdev->dev);
-       if (!id)
-               return -ENODEV;
-
        /* Retrieve GPIO data */
        dev->name = dev_name(&pdev->dev);
        ret = acpi_dev_add_driver_gpios(ACPI_COMPANION(&pdev->dev),
@@ -701,11 +695,10 @@ static int bcm_acpi_probe(struct bcm_device *dev)
        }
 
        /* Retrieve UART ACPI info */
-       adev = ACPI_COMPANION(&dev->pdev->dev);
-       if (!adev)
-               return 0;
-
-       acpi_dev_get_resources(adev, &resources, bcm_resource, dev);
+       ret = acpi_dev_get_resources(ACPI_COMPANION(&dev->pdev->dev),
+                                    &resources, bcm_resource, dev);
+       if (ret < 0)
+               return ret;
        acpi_dev_free_resource_list(&resources);
 
        dmi_id = dmi_first_match(bcm_wrong_irq_dmi_table);
@@ -727,7 +720,6 @@ static int bcm_acpi_probe(struct bcm_device *dev)
 static int bcm_probe(struct platform_device *pdev)
 {
        struct bcm_device *dev;
-       struct acpi_device_id *pdata = pdev->dev.platform_data;
        int ret;
 
        dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL);
@@ -736,15 +728,9 @@ static int bcm_probe(struct platform_device *pdev)
 
        dev->pdev = pdev;
 
-       if (ACPI_HANDLE(&pdev->dev)) {
-               ret = bcm_acpi_probe(dev);
-               if (ret)
-                       return ret;
-       } else if (pdata) {
-               dev->name = pdata->id;
-       } else {
-               return -ENODEV;
-       }
+       ret = bcm_acpi_probe(dev);
+       if (ret)
+               return ret;
 
        platform_set_drvdata(pdev, dev);