All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2 V2] USB: Use ACPI device information
@ 2014-07-09 16:42 Tenoutit, Faouaz
  2014-07-19 23:31 ` Rafael J. Wysocki
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Tenoutit, Faouaz @ 2014-07-09 16:42 UTC (permalink / raw)
  To: linux-acpi

From: Faouaz TENOUTIT <faouaz.tenoutit@intel.com>

Use ACPI device pld information instead of calling
acpi_get_physical_device_location.

Signed-off-by: Faouaz TENOUTIT <faouaz.tenoutit@intel.com>
Acked-by: Samuel Ortiz <samuel.ortiz@intel.com>
---
 drivers/acpi/scan.c         | 13 +++++++++++++
 drivers/usb/core/usb-acpi.c | 14 +++++---------
 include/acpi/acpi_bus.h     |  1 +
 3 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index f775fa0..7ad6beb 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -764,6 +764,13 @@ static int acpi_device_setup_files(struct acpi_device *dev)
                             &dev_attr_real_power_state);
     }

+    /*
+     * If device has _PLD, initialize the 'pld' struct
+     */
+    if (acpi_has_method(dev->handle, "_PLD"))
+        acpi_get_physical_device_location(dev->handle,
+                    &dev->pld);
+
 end:
     return result;
 }
@@ -803,6 +810,12 @@ static void acpi_device_remove_files(struct acpi_device *dev)
         device_remove_file(&dev->dev, &dev_attr_status);
     if (dev->handle)
         device_remove_file(&dev->dev, &dev_attr_path);
+
+    /*
+     * If device has _PLD, free 'pld' struct
+     */
+    if (dev->pld)
+        ACPI_FREE(dev->pld);
 }
 /* --------------------------------------------------------------------------
             ACPI Bus operations
diff --git a/drivers/usb/core/usb-acpi.c b/drivers/usb/core/usb-acpi.c
index 2776cfe..a8cbb72 100644
--- a/drivers/usb/core/usb-acpi.c
+++ b/drivers/usb/core/usb-acpi.c
@@ -157,9 +157,6 @@ static struct acpi_device *usb_acpi_find_companion(struct device *dev)
     } else if (is_usb_port(dev)) {
         struct usb_port *port_dev = to_usb_port(dev);
         int port1 = port_dev->portnum;
-        struct acpi_pld_info *pld;
-        acpi_handle *handle;
-        acpi_status status;

         /* Get the struct usb_device point of port's hub */
         udev = to_usb_device(dev->parent->parent);
@@ -190,15 +187,14 @@ static struct acpi_device *usb_acpi_find_companion(struct device *dev)
             if (!adev)
                 return NULL;
         }
-        handle = adev->handle;
-        status = acpi_get_physical_device_location(handle, &pld);
-        if (ACPI_FAILURE(status) || !pld)
+        if (!adev->pld)
             return adev;

         port_dev->location = USB_ACPI_LOCATION_VALID
-            | pld->group_token << 8 | pld->group_position;
-        port_dev->connect_type = usb_acpi_get_connect_type(handle, pld);
-        ACPI_FREE(pld);
+            | adev->pld->group_token << 8
+            | adev->pld->group_position;
+        port_dev->connect_type = usb_acpi_get_connect_type(adev->handle,
+                adev->pld);

         return adev;
     }
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index b571458..1b05d07 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -350,6 +350,7 @@ struct acpi_device {
     struct acpi_scan_handler *handler;
     struct acpi_hotplug_context *hp;
     struct acpi_driver *driver;
+    struct acpi_pld_info *pld;
     void *driver_data;
     struct device dev;
     unsigned int physical_node_count;
--
2.0.0


---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris, 
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2 V2] USB: Use ACPI device information
  2014-07-09 16:42 [PATCH 1/2 V2] USB: Use ACPI device information Tenoutit, Faouaz
@ 2014-07-19 23:31 ` Rafael J. Wysocki
  2014-07-21  7:50   ` Tenoutit, Faouaz
  2014-07-31 22:37 ` Rafael J. Wysocki
  2014-08-06 20:30 ` Rafael J. Wysocki
  2 siblings, 1 reply; 8+ messages in thread
From: Rafael J. Wysocki @ 2014-07-19 23:31 UTC (permalink / raw)
  To: Tenoutit, Faouaz; +Cc: linux-acpi, Samuel Ortiz

On Wednesday, July 09, 2014 04:42:38 PM Tenoutit, Faouaz wrote:
> From: Faouaz TENOUTIT <faouaz.tenoutit@intel.com>
> 
> Use ACPI device pld information instead of calling
> acpi_get_physical_device_location.
> 
> Signed-off-by: Faouaz TENOUTIT <faouaz.tenoutit@intel.com>
> Acked-by: Samuel Ortiz <samuel.ortiz@intel.com>

This patch doesn't apply for me on top of 3.16-rc5.  Can you please rebase it?

> ---
>  drivers/acpi/scan.c         | 13 +++++++++++++
>  drivers/usb/core/usb-acpi.c | 14 +++++---------
>  include/acpi/acpi_bus.h     |  1 +
>  3 files changed, 19 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
> index f775fa0..7ad6beb 100644
> --- a/drivers/acpi/scan.c
> +++ b/drivers/acpi/scan.c
> @@ -764,6 +764,13 @@ static int acpi_device_setup_files(struct acpi_device *dev)
>                              &dev_attr_real_power_state);
>      }
> 
> +    /*
> +     * If device has _PLD, initialize the 'pld' struct
> +     */
> +    if (acpi_has_method(dev->handle, "_PLD"))
> +        acpi_get_physical_device_location(dev->handle,
> +                    &dev->pld);
> +
>  end:
>      return result;
>  }
> @@ -803,6 +810,12 @@ static void acpi_device_remove_files(struct acpi_device *dev)
>          device_remove_file(&dev->dev, &dev_attr_status);
>      if (dev->handle)
>          device_remove_file(&dev->dev, &dev_attr_path);
> +
> +    /*
> +     * If device has _PLD, free 'pld' struct
> +     */
> +    if (dev->pld)
> +        ACPI_FREE(dev->pld);
>  }
>  /* --------------------------------------------------------------------------
>              ACPI Bus operations
> diff --git a/drivers/usb/core/usb-acpi.c b/drivers/usb/core/usb-acpi.c
> index 2776cfe..a8cbb72 100644
> --- a/drivers/usb/core/usb-acpi.c
> +++ b/drivers/usb/core/usb-acpi.c
> @@ -157,9 +157,6 @@ static struct acpi_device *usb_acpi_find_companion(struct device *dev)
>      } else if (is_usb_port(dev)) {
>          struct usb_port *port_dev = to_usb_port(dev);
>          int port1 = port_dev->portnum;
> -        struct acpi_pld_info *pld;
> -        acpi_handle *handle;
> -        acpi_status status;
> 
>          /* Get the struct usb_device point of port's hub */
>          udev = to_usb_device(dev->parent->parent);
> @@ -190,15 +187,14 @@ static struct acpi_device *usb_acpi_find_companion(struct device *dev)
>              if (!adev)
>                  return NULL;
>          }
> -        handle = adev->handle;
> -        status = acpi_get_physical_device_location(handle, &pld);
> -        if (ACPI_FAILURE(status) || !pld)
> +        if (!adev->pld)
>              return adev;
> 
>          port_dev->location = USB_ACPI_LOCATION_VALID
> -            | pld->group_token << 8 | pld->group_position;
> -        port_dev->connect_type = usb_acpi_get_connect_type(handle, pld);
> -        ACPI_FREE(pld);
> +            | adev->pld->group_token << 8
> +            | adev->pld->group_position;
> +        port_dev->connect_type = usb_acpi_get_connect_type(adev->handle,
> +                adev->pld);
> 
>          return adev;
>      }
> diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
> index b571458..1b05d07 100644
> --- a/include/acpi/acpi_bus.h
> +++ b/include/acpi/acpi_bus.h
> @@ -350,6 +350,7 @@ struct acpi_device {
>      struct acpi_scan_handler *handler;
>      struct acpi_hotplug_context *hp;
>      struct acpi_driver *driver;
> +    struct acpi_pld_info *pld;
>      void *driver_data;
>      struct device dev;
>      unsigned int physical_node_count;
> --
> 2.0.0
> 
> 
> ---------------------------------------------------------------------
> Intel Corporation SAS (French simplified joint stock company)
> Registered headquarters: "Les Montalets"- 2, rue de Paris, 
> 92196 Meudon Cedex, France
> Registration Number:  302 456 199 R.C.S. NANTERRE
> Capital: 4,572,000 Euros
> 
> This e-mail and any attachments may contain confidential material for
> the sole use of the intended recipient(s). Any review or distribution
> by others is strictly prohibited. If you are not the intended
> recipient, please contact the sender and delete all copies.
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH 1/2 V2] USB: Use ACPI device information
  2014-07-19 23:31 ` Rafael J. Wysocki
