diff mbox

[v1] sdhci: acpi: Use new method to get ACPI companion

Message ID 20170724145958.34478-1-andriy.shevchenko@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Andy Shevchenko July 24, 2017, 2:59 p.m. UTC
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 <andriy.shevchenko@linux.intel.com>
---
 drivers/mmc/host/sdhci-acpi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Adrian Hunter July 25, 2017, 6:56 a.m. UTC | #1
On 24/07/17 17:59, Andy Shevchenko wrote:
> 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 <andriy.shevchenko@linux.intel.com>

Acked-by: Adrian Hunter <adrian.hunter@intel.com>

> ---
>  drivers/mmc/host/sdhci-acpi.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
> index ac678e9fb19a..4bbce8919c30 100644
> --- a/drivers/mmc/host/sdhci-acpi.c
> +++ b/drivers/mmc/host/sdhci-acpi.c
> @@ -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);
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ulf Hansson July 27, 2017, 2:49 p.m. UTC | #2
On 24 July 2017 at 16:59, Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
> 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 <andriy.shevchenko@linux.intel.com>

Thanks, applied for next!

Kind regards
Uffe

> ---
>  drivers/mmc/host/sdhci-acpi.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
> index ac678e9fb19a..4bbce8919c30 100644
> --- a/drivers/mmc/host/sdhci-acpi.c
> +++ b/drivers/mmc/host/sdhci-acpi.c
> @@ -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
>
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
index ac678e9fb19a..4bbce8919c30 100644
--- a/drivers/mmc/host/sdhci-acpi.c
+++ b/drivers/mmc/host/sdhci-acpi.c
@@ -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);