linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb:mux:intel_pmc_mux: Use the helper acpi_dev_get_memory_resources()
@ 2022-08-31  6:11 zhaoxiao
  2022-08-31  8:21 ` Heikki Krogerus
  0 siblings, 1 reply; 5+ messages in thread
From: zhaoxiao @ 2022-08-31  6:11 UTC (permalink / raw)
  To: heikki.krogerus; +Cc: gregkh, linux-usb, linux-kernel, zhaoxiao

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


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

* Re: [PATCH] usb:mux:intel_pmc_mux: Use the helper acpi_dev_get_memory_resources()
  2022-08-31  6:11 [PATCH] usb:mux:intel_pmc_mux: Use the helper acpi_dev_get_memory_resources() zhaoxiao
@ 2022-08-31  8:21 ` Heikki Krogerus
  2022-08-31  8:33   ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: Heikki Krogerus @ 2022-08-31  8:21 UTC (permalink / raw)
  To: zhaoxiao; +Cc: gregkh, linux-usb, linux-kernel

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

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

* Re: [PATCH] usb:mux:intel_pmc_mux: Use the helper acpi_dev_get_memory_resources()
  2022-08-31  8:21 ` Heikki Krogerus
@ 2022-08-31  8:33   ` Greg KH
       [not found]     ` <tencent_4E7B2E1523A5D8801223AAB6@qq.com>
  0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2022-08-31  8:33 UTC (permalink / raw)
  To: Heikki Krogerus, zhaoxiao, linux-usb, linux-kernel

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

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

* Re: [PATCH] usb:mux:intel_pmc_mux: Use the helper acpi_dev_get_memory_resources()
       [not found]     ` <tencent_4E7B2E1523A5D8801223AAB6@qq.com>
@ 2022-09-01 11:19       ` Heikki Krogerus
  2022-09-01 11:31         ` Heikki Krogerus
  0 siblings, 1 reply; 5+ messages in thread
From: Heikki Krogerus @ 2022-09-01 11:19 UTC (permalink / raw)
  To: 赵晓; +Cc: Greg KH, linux-usb, linux-kernel

On Thu, Sep 01, 2022 at 11:39:17AM +0800, 赵晓 wrote:
> No generated by yet another bot, The patch refer to the below:&nbsp;
> https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git/commit/?h=linux-next&amp;id=6505e452371d44be00fe321996f1de248a7606a2

I don't know what are you trying to point at with that, but I'm
guessing you are trying to refer to this patch series [1] that Rafael
indeed picked to his PM tree - mostly. The first patch was taken by
Greg, though now that I look at his linux-usb tree, it's not there?

In any case, your patch will create a conflict with that first patch
in that series. There is a proper solution in that very same series,
but it can only be applied after the first patch becomes available.

[1] https://lore.kernel.org/linux-usb/20220816101629.69054-1-heikki.krogerus@linux.intel.com/

thanks,

-- 
heikki

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

* Re: [PATCH] usb:mux:intel_pmc_mux: Use the helper acpi_dev_get_memory_resources()
  2022-09-01 11:19       ` Heikki Krogerus
@ 2022-09-01 11:31         ` Heikki Krogerus
  0 siblings, 0 replies; 5+ messages in thread
From: Heikki Krogerus @ 2022-09-01 11:31 UTC (permalink / raw)
  To: 赵晓; +Cc: Greg KH, linux-usb, linux-kernel

On Thu, Sep 01, 2022 at 02:19:24PM +0300, Heikki Krogerus wrote:
> On Thu, Sep 01, 2022 at 11:39:17AM +0800, 赵晓 wrote:
> > No generated by yet another bot, The patch refer to the below:&nbsp;
> > https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git/commit/?h=linux-next&amp;id=6505e452371d44be00fe321996f1de248a7606a2
> 
> I don't know what are you trying to point at with that, but I'm
> guessing you are trying to refer to this patch series [1] that Rafael
> indeed picked to his PM tree - mostly. The first patch was taken by
> Greg, though now that I look at his linux-usb tree, it's not there?

No, sorry, the path is there (it was just not in 6.0-rc3 like I
though):
https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git/commit/?h=usb-linus&id=1b1b672cc1d4fb3065dac79efb8901bd6244ef69

So your patch would have a conflict with that one. This is the proper
solution:
https://lore.kernel.org/linux-usb/20220816101629.69054-7-heikki.krogerus@linux.intel.com/

thanks,

-- 
heikki

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

end of thread, other threads:[~2022-09-01 11:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-31  6:11 [PATCH] usb:mux:intel_pmc_mux: Use the helper acpi_dev_get_memory_resources() zhaoxiao
2022-08-31  8:21 ` Heikki Krogerus
2022-08-31  8:33   ` Greg KH
     [not found]     ` <tencent_4E7B2E1523A5D8801223AAB6@qq.com>
2022-09-01 11:19       ` Heikki Krogerus
2022-09-01 11:31         ` Heikki Krogerus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).