@ 2014-07-21  7:50   ` Tenoutit, Faouaz
  0 siblings, 0 replies; 8+ messages in thread
From: Tenoutit, Faouaz @ 2014-07-21  7:50 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: linux-acpi, Ortiz, Samuel

________________________________________
From: Rafael J. Wysocki [rjw@rjwysocki.net]
Sent: Sunday, July 20, 2014 1:31 AM
To: Tenoutit, Faouaz
Cc: linux-acpi@vger.kernel.org; Ortiz, Samuel
Subject: Re: [PATCH 1/2 V2] USB: Use ACPI device information

On Wednesday, July 09, 2014 04:42:38 PM Tenoutit, Faouaz wrote:
> From: Faouaz TENOUTIT <faouaz.tenoutit@intel.com>
>
> Use ACPI device pld information instead of calling
> acpi_get_physical_device_location.
>
> Signed-off-by: Faouaz TENOUTIT <faouaz.tenoutit@intel.com>
> Acked-by: Samuel Ortiz <samuel.ortiz@intel.com>

> This patch doesn't apply for me on top of 3.16-rc5.  Can you please rebase it?

Sorry, I generated it from latest kernel source tree (It applies on top of 3.16-rc6)

> ---
>  drivers/acpi/scan.c         | 13 +++++++++++++
>  drivers/usb/core/usb-acpi.c | 14 +++++---------
>  include/acpi/acpi_bus.h     |  1 +
>  3 files changed, 19 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
> index f775fa0..7ad6beb 100644
> --- a/drivers/acpi/scan.c
> +++ b/drivers/acpi/scan.c
> @@ -764,6 +764,13 @@ static int acpi_device_setup_files(struct acpi_device *dev)
>                              &dev_attr_real_power_state);
>      }
>
> +    /*
> +     * If device has _PLD, initialize the 'pld' struct
> +     */
> +    if (acpi_has_method(dev->handle, "_PLD"))
> +        acpi_get_physical_device_location(dev->handle,
> +                    &dev->pld);
> +
>  end:
>      return result;
>  }
> @@ -803,6 +810,12 @@ static void acpi_device_remove_files(struct acpi_device *dev)
>          device_remove_file(&dev->dev, &dev_attr_status);
>      if (dev->handle)
>          device_remove_file(&dev->dev, &dev_attr_path);
> +
> +    /*
> +     * If device has _PLD, free 'pld' struct
> +     */
> +    if (dev->pld)
> +        ACPI_FREE(dev->pld);
>  }
>  /* --------------------------------------------------------------------------
>              ACPI Bus operations
> diff --git a/drivers/usb/core/usb-acpi.c b/drivers/usb/core/usb-acpi.c
> index 2776cfe..a8cbb72 100644
> --- a/drivers/usb/core/usb-acpi.c
> +++ b/drivers/usb/core/usb-acpi.c
> @@ -157,9 +157,6 @@ static struct acpi_device *usb_acpi_find_companion(struct device *dev)
>      } else if (is_usb_port(dev)) {
>          struct usb_port *port_dev = to_usb_port(dev);
>          int port1 = port_dev->portnum;
> -        struct acpi_pld_info *pld;
> -        acpi_handle *handle;
> -        acpi_status status;
>
>          /* Get the struct usb_device point of port's hub */
>          udev = to_usb_device(dev->parent->parent);
> @@ -190,15 +187,14 @@ static struct acpi_device *usb_acpi_find_companion(struct device *dev)
>              if (!adev)
>                  return NULL;
>          }
> -        handle = adev->handle;
> -        status = acpi_get_physical_device_location(handle, &pld);
> -        if (ACPI_FAILURE(status) || !pld)
> +        if (!adev->pld)
>              return adev;
>
>          port_dev->location = USB_ACPI_LOCATION_VALID
> -            | pld->group_token << 8 | pld->group_position;
> -        port_dev->connect_type = usb_acpi_get_connect_type(handle, pld);
> -        ACPI_FREE(pld);
> +            | adev->pld->group_token << 8
> +            | adev->pld->group_position;
> +        port_dev->connect_type = usb_acpi_get_connect_type(adev->handle,
> +                adev->pld);
>
>          return adev;
>      }
> diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
> index b571458..1b05d07 100644
> --- a/include/acpi/acpi_bus.h
> +++ b/include/acpi/acpi_bus.h
> @@ -350,6 +350,7 @@ struct acpi_device {
>      struct acpi_scan_handler *handler;
>      struct acpi_hotplug_context *hp;
>      struct acpi_driver *driver;
> +    struct acpi_pld_info *pld;
>      void *driver_data;
>      struct device dev;
>      unsigned int physical_node_count;
> --
> 2.0.0
>
>
> ---------------------------------------------------------------------
> Intel Corporation SAS (French simplified joint stock company)
> Registered headquarters: "Les Montalets"- 2, rue de Paris,
> 92196 Meudon Cedex, France
> Registration Number:  302 456 199 R.C.S. NANTERRE
> Capital: 4,572,000 Euros
>
> This e-mail and any attachments may contain confidential material for
> the sole use of the intended recipient(s). Any review or distribution
> by others is strictly prohibited. If you are not the intended
> recipient, please contact the sender and delete all copies.
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris, 
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2 V2] USB: Use ACPI device information
  2014-07-31 22:37 ` Rafael J. Wysocki
