2023-04-05 07:13:00

by Nobuhiro Iwamatsu

[permalink] [raw]
Subject: [PATCH] usb: host: xhci-plat: Use dev_is_pci() helper

Use common dev_is_pci() helper for checking PCI devices.

Signed-off-by: Nobuhiro Iwamatsu <[email protected]>
---
drivers/usb/host/xhci-plat.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
index b9f9625467d61e..2c95189424fa6e 100644
--- a/drivers/usb/host/xhci-plat.c
+++ b/drivers/usb/host/xhci-plat.c
@@ -363,7 +363,7 @@ static int xhci_generic_plat_probe(struct platform_device *pdev)
is_acpi_device_node(sysdev->fwnode))
break;
#ifdef CONFIG_PCI
- else if (sysdev->bus == &pci_bus_type)
+ else if (dev_is_pci(sysdev))
break;
#endif
}
--
2.36.1



2023-04-05 07:25:55

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH] usb: host: xhci-plat: Use dev_is_pci() helper

On Wed, Apr 05, 2023 at 04:01:41PM +0900, Nobuhiro Iwamatsu wrote:
> Use common dev_is_pci() helper for checking PCI devices.
>
> Signed-off-by: Nobuhiro Iwamatsu <[email protected]>
> ---
> drivers/usb/host/xhci-plat.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
> index b9f9625467d61e..2c95189424fa6e 100644
> --- a/drivers/usb/host/xhci-plat.c
> +++ b/drivers/usb/host/xhci-plat.c
> @@ -363,7 +363,7 @@ static int xhci_generic_plat_probe(struct platform_device *pdev)
> is_acpi_device_node(sysdev->fwnode))
> break;
> #ifdef CONFIG_PCI
> - else if (sysdev->bus == &pci_bus_type)
> + else if (dev_is_pci(sysdev))

With that change, you can also get rid of the #ifdef lines too, right?

thanks,

greg k-h

2023-04-05 22:10:39

by Nobuhiro Iwamatsu

[permalink] [raw]
Subject: RE: [PATCH] usb: host: xhci-plat: Use dev_is_pci() helper

Hi,

> -----Original Message-----
> From: Greg KH <[email protected]>
> Sent: Wednesday, April 5, 2023 4:22 PM
> To: iwamatsu nobuhiro($B4d>>(B $B?.MN(B $B!{#D#I#T#C""#D#I#T!{#O#S#T(B)
> <[email protected]>
> Cc: [email protected]; [email protected];
> [email protected]
> Subject: Re: [PATCH] usb: host: xhci-plat: Use dev_is_pci() helper
>
> On Wed, Apr 05, 2023 at 04:01:41PM +0900, Nobuhiro Iwamatsu wrote:
> > Use common dev_is_pci() helper for checking PCI devices.
> >
> > Signed-off-by: Nobuhiro Iwamatsu <[email protected]>
> > ---
> > drivers/usb/host/xhci-plat.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/usb/host/xhci-plat.c
> > b/drivers/usb/host/xhci-plat.c index b9f9625467d61e..2c95189424fa6e
> > 100644
> > --- a/drivers/usb/host/xhci-plat.c
> > +++ b/drivers/usb/host/xhci-plat.c
> > @@ -363,7 +363,7 @@ static int xhci_generic_plat_probe(struct
> platform_device *pdev)
> > is_acpi_device_node(sysdev->fwnode))
> > break;
> > #ifdef CONFIG_PCI
> > - else if (sysdev->bus == &pci_bus_type)
> > + else if (dev_is_pci(sysdev))
>
> With that change, you can also get rid of the #ifdef lines too, right?

Yes, that's right. I will send v2 patch with it.

Best regards,
Nobuhiro