[PATCH] usb:mux:intel_pmc_mux: Use the helper acpi_dev_get_memory_resources()

zhaoxiao posted 1 patch 3 years, 7 months ago
drivers/usb/typec/mux/intel_pmc_mux.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
[PATCH] usb:mux:intel_pmc_mux: Use the helper acpi_dev_get_memory_resources()
Posted by zhaoxiao 3 years, 7 months ago
It removes the need to check the resource data type separately.

Signed-off-by: zhaoxiao <zhaoxiao@uniontech.com>
---
 drivers/usb/typec/mux/intel_pmc_mux.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/drivers/usb/typec/mux/intel_pmc_mux.c b/drivers/usb/typec/mux/intel_pmc_mux.c
index 47b733f78fb0..6207c8f54240 100644
--- a/drivers/usb/typec/mux/intel_pmc_mux.c
+++ b/drivers/usb/typec/mux/intel_pmc_mux.c
@@ -569,13 +569,6 @@ static int pmc_usb_register_port(struct pmc_usb *pmc, int index,
 	return ret;
 }
 
-static int is_memory(struct acpi_resource *res, void *data)
-{
-	struct resource r;
-
-	return !acpi_dev_resource_memory(res, &r);
-}
-
 /* IOM ACPI IDs and IOM_PORT_STATUS_OFFSET */
 static const struct acpi_device_id iom_acpi_ids[] = {
 	/* TigerLake */
@@ -606,7 +599,7 @@ static int pmc_usb_probe_iom(struct pmc_usb *pmc)
 		return -ENODEV;
 
 	INIT_LIST_HEAD(&resource_list);
-	ret = acpi_dev_get_resources(adev, &resource_list, is_memory, NULL);
+	ret = acpi_dev_get_memory_resources(adev, &resource_list);
 	if (ret < 0)
 		return ret;
 
-- 
2.20.1
Re: [PATCH] usb:mux:intel_pmc_mux: Use the helper acpi_dev_get_memory_resources()
Posted by Heikki Krogerus 3 years, 7 months ago
On Wed, Aug 31, 2022 at 02:11:26PM +0800, zhaoxiao wrote:
> It removes the need to check the resource data type separately.
> 
> Signed-off-by: zhaoxiao <zhaoxiao@uniontech.com>

Was this patch generated by yet another bot?

If that's the case, then I would appreciated that you clearly state
that here somehow, just like the other projects.

thanks,

> ---
>  drivers/usb/typec/mux/intel_pmc_mux.c | 9 +--------
>  1 file changed, 1 insertion(+), 8 deletions(-)
> 
> diff --git a/drivers/usb/typec/mux/intel_pmc_mux.c b/drivers/usb/typec/mux/intel_pmc_mux.c
> index 47b733f78fb0..6207c8f54240 100644
> --- a/drivers/usb/typec/mux/intel_pmc_mux.c
> +++ b/drivers/usb/typec/mux/intel_pmc_mux.c
> @@ -569,13 +569,6 @@ static int pmc_usb_register_port(struct pmc_usb *pmc, int index,
>  	return ret;
>  }
>  
> -static int is_memory(struct acpi_resource *res, void *data)
> -{
> -	struct resource r;
> -
> -	return !acpi_dev_resource_memory(res, &r);
> -}
> -
>  /* IOM ACPI IDs and IOM_PORT_STATUS_OFFSET */
>  static const struct acpi_device_id iom_acpi_ids[] = {
>  	/* TigerLake */
> @@ -606,7 +599,7 @@ static int pmc_usb_probe_iom(struct pmc_usb *pmc)
>  		return -ENODEV;
>  
>  	INIT_LIST_HEAD(&resource_list);
> -	ret = acpi_dev_get_resources(adev, &resource_list, is_memory, NULL);
> +	ret = acpi_dev_get_memory_resources(adev, &resource_list);
>  	if (ret < 0)
>  		return ret;
>  
> -- 
> 2.20.1

-- 
heikki
Re: [PATCH] usb:mux:intel_pmc_mux: Use the helper acpi_dev_get_memory_resources()
Posted by Greg KH 3 years, 7 months ago
On Wed, Aug 31, 2022 at 11:21:59AM +0300, Heikki Krogerus wrote:
> On Wed, Aug 31, 2022 at 02:11:26PM +0800, zhaoxiao wrote:
> > It removes the need to check the resource data type separately.
> > 
> > Signed-off-by: zhaoxiao <zhaoxiao@uniontech.com>
> 
> Was this patch generated by yet another bot?
> 
> If that's the case, then I would appreciated that you clearly state
> that here somehow, just like the other projects.

Also if it was done by a bot, it has to follow the documented rules of
using them, otherwise we will just reject it.

thanks,

greg k-h