@ 2014-07-31 22:29   ` Greg Kroah-Hartman
  2014-08-01 14:22   ` Alan Stern
  1 sibling, 0 replies; 8+ messages in thread
From: Greg Kroah-Hartman @ 2014-07-31 22:29 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Alan Stern, Tenoutit, Faouaz, linux-acpi, Linux Kernel Mailing List

On Fri, Aug 01, 2014 at 12:37:49AM +0200, Rafael J. Wysocki wrote:
> On Wednesday, July 09, 2014 04:42:38 PM Tenoutit, Faouaz wrote:
> > From: Faouaz TENOUTIT <faouaz.tenoutit@intel.com>
> > 
> > Use ACPI device pld information instead of calling
> > acpi_get_physical_device_location.
> > 
> > Signed-off-by: Faouaz TENOUTIT <faouaz.tenoutit@intel.com>
> > Acked-by: Samuel Ortiz <samuel.ortiz@intel.com>
> 
> Greg, Alan, any objections agains this?

Deleting USB acpi code?  Never an objection from me :)

Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2 V2] USB: Use ACPI device information
  2014-07-09 16:42 [PATCH 1/2 V2] USB: Use ACPI device information Tenoutit, Faouaz
  2014-07-19 23:31 ` Rafael J. Wysocki
@ 2014-07-31 22:37 ` Rafael J. Wysocki
  2014-07-31 22:29   ` Greg Kroah-Hartman
  2014-08-01 14:22   ` Alan Stern
  2014-08-06 20:30 ` Rafael J. Wysocki
  2 siblings, 2 replies; 8+ messages in thread
From: Rafael J. Wysocki @ 2014-07-31 22:37 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Alan Stern
  Cc: Tenoutit, Faouaz, linux-acpi, Linux Kernel Mailing List

On Wednesday, July 09, 2014 04:42:38 PM Tenoutit, Faouaz wrote:
> From: Faouaz TENOUTIT <faouaz.tenoutit@intel.com>
> 
> Use ACPI device pld information instead of calling
> acpi_get_physical_device_location.
> 
> Signed-off-by: Faouaz TENOUTIT <faouaz.tenoutit@intel.com>
> Acked-by: Samuel Ortiz <samuel.ortiz@intel.com>

Greg, Alan, any objections agains this?

Rafael


> ---
>  drivers/acpi/scan.c         | 13 +++++++++++++
>  drivers/usb/core/usb-acpi.c | 14 +++++---------
>  include/acpi/acpi_bus.h     |  1 +
>  3 files changed, 19 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
> index f775fa0..7ad6beb 100644
> --- a/drivers/acpi/scan.c
> +++ b/drivers/acpi/scan.c
> @@ -764,6 +764,13 @@ static int acpi_device_setup_files(struct acpi_device *dev)
>                              &dev_attr_real_power_state);
>      }
> 
> +    /*
> +     * If device has _PLD, initialize the 'pld' struct
> +     */
> +    if (acpi_has_method(dev->handle, "_PLD"))
> +        acpi_get_physical_device_location(dev->handle,
> +                    &dev->pld);
> +
>  end:
>      return result;
>  }
> @@ -803,6 +810,12 @@ static void acpi_device_remove_files(struct acpi_device *dev)
>          device_remove_file(&dev->dev, &dev_attr_status);
>      if (dev->handle)
>          device_remove_file(&dev->dev, &dev_attr_path);
> +
> +    /*
> +     * If device has _PLD, free 'pld' struct
> +     */
> +    if (dev->pld)
> +        ACPI_FREE(dev->pld);
>  }
>  /* --------------------------------------------------------------------------
>              ACPI Bus operations
> diff --git a/drivers/usb/core/usb-acpi.c b/drivers/usb/core/usb-acpi.c
> index 2776cfe..a8cbb72 100644
> --- a/drivers/usb/core/usb-acpi.c
> +++ b/drivers/usb/core/usb-acpi.c
> @@ -157,9 +157,6 @@ static struct acpi_device *usb_acpi_find_companion(struct device *dev)
>      } else if (is_usb_port(dev)) {
>          struct usb_port *port_dev = to_usb_port(dev);
>          int port1 = port_dev->portnum;
> -        struct acpi_pld_info *pld;
> -        acpi_handle *handle;
> -        acpi_status status;
> 
>          /* Get the struct usb_device point of port's hub */
>          udev = to_usb_device(dev->parent->parent);
> @@ -190,15 +187,14 @@ static struct acpi_device *usb_acpi_find_companion(struct device *dev)
>              if (!adev)
>                  return NULL;
>          }
> -        handle = adev->handle;
> -        status = acpi_get_physical_device_location(handle, &pld);
> -        if (ACPI_FAILURE(status) || !pld)
> +        if (!adev->pld)
>              return adev;
> 
>          port_dev->location = USB_ACPI_LOCATION_VALID
> -            | pld->group_token << 8 | pld->group_position;
> -        port_dev->connect_type = usb_acpi_get_connect_type(handle, pld);
> -        ACPI_FREE(pld);
> +            | adev->pld->group_token << 8
> +            | adev->pld->group_position;
> +        port_dev->connect_type = usb_acpi_get_connect_type(adev->handle,
> +                adev->pld);
> 
>          return adev;
>      }
> diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
> index b571458..1b05d07 100644
> --- a/include/acpi/acpi_bus.h
> +++ b/include/acpi/acpi_bus.h
> @@ -350,6 +350,7 @@ struct acpi_device {
>      struct acpi_scan_handler *handler;
>      struct acpi_hotplug_context *hp;
>      struct acpi_driver *driver;
> +    struct acpi_pld_info *pld;
>      void *driver_data;
>      struct device dev;
>      unsigned int physical_node_count;
> --
> 2.0.0


-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2 V2] USB: Use ACPI device information
  2014-07-31 22:37 ` Rafael J. Wysocki
  2014-07-31 22:29   ` Greg Kroah-Hartman
@ 2014-08-01 14:22   ` Alan Stern
  1 sibling, 0 replies; 8+ messages in thread
