sdhci: acpi: Use new method to get ACPI companion
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.
Signed-off-by Andy Shevchenko <[email protected]>
--- drivers/mmc/host/sdhci-acpi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mmc/host/sdhci-acpi.c +2 -2
@@ -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
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.
Signed-off-by Andy Shevchenko <[email protected]>
Acked-by Adrian Hunter <[email protected]>
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@@ -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);
Ulf Hansson
AppliedQuoted 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.
Signed-off-by Andy Shevchenko <[email protected]>
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@@ -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