All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/1] usb: acpi: Switch to use acpi_evaluate_dsm_typed()
@ 2023-01-18  8:04 Andy Shevchenko
  2023-01-19 13:11 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 5+ messages in thread
From: Andy Shevchenko @ 2023-01-18  8:04 UTC (permalink / raw)
  To: Mathias Nyman, linux-usb, linux-kernel
  Cc: Greg Kroah-Hartman, Andy Shevchenko

The acpi_evaluate_dsm_typed() provides a way to check the type of the
object evaluated by _DSM call. Use it instead of open coded variant.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/usb/core/usb-acpi.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/usb/core/usb-acpi.c b/drivers/usb/core/usb-acpi.c
index 533baa85083c..a34b22537d7c 100644
--- a/drivers/usb/core/usb-acpi.c
+++ b/drivers/usb/core/usb-acpi.c
@@ -81,15 +81,11 @@ int usb_acpi_port_lpm_incapable(struct usb_device *hdev, int index)
 		return -ENODEV;
 	}
 
-	obj = acpi_evaluate_dsm(port_handle, &guid, 0,
-				USB_DSM_DISABLE_U1_U2_FOR_PORT, NULL);
-
-	if (!obj)
-		return -ENODEV;
-
-	if (obj->type != ACPI_TYPE_INTEGER) {
+	obj = acpi_evaluate_dsm_typed(port_handle, &guid, 0,
+				      USB_DSM_DISABLE_U1_U2_FOR_PORT, NULL,
+				      ACPI_TYPE_INTEGER);
+	if (!obj) {
 		dev_dbg(&hdev->dev, "evaluate port-%d _DSM failed\n", port1);
-		ACPI_FREE(obj);
 		return -EINVAL;
 	}
 
-- 
2.39.0


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

* Re: [PATCH v1 1/1] usb: acpi: Switch to use acpi_evaluate_dsm_typed()
  2023-01-18  8:04 [PATCH v1 1/1] usb: acpi: Switch to use acpi_evaluate_dsm_typed() Andy Shevchenko
@ 2023-01-19 13:11 ` Greg Kroah-Hartman
  2023-01-19 14:37   ` Andy Shevchenko
  0 siblings, 1 reply; 5+ messages in thread
From: Greg Kroah-Hartman @ 2023-01-19 13:11 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: Mathias Nyman, linux-usb, linux-kernel

On Wed, Jan 18, 2023 at 10:04:19AM +0200, Andy Shevchenko wrote:
> The acpi_evaluate_dsm_typed() provides a way to check the type of the
> object evaluated by _DSM call. Use it instead of open coded variant.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/usb/core/usb-acpi.c | 12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/usb/core/usb-acpi.c b/drivers/usb/core/usb-acpi.c
> index 533baa85083c..a34b22537d7c 100644
> --- a/drivers/usb/core/usb-acpi.c
> +++ b/drivers/usb/core/usb-acpi.c
> @@ -81,15 +81,11 @@ int usb_acpi_port_lpm_incapable(struct usb_device *hdev, int index)
>  		return -ENODEV;
>  	}
>  
> -	obj = acpi_evaluate_dsm(port_handle, &guid, 0,
> -				USB_DSM_DISABLE_U1_U2_FOR_PORT, NULL);
> -
> -	if (!obj)
> -		return -ENODEV;
> -
> -	if (obj->type != ACPI_TYPE_INTEGER) {
> +	obj = acpi_evaluate_dsm_typed(port_handle, &guid, 0,
> +				      USB_DSM_DISABLE_U1_U2_FOR_PORT, NULL,
> +				      ACPI_TYPE_INTEGER);
> +	if (!obj) {
>  		dev_dbg(&hdev->dev, "evaluate port-%d _DSM failed\n", port1);
> -		ACPI_FREE(obj);
>  		return -EINVAL;
>  	}
>  
> -- 
> 2.39.0
> 

Fails to apply to my tree :(

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

* Re: [PATCH v1 1/1] usb: acpi: Switch to use acpi_evaluate_dsm_typed()
  2023-01-19 13:11 ` Greg Kroah-Hartman
@ 2023-01-19 14:37   ` Andy Shevchenko
  2023-01-19 15:14     ` Greg Kroah-Hartman
  0 siblings, 1 reply; 5+ messages in thread
From: Andy Shevchenko @ 2023-01-19 14:37 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Mathias Nyman, linux-usb, linux-kernel

On Thu, Jan 19, 2023 at 02:11:15PM +0100, Greg Kroah-Hartman wrote:
> On Wed, Jan 18, 2023 at 10:04:19AM +0200, Andy Shevchenko wrote:
> > The acpi_evaluate_dsm_typed() provides a way to check the type of the
> > object evaluated by _DSM call. Use it instead of open coded variant.

...

> Fails to apply to my tree :(

It seems it's against usb-linus as Mathias' original patch is there.

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH v1 1/1] usb: acpi: Switch to use acpi_evaluate_dsm_typed()
  2023-01-19 14:37   ` Andy Shevchenko
@ 2023-01-19 15:14     ` Greg Kroah-Hartman
  2023-01-19 15:17       ` Andy Shevchenko
  0 siblings, 1 reply; 5+ messages in thread
From: Greg Kroah-Hartman @ 2023-01-19 15:14 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: Mathias Nyman, linux-usb, linux-kernel

On Thu, Jan 19, 2023 at 04:37:12PM +0200, Andy Shevchenko wrote:
> On Thu, Jan 19, 2023 at 02:11:15PM +0100, Greg Kroah-Hartman wrote:
> > On Wed, Jan 18, 2023 at 10:04:19AM +0200, Andy Shevchenko wrote:
> > > The acpi_evaluate_dsm_typed() provides a way to check the type of the
> > > object evaluated by _DSM call. Use it instead of open coded variant.
> 
> ...
> 
> > Fails to apply to my tree :(
> 
> It seems it's against usb-linus as Mathias' original patch is there.

Ah, then that can wait until it merges into my usb-next branch.  Can you
resend it in a week or so when that happens?

thanks,

greg k-h

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

* Re: [PATCH v1 1/1] usb: acpi: Switch to use acpi_evaluate_dsm_typed()
  2023-01-19 15:14     ` Greg Kroah-Hartman
@ 2023-01-19 15:17       ` Andy Shevchenko
  0 siblings, 0 replies; 5+ messages in thread
From: Andy Shevchenko @ 2023-01-19 15:17 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Mathias Nyman, linux-usb, linux-kernel

On Thu, Jan 19, 2023 at 04:14:23PM +0100, Greg Kroah-Hartman wrote:
> On Thu, Jan 19, 2023 at 04:37:12PM +0200, Andy Shevchenko wrote:
> > On Thu, Jan 19, 2023 at 02:11:15PM +0100, Greg Kroah-Hartman wrote:
> > > On Wed, Jan 18, 2023 at 10:04:19AM +0200, Andy Shevchenko wrote:

...

> > > Fails to apply to my tree :(
> > 
> > It seems it's against usb-linus as Mathias' original patch is there.
> 
> Ah, then that can wait until it merges into my usb-next branch.  Can you
> resend it in a week or so when that happens?

Sure, thanks!

-- 
With Best Regards,
Andy Shevchenko



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

end of thread, other threads:[~2023-01-20  5:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-18  8:04 [PATCH v1 1/1] usb: acpi: Switch to use acpi_evaluate_dsm_typed() Andy Shevchenko
2023-01-19 13:11 ` Greg Kroah-Hartman
2023-01-19 14:37   ` Andy Shevchenko
2023-01-19 15:14     ` Greg Kroah-Hartman
2023-01-19 15:17       ` Andy Shevchenko

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.