From: Alan Stern @ 2014-08-01 14:22 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Greg Kroah-Hartman, Tenoutit, Faouaz, linux-acpi,
	Linux Kernel Mailing List

On Fri, 1 Aug 2014, Rafael J. Wysocki wrote:

> On Wednesday, July 09, 2014 04:42:38 PM Tenoutit, Faouaz wrote:
> > From: Faouaz TENOUTIT <faouaz.tenoutit@intel.com>
> > 
> > Use ACPI device pld information instead of calling
> > acpi_get_physical_device_location.
> > 
> > Signed-off-by: Faouaz TENOUTIT <faouaz.tenoutit@intel.com>
> > Acked-by: Samuel Ortiz <samuel.ortiz@intel.com>
> 
> Greg, Alan, any objections agains this?

No objection from me, aside from the fact that the posted patch was 
whitespace-damaged.

Acked-by: Alan Stern <stern@rowland.harvard.edu>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2 V2] USB: Use ACPI device information
  2014-07-09 16:42 [PATCH 1/2 V2] USB: Use ACPI device information Tenoutit, Faouaz
  2014-07-19 23:31 ` Rafael J. Wysocki
  2014-07-31 22:37 ` Rafael J. Wysocki
@ 2014-08-06 20:30 ` Rafael J. Wysocki
  2014-08-13 17:07   ` Samuel Ortiz
  2 siblings, 1 reply; 8+ messages in thread
