Skip to contentSkip to conversation

sdhci: acpi: Use new method to get ACPI companion

PATCH Applied Andy Shevchenko 3 participants 3 messages Jul 24, 2017 – Jul 27, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sdhci: acpi: Use new method to get ACPI companion

ACPI_COMPANION() macro reduces a code to get a companion device out of struct device.

Use it instead of an old method.

---
 drivers/mmc/host/sdhci-acpi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mmc/host/sdhci-acpi.c +2 -2
index ac678e9fb19a..4bbce8919c30 100644
@@ -432,7 +432,6 @@ static const struct sdhci_acpi_slot *sdhci_acpi_get_slot(const char *hid,
 static int sdhci_acpi_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
-	acpi_handle handle = ACPI_HANDLE(dev);
 	struct acpi_device *device, *child;
 	struct sdhci_acpi_host *c;
 	struct sdhci_host *host;
@@ -442,7 +441,8 @@ static int sdhci_acpi_probe(struct platform_device *pdev)
 	const char *uid;
 	int err;
 
-	if (acpi_bus_get_device(handle, &device))
+	device = ACPI_COMPANION(dev);
+	if (!device)
 		return -ENODEV;
 
 	hid = acpi_device_hid(device);
Signature · 1 line
2.13.2
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Andy Shevchenko

ACPI_COMPANION() macro reduces a code to get a companion device out of struct device.

Use it instead of an old method.

Quoted 27 lines
---
 drivers/mmc/host/sdhci-acpi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mmc/host/sdhci-acpi.c +2 -2
index ac678e9fb19a..4bbce8919c30 100644
@@ -432,7 +432,6 @@ static const struct sdhci_acpi_slot *sdhci_acpi_get_slot(const char *hid,
 static int sdhci_acpi_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
-	acpi_handle handle = ACPI_HANDLE(dev);
 	struct acpi_device *device, *child;
 	struct sdhci_acpi_host *c;
 	struct sdhci_host *host;
@@ -442,7 +441,8 @@ static int sdhci_acpi_probe(struct platform_device *pdev)
 	const char *uid;
 	int err;
 
-	if (acpi_bus_get_device(handle, &device))
+	device = ACPI_COMPANION(dev);
+	if (!device)
 		return -ENODEV;
 
 	hid = acpi_device_hid(device);
Applied
#2 lore raw
In reply to Andy Shevchenko
Quoted 6 lines · Andy Shevchenko

ACPI_COMPANION() macro reduces a code to get a companion device out of struct device.

Use it instead of an old method.

Thanks, applied for next!

Kind regards
Uffe

Quoted 29 lines
---
 drivers/mmc/host/sdhci-acpi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mmc/host/sdhci-acpi.c +2 -3
index ac678e9fb19a..4bbce8919c30 100644
@@ -432,7 +432,6 @@ static const struct sdhci_acpi_slot *sdhci_acpi_get_slot(const char *hid,
 static int sdhci_acpi_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
-       acpi_handle handle = ACPI_HANDLE(dev);
        struct acpi_device *device, *child;
        struct sdhci_acpi_host *c;
        struct sdhci_host *host;
@@ -442,7 +441,8 @@ static int sdhci_acpi_probe(struct platform_device *pdev)
        const char *uid;
        int err;
 
-       if (acpi_bus_get_device(handle, &device))
+       device = ACPI_COMPANION(dev);
+       if (!device)
                return -ENODEV;
 
        hid = acpi_device_hid(device);
--

2.13.2