From: Rafael J. Wysocki @ 2014-08-06 20:30 UTC (permalink / raw)
  To: Tenoutit, Faouaz; +Cc: linux-acpi, Samuel Ortiz

On Wednesday, July 09, 2014 04:42:38 PM Tenoutit, Faouaz wrote:
> From: Faouaz TENOUTIT <faouaz.tenoutit@intel.com>
> 
> Use ACPI device pld information instead of calling
> acpi_get_physical_device_location.
> 
> Signed-off-by: Faouaz TENOUTIT <faouaz.tenoutit@intel.com>
> Acked-by: Samuel Ortiz <samuel.ortiz@intel.com>

Can you please fix the whitespace in this patch?

Rafael


> ---
>  drivers/acpi/scan.c         | 13 +++++++++++++
>  drivers/usb/core/usb-acpi.c | 14 +++++---------
>  include/acpi/acpi_bus.h     |  1 +
>  3 files changed, 19 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
> index f775fa0..7ad6beb 100644
> --- a/drivers/acpi/scan.c
> +++ b/drivers/acpi/scan.c
> @@ -764,6 +764,13 @@ static int acpi_device_setup_files(struct acpi_device *dev)
>                              &dev_attr_real_power_state);
>      }
> 
> +    /*
> +     * If device has _PLD, initialize the 'pld' struct
> +     */
> +    if (acpi_has_method(dev->handle, "_PLD"))
> +        acpi_get_physical_device_location(dev->handle,
> +                    &dev->pld);
> +
>  end:
>      return result;
>  }
> @@ -803,6 +810,12 @@ static void acpi_device_remove_files(struct acpi_device *dev)
>          device_remove_file(&dev->dev, &dev_attr_status);
>      if (dev->handle)
>          device_remove_file(&dev->dev, &dev_attr_path);
> +
> +    /*
> +     * If device has _PLD, free 'pld' struct
> +     */
> +    if (dev->pld)
> +        ACPI_FREE(dev->pld);
>  }
>  /* --------------------------------------------------------------------------
>              ACPI Bus operations
> diff --git a/drivers/usb/core/usb-acpi.c b/drivers/usb/core/usb-acpi.c
> index 2776cfe..a8cbb72 100644
> --- a/drivers/usb/core/usb-acpi.c
> +++ b/drivers/usb/core/usb-acpi.c
> @@ -157,9 +157,6 @@ static struct acpi_device *usb_acpi_find_companion(struct device *dev)
>      } else if (is_usb_port(dev)) {
>          struct usb_port *port_dev = to_usb_port(dev);
>          int port1 = port_dev->portnum;
> -        struct acpi_pld_info *pld;
> -        acpi_handle *handle;
> -        acpi_status status;
> 
>          /* Get the struct usb_device point of port's hub */
>          udev = to_usb_device(dev->parent->parent);
> @@ -190,15 +187,14 @@ static struct acpi_device *usb_acpi_find_companion(struct device *dev)
>              if (!adev)
>                  return NULL;
>          }
> -        handle = adev->handle;
> -        status = acpi_get_physical_device_location(handle, &pld);
> -        if (ACPI_FAILURE(status) || !pld)
> +        if (!adev->pld)
>              return adev;
> 
>          port_dev->location = USB_ACPI_LOCATION_VALID
> -            | pld->group_token << 8 | pld->group_position;
> -        port_dev->connect_type = usb_acpi_get_connect_type(handle, pld);
> -        ACPI_FREE(pld);
> +            | adev->pld->group_token << 8
> +            | adev->pld->group_position;
> +        port_dev->connect_type = usb_acpi_get_connect_type(adev->handle,
> +                adev->pld);
> 
>          return adev;
>      }
> diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
> index b571458..1b05d07 100644
> --- a/include/acpi/acpi_bus.h
> +++ b/include/acpi/acpi_bus.h
> @@ -350,6 +350,7 @@ struct acpi_device {
>      struct acpi_scan_handler *handler;
>      struct acpi_hotplug_context *hp;
>      struct acpi_driver *driver;
> +    struct acpi_pld_info *pld;
>      void *driver_data;
>      struct device dev;
>      unsigned int physical_node_count;
> --
> 2.0.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2 V2] USB: Use ACPI device information
  2014-08-06 20:30 ` Rafael J. Wysocki
@ 2014-08-13 17:07   ` Samuel Ortiz
  0 siblings, 0 replies; 8+ messages in thread
From: Samuel Ortiz @ 2014-08-13 17:07 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: Tenoutit, Faouaz, linux-acpi

Hi Rafael,

On Wed, Aug 06, 2014 at 10:30:53PM +0200, Rafael J. Wysocki wrote:
> On Wednesday, July 09, 2014 04:42:38 PM Tenoutit, Faouaz wrote:
> > From: Faouaz TENOUTIT <faouaz.tenoutit@intel.com>
> > 
> > Use ACPI device pld information instead of calling
> > acpi_get_physical_device_location.
> > 
> > Signed-off-by: Faouaz TENOUTIT <faouaz.tenoutit@intel.com>
> > Acked-by: Samuel Ortiz <samuel.ortiz@intel.com>
> 
> Can you please fix the whitespace in this patch?
I just sent v3 but it still contains whitespace damage.
I'll sent v4 right away, sorry for the noise.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris, 
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-08-13 17:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-09 16:42 [PATCH 1/2 V2] USB: Use ACPI device information Tenoutit, Faouaz
2014-07-19 23:31 ` Rafael J. Wysocki
2014-07-21  7:50   ` Tenoutit, Faouaz
2014-07-31 22:37 ` Rafael J. Wysocki
2014-07-31 22:29   ` Greg Kroah-Hartman
2014-08-01 14:22   ` Alan Stern
2014-08-06 20:30 ` Rafael J. Wysocki
2014-08-13 17:07   ` Samuel Ortiz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.