* [PATCH 02/30] usb: chipidea/core: Use devm_platform_get_and_ioremap_resource()
2023-07-26 11:37 [PATCH 01/30] usb: ehci-npcm7xx: fix typo in npcm7xx_ehci_hcd_drv_probe() Yangtao Li
@ 2023-07-26 11:37 ` Yangtao Li
2023-07-26 11:37 ` [PATCH 03/30] usb: ohci-at91: " Yangtao Li
` (27 subsequent siblings)
28 siblings, 0 replies; 39+ messages in thread
From: Yangtao Li @ 2023-07-26 11:37 UTC (permalink / raw)
To: Peter Chen, Greg Kroah-Hartman; +Cc: Yangtao Li, linux-usb, linux-kernel
Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/usb/chipidea/core.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
index 51994d655b82..6e1196b53253 100644
--- a/drivers/usb/chipidea/core.c
+++ b/drivers/usb/chipidea/core.c
@@ -1028,8 +1028,7 @@ static int ci_hdrc_probe(struct platform_device *pdev)
return -ENODEV;
}
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- base = devm_ioremap_resource(dev, res);
+ base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(base))
return PTR_ERR(base);
--
2.39.0
^ permalink raw reply related [flat|nested] 39+ messages in thread* [PATCH 03/30] usb: ohci-at91: Use devm_platform_get_and_ioremap_resource()
2023-07-26 11:37 [PATCH 01/30] usb: ehci-npcm7xx: fix typo in npcm7xx_ehci_hcd_drv_probe() Yangtao Li
2023-07-26 11:37 ` [PATCH 02/30] usb: chipidea/core: Use devm_platform_get_and_ioremap_resource() Yangtao Li
@ 2023-07-26 11:37 ` Yangtao Li
2023-07-26 14:27 ` Alan Stern
2023-07-26 11:37 ` [PATCH 04/30] usb: ohci-at91: Remove redundant msg at probe time Yangtao Li
` (26 subsequent siblings)
28 siblings, 1 reply; 39+ messages in thread
From: Yangtao Li @ 2023-07-26 11:37 UTC (permalink / raw)
To: Alan Stern, Greg Kroah-Hartman, Nicolas Ferre, Alexandre Belloni,
Claudiu Beznea
Cc: Yangtao Li, linux-usb, linux-arm-kernel, linux-kernel
Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/usb/host/ohci-at91.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c
index b9ce8d80f20b..f957d008f360 100644
--- a/drivers/usb/host/ohci-at91.c
+++ b/drivers/usb/host/ohci-at91.c
@@ -200,8 +200,7 @@ static int usb_hcd_at91_probe(const struct hc_driver *driver,
return -ENOMEM;
ohci_at91 = hcd_to_ohci_at91_priv(hcd);
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- hcd->regs = devm_ioremap_resource(dev, res);
+ hcd->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(hcd->regs)) {
retval = PTR_ERR(hcd->regs);
goto err;
--
2.39.0
^ permalink raw reply related [flat|nested] 39+ messages in thread* Re: [PATCH 03/30] usb: ohci-at91: Use devm_platform_get_and_ioremap_resource()
2023-07-26 11:37 ` [PATCH 03/30] usb: ohci-at91: " Yangtao Li
@ 2023-07-26 14:27 ` Alan Stern
2023-07-26 14:29 ` Alan Stern
0 siblings, 1 reply; 39+ messages in thread
From: Alan Stern @ 2023-07-26 14:27 UTC (permalink / raw)
To: Yangtao Li
Cc: Greg Kroah-Hartman, Nicolas Ferre, Alexandre Belloni,
Claudiu Beznea, linux-usb, linux-arm-kernel, linux-kernel
On Wed, Jul 26, 2023 at 07:37:49PM +0800, Yangtao Li wrote:
> Convert platform_get_resource(), devm_ioremap_resource() to a single
> call to devm_platform_get_and_ioremap_resource(), as this is exactly
> what this function does.
>
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
> ---
> drivers/usb/host/ohci-at91.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c
> index b9ce8d80f20b..f957d008f360 100644
> --- a/drivers/usb/host/ohci-at91.c
> +++ b/drivers/usb/host/ohci-at91.c
> @@ -200,8 +200,7 @@ static int usb_hcd_at91_probe(const struct hc_driver *driver,
> return -ENOMEM;
> ohci_at91 = hcd_to_ohci_at91_priv(hcd);
>
> - res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - hcd->regs = devm_ioremap_resource(dev, res);
> + hcd->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
> if (IS_ERR(hcd->regs)) {
> retval = PTR_ERR(hcd->regs);
> goto err;
Did you try to test-compile this change (and all the similar ones in
this series)? If you did, you would have gotten a warning about res
being used without being initialized.
Alan Stern
^ permalink raw reply [flat|nested] 39+ messages in thread* Re: [PATCH 03/30] usb: ohci-at91: Use devm_platform_get_and_ioremap_resource()
2023-07-26 14:27 ` Alan Stern
@ 2023-07-26 14:29 ` Alan Stern
0 siblings, 0 replies; 39+ messages in thread
From: Alan Stern @ 2023-07-26 14:29 UTC (permalink / raw)
To: Yangtao Li
Cc: Greg Kroah-Hartman, Nicolas Ferre, Alexandre Belloni,
Claudiu Beznea, linux-usb, linux-arm-kernel, linux-kernel
On Wed, Jul 26, 2023 at 10:27:43AM -0400, Alan Stern wrote:
> On Wed, Jul 26, 2023 at 07:37:49PM +0800, Yangtao Li wrote:
> > Convert platform_get_resource(), devm_ioremap_resource() to a single
> > call to devm_platform_get_and_ioremap_resource(), as this is exactly
> > what this function does.
> >
> > Signed-off-by: Yangtao Li <frank.li@vivo.com>
> > ---
> > drivers/usb/host/ohci-at91.c | 3 +--
> > 1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c
> > index b9ce8d80f20b..f957d008f360 100644
> > --- a/drivers/usb/host/ohci-at91.c
> > +++ b/drivers/usb/host/ohci-at91.c
> > @@ -200,8 +200,7 @@ static int usb_hcd_at91_probe(const struct hc_driver *driver,
> > return -ENOMEM;
> > ohci_at91 = hcd_to_ohci_at91_priv(hcd);
> >
> > - res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > - hcd->regs = devm_ioremap_resource(dev, res);
> > + hcd->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
> > if (IS_ERR(hcd->regs)) {
> > retval = PTR_ERR(hcd->regs);
> > goto err;
>
> Did you try to test-compile this change (and all the similar ones in
> this series)? If you did, you would have gotten a warning about res
> being used without being initialized.
Oops! My apologies, I didn't read the code closely enough. Sorry.
For all the ehci, ohci, and uhci changes in this series:
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Alan Stern
^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH 04/30] usb: ohci-at91: Remove redundant msg at probe time
2023-07-26 11:37 [PATCH 01/30] usb: ehci-npcm7xx: fix typo in npcm7xx_ehci_hcd_drv_probe() Yangtao Li
2023-07-26 11:37 ` [PATCH 02/30] usb: chipidea/core: Use devm_platform_get_and_ioremap_resource() Yangtao Li
2023-07-26 11:37 ` [PATCH 03/30] usb: ohci-at91: " Yangtao Li
@ 2023-07-26 11:37 ` Yangtao Li
2023-07-27 5:35 ` claudiu beznea
2023-07-26 11:37 ` [PATCH 05/30] usb: gadget: udc: udc-xilinx: Use devm_platform_get_and_ioremap_resource() Yangtao Li
` (25 subsequent siblings)
28 siblings, 1 reply; 39+ messages in thread
From: Yangtao Li @ 2023-07-26 11:37 UTC (permalink / raw)
To: Alan Stern, Greg Kroah-Hartman, Nicolas Ferre, Alexandre Belloni,
Claudiu Beznea
Cc: Yangtao Li, linux-usb, linux-arm-kernel, linux-kernel
platform_get_irq() directly prints error information.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/usb/host/ohci-at91.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c
index f957d008f360..439d8a16d7c5 100644
--- a/drivers/usb/host/ohci-at91.c
+++ b/drivers/usb/host/ohci-at91.c
@@ -190,10 +190,8 @@ static int usb_hcd_at91_probe(const struct hc_driver *driver,
int irq;
irq = platform_get_irq(pdev, 0);
- if (irq < 0) {
- dev_dbg(dev, "hcd probe: missing irq resource\n");
+ if (irq < 0)
return irq;
- }
hcd = usb_create_hcd(driver, dev, "at91");
if (!hcd)
--
2.39.0
^ permalink raw reply related [flat|nested] 39+ messages in thread* Re: [PATCH 04/30] usb: ohci-at91: Remove redundant msg at probe time
2023-07-26 11:37 ` [PATCH 04/30] usb: ohci-at91: Remove redundant msg at probe time Yangtao Li
@ 2023-07-27 5:35 ` claudiu beznea
0 siblings, 0 replies; 39+ messages in thread
From: claudiu beznea @ 2023-07-27 5:35 UTC (permalink / raw)
To: Yangtao Li, Alan Stern, Greg Kroah-Hartman, Nicolas Ferre,
Alexandre Belloni, Claudiu Beznea
Cc: linux-usb, linux-arm-kernel, linux-kernel
On 26.07.2023 14:37, Yangtao Li wrote:
> platform_get_irq() directly prints error information.
>
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@tuxon.dev>
> ---
> drivers/usb/host/ohci-at91.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c
> index f957d008f360..439d8a16d7c5 100644
> --- a/drivers/usb/host/ohci-at91.c
> +++ b/drivers/usb/host/ohci-at91.c
> @@ -190,10 +190,8 @@ static int usb_hcd_at91_probe(const struct hc_driver *driver,
> int irq;
>
> irq = platform_get_irq(pdev, 0);
> - if (irq < 0) {
> - dev_dbg(dev, "hcd probe: missing irq resource\n");
> + if (irq < 0)
> return irq;
> - }
>
> hcd = usb_create_hcd(driver, dev, "at91");
> if (!hcd)
^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH 05/30] usb: gadget: udc: udc-xilinx: Use devm_platform_get_and_ioremap_resource()
2023-07-26 11:37 [PATCH 01/30] usb: ehci-npcm7xx: fix typo in npcm7xx_ehci_hcd_drv_probe() Yangtao Li
` (2 preceding siblings ...)
2023-07-26 11:37 ` [PATCH 04/30] usb: ohci-at91: Remove redundant msg at probe time Yangtao Li
@ 2023-07-26 11:37 ` Yangtao Li
2023-07-26 11:37 ` [PATCH 06/30] usb: gadget: aspeed: " Yangtao Li
` (24 subsequent siblings)
28 siblings, 0 replies; 39+ messages in thread
From: Yangtao Li @ 2023-07-26 11:37 UTC (permalink / raw)
To: Greg Kroah-Hartman, Michal Simek
Cc: Yangtao Li, linux-usb, linux-arm-kernel, linux-kernel
Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/usb/gadget/udc/udc-xilinx.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/usb/gadget/udc/udc-xilinx.c b/drivers/usb/gadget/udc/udc-xilinx.c
index a4a7b90a97e7..8c249e31dfca 100644
--- a/drivers/usb/gadget/udc/udc-xilinx.c
+++ b/drivers/usb/gadget/udc/udc-xilinx.c
@@ -2080,8 +2080,7 @@ static int xudc_probe(struct platform_device *pdev)
udc->req->usb_req.buf = buff;
/* Map the registers */
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- udc->addr = devm_ioremap_resource(&pdev->dev, res);
+ udc->addr = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(udc->addr))
return PTR_ERR(udc->addr);
--
2.39.0
^ permalink raw reply related [flat|nested] 39+ messages in thread* [PATCH 06/30] usb: gadget: aspeed: Use devm_platform_get_and_ioremap_resource()
2023-07-26 11:37 [PATCH 01/30] usb: ehci-npcm7xx: fix typo in npcm7xx_ehci_hcd_drv_probe() Yangtao Li
` (3 preceding siblings ...)
2023-07-26 11:37 ` [PATCH 05/30] usb: gadget: udc: udc-xilinx: Use devm_platform_get_and_ioremap_resource() Yangtao Li
@ 2023-07-26 11:37 ` Yangtao Li
2023-07-26 11:37 ` [PATCH 07/30] usb: gadget/snps_udc_plat: " Yangtao Li
` (23 subsequent siblings)
28 siblings, 0 replies; 39+ messages in thread
From: Yangtao Li @ 2023-07-26 11:37 UTC (permalink / raw)
To: Greg Kroah-Hartman, Joel Stanley, Andrew Jeffery
Cc: Yangtao Li, linux-usb, linux-arm-kernel, linux-aspeed,
linux-kernel
Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/usb/gadget/udc/aspeed-vhub/core.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/usb/gadget/udc/aspeed-vhub/core.c b/drivers/usb/gadget/udc/aspeed-vhub/core.c
index 16f2db8c4a2b..f60a019bb173 100644
--- a/drivers/usb/gadget/udc/aspeed-vhub/core.c
+++ b/drivers/usb/gadget/udc/aspeed-vhub/core.c
@@ -328,8 +328,7 @@ static int ast_vhub_probe(struct platform_device *pdev)
vhub->port_irq_mask = GENMASK(VHUB_IRQ_DEV1_BIT + vhub->max_ports - 1,
VHUB_IRQ_DEV1_BIT);
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- vhub->regs = devm_ioremap_resource(&pdev->dev, res);
+ vhub->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(vhub->regs)) {
dev_err(&pdev->dev, "Failed to map resources\n");
return PTR_ERR(vhub->regs);
--
2.39.0
^ permalink raw reply related [flat|nested] 39+ messages in thread* [PATCH 07/30] usb: gadget/snps_udc_plat: Use devm_platform_get_and_ioremap_resource()
2023-07-26 11:37 [PATCH 01/30] usb: ehci-npcm7xx: fix typo in npcm7xx_ehci_hcd_drv_probe() Yangtao Li
` (4 preceding siblings ...)
2023-07-26 11:37 ` [PATCH 06/30] usb: gadget: aspeed: " Yangtao Li
@ 2023-07-26 11:37 ` Yangtao Li
2023-07-26 11:37 ` [PATCH 08/30] usb: gadget/atmel_usba_udc: " Yangtao Li
` (22 subsequent siblings)
28 siblings, 0 replies; 39+ messages in thread
From: Yangtao Li @ 2023-07-26 11:37 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: Yangtao Li, linux-usb, linux-kernel
Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/usb/gadget/udc/snps_udc_plat.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/usb/gadget/udc/snps_udc_plat.c b/drivers/usb/gadget/udc/snps_udc_plat.c
index 0ed685db149d..35c7a149b977 100644
--- a/drivers/usb/gadget/udc/snps_udc_plat.c
+++ b/drivers/usb/gadget/udc/snps_udc_plat.c
@@ -112,8 +112,7 @@ static int udc_plat_probe(struct platform_device *pdev)
spin_lock_init(&udc->lock);
udc->dev = dev;
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- udc->virt_addr = devm_ioremap_resource(dev, res);
+ udc->virt_addr = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(udc->virt_addr))
return PTR_ERR(udc->virt_addr);
--
2.39.0
^ permalink raw reply related [flat|nested] 39+ messages in thread* [PATCH 08/30] usb: gadget/atmel_usba_udc: Use devm_platform_get_and_ioremap_resource()
2023-07-26 11:37 [PATCH 01/30] usb: ehci-npcm7xx: fix typo in npcm7xx_ehci_hcd_drv_probe() Yangtao Li
` (5 preceding siblings ...)
2023-07-26 11:37 ` [PATCH 07/30] usb: gadget/snps_udc_plat: " Yangtao Li
@ 2023-07-26 11:37 ` Yangtao Li
2023-07-27 5:34 ` claudiu beznea
2023-07-26 11:37 ` [PATCH 09/30] usb: gadget: aspeed_udc: Convert to devm_platform_ioremap_resource() Yangtao Li
` (21 subsequent siblings)
28 siblings, 1 reply; 39+ messages in thread
From: Yangtao Li @ 2023-07-26 11:37 UTC (permalink / raw)
To: Cristian Birsan, Greg Kroah-Hartman, Nicolas Ferre,
Alexandre Belloni, Claudiu Beznea
Cc: Yangtao Li, linux-arm-kernel, linux-usb, linux-kernel
Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/usb/gadget/udc/atmel_usba_udc.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c
index 6c0ed3fa5eb1..02b1bef5e22e 100644
--- a/drivers/usb/gadget/udc/atmel_usba_udc.c
+++ b/drivers/usb/gadget/udc/atmel_usba_udc.c
@@ -2285,15 +2285,13 @@ static int usba_udc_probe(struct platform_device *pdev)
udc->gadget = usba_gadget_template;
INIT_LIST_HEAD(&udc->gadget.ep_list);
- res = platform_get_resource(pdev, IORESOURCE_MEM, CTRL_IOMEM_ID);
- udc->regs = devm_ioremap_resource(&pdev->dev, res);
+ udc->regs = devm_platform_get_and_ioremap_resource(pdev, CTRL_IOMEM_ID, &res);
if (IS_ERR(udc->regs))
return PTR_ERR(udc->regs);
dev_info(&pdev->dev, "MMIO registers at %pR mapped at %p\n",
res, udc->regs);
- res = platform_get_resource(pdev, IORESOURCE_MEM, FIFO_IOMEM_ID);
- udc->fifo = devm_ioremap_resource(&pdev->dev, res);
+ udc->fifo = devm_platform_get_and_ioremap_resource(pdev, FIFO_IOMEM_ID, &res);
if (IS_ERR(udc->fifo))
return PTR_ERR(udc->fifo);
dev_info(&pdev->dev, "FIFO at %pR mapped at %p\n", res, udc->fifo);
--
2.39.0
^ permalink raw reply related [flat|nested] 39+ messages in thread* Re: [PATCH 08/30] usb: gadget/atmel_usba_udc: Use devm_platform_get_and_ioremap_resource()
2023-07-26 11:37 ` [PATCH 08/30] usb: gadget/atmel_usba_udc: " Yangtao Li
@ 2023-07-27 5:34 ` claudiu beznea
2023-07-27 12:20 ` Cristian.Birsan
0 siblings, 1 reply; 39+ messages in thread
From: claudiu beznea @ 2023-07-27 5:34 UTC (permalink / raw)
To: Yangtao Li, Cristian Birsan, Greg Kroah-Hartman, Nicolas Ferre,
Alexandre Belloni, Claudiu Beznea
Cc: linux-arm-kernel, linux-usb, linux-kernel
On 26.07.2023 14:37, Yangtao Li wrote:
> Convert platform_get_resource(), devm_ioremap_resource() to a single
> call to devm_platform_get_and_ioremap_resource(), as this is exactly
> what this function does.
>
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@tuxon.dev>
> ---
> drivers/usb/gadget/udc/atmel_usba_udc.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c
> index 6c0ed3fa5eb1..02b1bef5e22e 100644
> --- a/drivers/usb/gadget/udc/atmel_usba_udc.c
> +++ b/drivers/usb/gadget/udc/atmel_usba_udc.c
> @@ -2285,15 +2285,13 @@ static int usba_udc_probe(struct platform_device *pdev)
> udc->gadget = usba_gadget_template;
> INIT_LIST_HEAD(&udc->gadget.ep_list);
>
> - res = platform_get_resource(pdev, IORESOURCE_MEM, CTRL_IOMEM_ID);
> - udc->regs = devm_ioremap_resource(&pdev->dev, res);
> + udc->regs = devm_platform_get_and_ioremap_resource(pdev, CTRL_IOMEM_ID, &res);
> if (IS_ERR(udc->regs))
> return PTR_ERR(udc->regs);
> dev_info(&pdev->dev, "MMIO registers at %pR mapped at %p\n",
> res, udc->regs);
>
> - res = platform_get_resource(pdev, IORESOURCE_MEM, FIFO_IOMEM_ID);
> - udc->fifo = devm_ioremap_resource(&pdev->dev, res);
> + udc->fifo = devm_platform_get_and_ioremap_resource(pdev, FIFO_IOMEM_ID, &res);
> if (IS_ERR(udc->fifo))
> return PTR_ERR(udc->fifo);
> dev_info(&pdev->dev, "FIFO at %pR mapped at %p\n", res, udc->fifo);
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH 08/30] usb: gadget/atmel_usba_udc: Use devm_platform_get_and_ioremap_resource()
2023-07-27 5:34 ` claudiu beznea
@ 2023-07-27 12:20 ` Cristian.Birsan
0 siblings, 0 replies; 39+ messages in thread
From: Cristian.Birsan @ 2023-07-27 12:20 UTC (permalink / raw)
To: claudiu.beznea, frank.li, gregkh, Nicolas.Ferre,
alexandre.belloni, Claudiu.Beznea
Cc: linux-arm-kernel, linux-usb, linux-kernel
On 7/27/23 08:34, claudiu beznea wrote:
>
> On 26.07.2023 14:37, Yangtao Li wrote:
>> Convert platform_get_resource(), devm_ioremap_resource() to a single
>> call to devm_platform_get_and_ioremap_resource(), as this is exactly
>> what this function does.
>>
>> Signed-off-by: Yangtao Li <frank.li@vivo.com>
>
> Reviewed-by: Claudiu Beznea <claudiu.beznea@tuxon.dev>
Acked-by: Cristian Birsan <cristian.birsan@microchip.com>
>
>> ---
>> drivers/usb/gadget/udc/atmel_usba_udc.c | 6 ++----
>> 1 file changed, 2 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c
>> index 6c0ed3fa5eb1..02b1bef5e22e 100644
>> --- a/drivers/usb/gadget/udc/atmel_usba_udc.c
>> +++ b/drivers/usb/gadget/udc/atmel_usba_udc.c
>> @@ -2285,15 +2285,13 @@ static int usba_udc_probe(struct platform_device *pdev)
>> udc->gadget = usba_gadget_template;
>> INIT_LIST_HEAD(&udc->gadget.ep_list);
>>
>> - res = platform_get_resource(pdev, IORESOURCE_MEM, CTRL_IOMEM_ID);
>> - udc->regs = devm_ioremap_resource(&pdev->dev, res);
>> + udc->regs = devm_platform_get_and_ioremap_resource(pdev, CTRL_IOMEM_ID, &res);
>> if (IS_ERR(udc->regs))
>> return PTR_ERR(udc->regs);
>> dev_info(&pdev->dev, "MMIO registers at %pR mapped at %p\n",
>> res, udc->regs);
>>
>> - res = platform_get_resource(pdev, IORESOURCE_MEM, FIFO_IOMEM_ID);
>> - udc->fifo = devm_ioremap_resource(&pdev->dev, res);
>> + udc->fifo = devm_platform_get_and_ioremap_resource(pdev, FIFO_IOMEM_ID, &res);
>> if (IS_ERR(udc->fifo))
>> return PTR_ERR(udc->fifo);
>> dev_info(&pdev->dev, "FIFO at %pR mapped at %p\n", res, udc->fifo);
^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH 09/30] usb: gadget: aspeed_udc: Convert to devm_platform_ioremap_resource()
2023-07-26 11:37 [PATCH 01/30] usb: ehci-npcm7xx: fix typo in npcm7xx_ehci_hcd_drv_probe() Yangtao Li
` (6 preceding siblings ...)
2023-07-26 11:37 ` [PATCH 08/30] usb: gadget/atmel_usba_udc: " Yangtao Li
@ 2023-07-26 11:37 ` Yangtao Li
2023-07-26 11:37 ` [PATCH 10/30] usb: ehci-atmel: Use devm_platform_get_and_ioremap_resource() Yangtao Li
` (20 subsequent siblings)
28 siblings, 0 replies; 39+ messages in thread
From: Yangtao Li @ 2023-07-26 11:37 UTC (permalink / raw)
To: Neal Liu, Greg Kroah-Hartman, Joel Stanley, Andrew Jeffery
Cc: Yangtao Li, linux-aspeed, linux-usb, linux-arm-kernel,
linux-kernel
Use devm_platform_ioremap_resource() to simplify code.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/usb/gadget/udc/aspeed_udc.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/usb/gadget/udc/aspeed_udc.c b/drivers/usb/gadget/udc/aspeed_udc.c
index 01968e2167f9..2ef89a442f50 100644
--- a/drivers/usb/gadget/udc/aspeed_udc.c
+++ b/drivers/usb/gadget/udc/aspeed_udc.c
@@ -1468,7 +1468,6 @@ static int ast_udc_probe(struct platform_device *pdev)
enum usb_device_speed max_speed;
struct device *dev = &pdev->dev;
struct ast_udc_dev *udc;
- struct resource *res;
int rc;
udc = devm_kzalloc(&pdev->dev, sizeof(struct ast_udc_dev), GFP_KERNEL);
@@ -1484,8 +1483,7 @@ static int ast_udc_probe(struct platform_device *pdev)
udc->gadget.name = "aspeed-udc";
udc->gadget.dev.init_name = "gadget";
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- udc->reg = devm_ioremap_resource(&pdev->dev, res);
+ udc->reg = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(udc->reg)) {
dev_err(&pdev->dev, "Failed to map resources\n");
return PTR_ERR(udc->reg);
--
2.39.0
^ permalink raw reply related [flat|nested] 39+ messages in thread* [PATCH 10/30] usb: ehci-atmel: Use devm_platform_get_and_ioremap_resource()
2023-07-26 11:37 [PATCH 01/30] usb: ehci-npcm7xx: fix typo in npcm7xx_ehci_hcd_drv_probe() Yangtao Li
` (7 preceding siblings ...)
2023-07-26 11:37 ` [PATCH 09/30] usb: gadget: aspeed_udc: Convert to devm_platform_ioremap_resource() Yangtao Li
@ 2023-07-26 11:37 ` Yangtao Li
2023-07-27 5:35 ` claudiu beznea
2023-07-26 11:37 ` [PATCH 11/30] usb: ehci-platform: " Yangtao Li
` (19 subsequent siblings)
28 siblings, 1 reply; 39+ messages in thread
From: Yangtao Li @ 2023-07-26 11:37 UTC (permalink / raw)
To: Alan Stern, Greg Kroah-Hartman, Nicolas Ferre, Alexandre Belloni,
Claudiu Beznea
Cc: Yangtao Li, linux-usb, linux-arm-kernel, linux-kernel
Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/usb/host/ehci-atmel.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/usb/host/ehci-atmel.c b/drivers/usb/host/ehci-atmel.c
index 61808c51e702..e14b66d848ee 100644
--- a/drivers/usb/host/ehci-atmel.c
+++ b/drivers/usb/host/ehci-atmel.c
@@ -122,8 +122,7 @@ static int ehci_atmel_drv_probe(struct platform_device *pdev)
}
atmel_ehci = hcd_to_atmel_ehci_priv(hcd);
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- hcd->regs = devm_ioremap_resource(&pdev->dev, res);
+ hcd->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(hcd->regs)) {
retval = PTR_ERR(hcd->regs);
goto fail_request_resource;
--
2.39.0
^ permalink raw reply related [flat|nested] 39+ messages in thread* Re: [PATCH 10/30] usb: ehci-atmel: Use devm_platform_get_and_ioremap_resource()
2023-07-26 11:37 ` [PATCH 10/30] usb: ehci-atmel: Use devm_platform_get_and_ioremap_resource() Yangtao Li
@ 2023-07-27 5:35 ` claudiu beznea
0 siblings, 0 replies; 39+ messages in thread
From: claudiu beznea @ 2023-07-27 5:35 UTC (permalink / raw)
To: Yangtao Li, Alan Stern, Greg Kroah-Hartman, Nicolas Ferre,
Alexandre Belloni, Claudiu Beznea
Cc: linux-usb, linux-arm-kernel, linux-kernel
On 26.07.2023 14:37, Yangtao Li wrote:
> Convert platform_get_resource(), devm_ioremap_resource() to a single
> call to devm_platform_get_and_ioremap_resource(), as this is exactly
> what this function does.
>
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@tuxon.dev>
> ---
> drivers/usb/host/ehci-atmel.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/usb/host/ehci-atmel.c b/drivers/usb/host/ehci-atmel.c
> index 61808c51e702..e14b66d848ee 100644
> --- a/drivers/usb/host/ehci-atmel.c
> +++ b/drivers/usb/host/ehci-atmel.c
> @@ -122,8 +122,7 @@ static int ehci_atmel_drv_probe(struct platform_device *pdev)
> }
> atmel_ehci = hcd_to_atmel_ehci_priv(hcd);
>
> - res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - hcd->regs = devm_ioremap_resource(&pdev->dev, res);
> + hcd->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
> if (IS_ERR(hcd->regs)) {
> retval = PTR_ERR(hcd->regs);
> goto fail_request_resource;
^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH 11/30] usb: ehci-platform: Use devm_platform_get_and_ioremap_resource()
2023-07-26 11:37 [PATCH 01/30] usb: ehci-npcm7xx: fix typo in npcm7xx_ehci_hcd_drv_probe() Yangtao Li
` (8 preceding siblings ...)
2023-07-26 11:37 ` [PATCH 10/30] usb: ehci-atmel: Use devm_platform_get_and_ioremap_resource() Yangtao Li
@ 2023-07-26 11:37 ` Yangtao Li
2023-07-26 11:37 ` [PATCH 12/30] usb: ehci-spear: " Yangtao Li
` (18 subsequent siblings)
28 siblings, 0 replies; 39+ messages in thread
From: Yangtao Li @ 2023-07-26 11:37 UTC (permalink / raw)
To: Alan Stern, Greg Kroah-Hartman
Cc: Yangtao Li, linux-usb, linux-arm-kernel, linux-kernel
Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/usb/host/ehci-platform.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/usb/host/ehci-platform.c b/drivers/usb/host/ehci-platform.c
index 83bf56c9424f..98b073185e1c 100644
--- a/drivers/usb/host/ehci-platform.c
+++ b/drivers/usb/host/ehci-platform.c
@@ -359,8 +359,7 @@ static int ehci_platform_probe(struct platform_device *dev)
goto err_reset;
}
- res_mem = platform_get_resource(dev, IORESOURCE_MEM, 0);
- hcd->regs = devm_ioremap_resource(&dev->dev, res_mem);
+ hcd->regs = devm_platform_get_and_ioremap_resource(dev, 0, &res_mem);
if (IS_ERR(hcd->regs)) {
err = PTR_ERR(hcd->regs);
goto err_power;
--
2.39.0
^ permalink raw reply related [flat|nested] 39+ messages in thread* [PATCH 12/30] usb: ehci-spear: Use devm_platform_get_and_ioremap_resource()
2023-07-26 11:37 [PATCH 01/30] usb: ehci-npcm7xx: fix typo in npcm7xx_ehci_hcd_drv_probe() Yangtao Li
` (9 preceding siblings ...)
2023-07-26 11:37 ` [PATCH 11/30] usb: ehci-platform: " Yangtao Li
@ 2023-07-26 11:37 ` Yangtao Li
2023-07-26 11:37 ` [PATCH 13/30] usb: isp1362-hcd: " Yangtao Li
` (17 subsequent siblings)
28 siblings, 0 replies; 39+ messages in thread
From: Yangtao Li @ 2023-07-26 11:37 UTC (permalink / raw)
To: Alan Stern, Greg Kroah-Hartman; +Cc: Yangtao Li, linux-usb, linux-kernel
Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/usb/host/ehci-spear.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/usb/host/ehci-spear.c b/drivers/usb/host/ehci-spear.c
index 1407703649be..d0e94e4c9fe2 100644
--- a/drivers/usb/host/ehci-spear.c
+++ b/drivers/usb/host/ehci-spear.c
@@ -91,8 +91,7 @@ static int spear_ehci_hcd_drv_probe(struct platform_device *pdev)
goto fail;
}
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- hcd->regs = devm_ioremap_resource(&pdev->dev, res);
+ hcd->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(hcd->regs)) {
retval = PTR_ERR(hcd->regs);
goto err_put_hcd;
--
2.39.0
^ permalink raw reply related [flat|nested] 39+ messages in thread* [PATCH 13/30] usb: isp1362-hcd: Use devm_platform_get_and_ioremap_resource()
2023-07-26 11:37 [PATCH 01/30] usb: ehci-npcm7xx: fix typo in npcm7xx_ehci_hcd_drv_probe() Yangtao Li
` (10 preceding siblings ...)
2023-07-26 11:37 ` [PATCH 12/30] usb: ehci-spear: " Yangtao Li
@ 2023-07-26 11:37 ` Yangtao Li
2023-07-26 11:38 ` [PATCH 14/30] usb: ohci-da8xx: " Yangtao Li
` (16 subsequent siblings)
28 siblings, 0 replies; 39+ messages in thread
From: Yangtao Li @ 2023-07-26 11:37 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: Yangtao Li, linux-usb, linux-kernel
Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/usb/host/isp1362-hcd.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/usb/host/isp1362-hcd.c b/drivers/usb/host/isp1362-hcd.c
index 606f0a64f3b7..a52c3d858f3e 100644
--- a/drivers/usb/host/isp1362-hcd.c
+++ b/drivers/usb/host/isp1362-hcd.c
@@ -2651,8 +2651,7 @@ static int isp1362_probe(struct platform_device *pdev)
if (IS_ERR(addr_reg))
return PTR_ERR(addr_reg);
- data = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- data_reg = devm_ioremap_resource(&pdev->dev, data);
+ data_reg = devm_platform_get_and_ioremap_resource(pdev, 0, &data);
if (IS_ERR(data_reg))
return PTR_ERR(data_reg);
--
2.39.0
^ permalink raw reply related [flat|nested] 39+ messages in thread* [PATCH 14/30] usb: ohci-da8xx: Use devm_platform_get_and_ioremap_resource()
2023-07-26 11:37 [PATCH 01/30] usb: ehci-npcm7xx: fix typo in npcm7xx_ehci_hcd_drv_probe() Yangtao Li
` (11 preceding siblings ...)
2023-07-26 11:37 ` [PATCH 13/30] usb: isp1362-hcd: " Yangtao Li
@ 2023-07-26 11:38 ` Yangtao Li
2023-07-26 11:38 ` [PATCH 15/30] usb: host: ohci-platform: " Yangtao Li
` (15 subsequent siblings)
28 siblings, 0 replies; 39+ messages in thread
From: Yangtao Li @ 2023-07-26 11:38 UTC (permalink / raw)
To: Alan Stern, Greg Kroah-Hartman; +Cc: Yangtao Li, linux-usb, linux-kernel
Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/usb/host/ohci-da8xx.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/usb/host/ohci-da8xx.c b/drivers/usb/host/ohci-da8xx.c
index e4191a868944..40ec70080717 100644
--- a/drivers/usb/host/ohci-da8xx.c
+++ b/drivers/usb/host/ohci-da8xx.c
@@ -435,8 +435,7 @@ static int ohci_da8xx_probe(struct platform_device *pdev)
goto err;
}
- mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- hcd->regs = devm_ioremap_resource(dev, mem);
+ hcd->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &mem);
if (IS_ERR(hcd->regs)) {
error = PTR_ERR(hcd->regs);
goto err;
--
2.39.0
^ permalink raw reply related [flat|nested] 39+ messages in thread* [PATCH 15/30] usb: host: ohci-platform: Use devm_platform_get_and_ioremap_resource()
2023-07-26 11:37 [PATCH 01/30] usb: ehci-npcm7xx: fix typo in npcm7xx_ehci_hcd_drv_probe() Yangtao Li
` (12 preceding siblings ...)
2023-07-26 11:38 ` [PATCH 14/30] usb: ohci-da8xx: " Yangtao Li
@ 2023-07-26 11:38 ` Yangtao Li
2023-07-26 11:38 ` [PATCH 16/30] usb: ehci-sh: " Yangtao Li
` (14 subsequent siblings)
28 siblings, 0 replies; 39+ messages in thread
From: Yangtao Li @ 2023-07-26 11:38 UTC (permalink / raw)
To: Alan Stern, Greg Kroah-Hartman; +Cc: Yangtao Li, linux-usb, linux-kernel
Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/usb/host/ohci-platform.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/usb/host/ohci-platform.c b/drivers/usb/host/ohci-platform.c
index 45a2c981319e..4a75507325dd 100644
--- a/drivers/usb/host/ohci-platform.c
+++ b/drivers/usb/host/ohci-platform.c
@@ -200,8 +200,7 @@ static int ohci_platform_probe(struct platform_device *dev)
goto err_reset;
}
- res_mem = platform_get_resource(dev, IORESOURCE_MEM, 0);
- hcd->regs = devm_ioremap_resource(&dev->dev, res_mem);
+ hcd->regs = devm_platform_get_and_ioremap_resource(dev, 0, &res_mem);
if (IS_ERR(hcd->regs)) {
err = PTR_ERR(hcd->regs);
goto err_power;
--
2.39.0
^ permalink raw reply related [flat|nested] 39+ messages in thread* [PATCH 16/30] usb: ehci-sh: Use devm_platform_get_and_ioremap_resource()
2023-07-26 11:37 [PATCH 01/30] usb: ehci-npcm7xx: fix typo in npcm7xx_ehci_hcd_drv_probe() Yangtao Li
` (13 preceding siblings ...)
2023-07-26 11:38 ` [PATCH 15/30] usb: host: ohci-platform: " Yangtao Li
@ 2023-07-26 11:38 ` Yangtao Li
2023-07-26 11:38 ` [PATCH 17/30] usb: ohci-exynos: " Yangtao Li
` (13 subsequent siblings)
28 siblings, 0 replies; 39+ messages in thread
From: Yangtao Li @ 2023-07-26 11:38 UTC (permalink / raw)
To: Alan Stern, Greg Kroah-Hartman; +Cc: Yangtao Li, linux-usb, linux-kernel
Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/usb/host/ehci-sh.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/usb/host/ehci-sh.c b/drivers/usb/host/ehci-sh.c
index 0520e762801d..575c513f7ea0 100644
--- a/drivers/usb/host/ehci-sh.c
+++ b/drivers/usb/host/ehci-sh.c
@@ -95,8 +95,7 @@ static int ehci_hcd_sh_probe(struct platform_device *pdev)
goto fail_create_hcd;
}
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- hcd->regs = devm_ioremap_resource(&pdev->dev, res);
+ hcd->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(hcd->regs)) {
ret = PTR_ERR(hcd->regs);
goto fail_request_resource;
--
2.39.0
^ permalink raw reply related [flat|nested] 39+ messages in thread* [PATCH 17/30] usb: ohci-exynos: Use devm_platform_get_and_ioremap_resource()
2023-07-26 11:37 [PATCH 01/30] usb: ehci-npcm7xx: fix typo in npcm7xx_ehci_hcd_drv_probe() Yangtao Li
` (14 preceding siblings ...)
2023-07-26 11:38 ` [PATCH 16/30] usb: ehci-sh: " Yangtao Li
@ 2023-07-26 11:38 ` Yangtao Li
2023-07-26 11:38 ` [PATCH 18/30] usb: ehci-npcm7xx: " Yangtao Li
` (12 subsequent siblings)
28 siblings, 0 replies; 39+ messages in thread
From: Yangtao Li @ 2023-07-26 11:38 UTC (permalink / raw)
To: Alan Stern, Greg Kroah-Hartman, Krzysztof Kozlowski, Alim Akhtar
Cc: Yangtao Li, linux-usb, linux-arm-kernel, linux-samsung-soc,
linux-kernel
Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/usb/host/ohci-exynos.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c
index ab31c459b32d..20e26a474591 100644
--- a/drivers/usb/host/ohci-exynos.c
+++ b/drivers/usb/host/ohci-exynos.c
@@ -149,8 +149,7 @@ static int exynos_ohci_probe(struct platform_device *pdev)
if (err)
goto fail_clk;
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- hcd->regs = devm_ioremap_resource(&pdev->dev, res);
+ hcd->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(hcd->regs)) {
err = PTR_ERR(hcd->regs);
goto fail_io;
--
2.39.0
^ permalink raw reply related [flat|nested] 39+ messages in thread* [PATCH 18/30] usb: ehci-npcm7xx: Use devm_platform_get_and_ioremap_resource()
2023-07-26 11:37 [PATCH 01/30] usb: ehci-npcm7xx: fix typo in npcm7xx_ehci_hcd_drv_probe() Yangtao Li
` (15 preceding siblings ...)
2023-07-26 11:38 ` [PATCH 17/30] usb: ohci-exynos: " Yangtao Li
@ 2023-07-26 11:38 ` Yangtao Li
2023-07-26 11:38 ` [PATCH 19/30] usb: ohci-nxp: " Yangtao Li
` (11 subsequent siblings)
28 siblings, 0 replies; 39+ messages in thread
From: Yangtao Li @ 2023-07-26 11:38 UTC (permalink / raw)
To: Avi Fishman, Tomer Maimon, Tali Perry, Patrick Venture,
Nancy Yuen, Benjamin Fair, Alan Stern, Greg Kroah-Hartman
Cc: Yangtao Li, openbmc, linux-usb, linux-kernel
Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/usb/host/ehci-npcm7xx.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/usb/host/ehci-npcm7xx.c b/drivers/usb/host/ehci-npcm7xx.c
index 0b3b3bd689cf..3d3317a1a0b3 100644
--- a/drivers/usb/host/ehci-npcm7xx.c
+++ b/drivers/usb/host/ehci-npcm7xx.c
@@ -79,8 +79,7 @@ static int npcm7xx_ehci_hcd_drv_probe(struct platform_device *pdev)
goto fail;
}
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- hcd->regs = devm_ioremap_resource(&pdev->dev, res);
+ hcd->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(hcd->regs)) {
retval = PTR_ERR(hcd->regs);
goto err_put_hcd;
--
2.39.0
^ permalink raw reply related [flat|nested] 39+ messages in thread* [PATCH 19/30] usb: ohci-nxp: Use devm_platform_get_and_ioremap_resource()
2023-07-26 11:37 [PATCH 01/30] usb: ehci-npcm7xx: fix typo in npcm7xx_ehci_hcd_drv_probe() Yangtao Li
` (16 preceding siblings ...)
2023-07-26 11:38 ` [PATCH 18/30] usb: ehci-npcm7xx: " Yangtao Li
@ 2023-07-26 11:38 ` Yangtao Li
2023-07-26 11:38 ` [PATCH 20/30] usb: ehci-orion: " Yangtao Li
` (10 subsequent siblings)
28 siblings, 0 replies; 39+ messages in thread
From: Yangtao Li @ 2023-07-26 11:38 UTC (permalink / raw)
To: Vladimir Zapolskiy, Alan Stern, Greg Kroah-Hartman
Cc: Yangtao Li, linux-usb, linux-arm-kernel, linux-kernel
Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/usb/host/ohci-nxp.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/usb/host/ohci-nxp.c b/drivers/usb/host/ohci-nxp.c
index c04b2af5c766..8264c454f6bd 100644
--- a/drivers/usb/host/ohci-nxp.c
+++ b/drivers/usb/host/ohci-nxp.c
@@ -202,8 +202,7 @@ static int ohci_hcd_nxp_probe(struct platform_device *pdev)
goto fail_hcd;
}
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- hcd->regs = devm_ioremap_resource(&pdev->dev, res);
+ hcd->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(hcd->regs)) {
ret = PTR_ERR(hcd->regs);
goto fail_resource;
--
2.39.0
^ permalink raw reply related [flat|nested] 39+ messages in thread* [PATCH 20/30] usb: ehci-orion: Use devm_platform_get_and_ioremap_resource()
2023-07-26 11:37 [PATCH 01/30] usb: ehci-npcm7xx: fix typo in npcm7xx_ehci_hcd_drv_probe() Yangtao Li
` (17 preceding siblings ...)
2023-07-26 11:38 ` [PATCH 19/30] usb: ohci-nxp: " Yangtao Li
@ 2023-07-26 11:38 ` Yangtao Li
2023-07-26 11:38 ` [PATCH 21/30] usb: ehci-fsl: " Yangtao Li
` (9 subsequent siblings)
28 siblings, 0 replies; 39+ messages in thread
From: Yangtao Li @ 2023-07-26 11:38 UTC (permalink / raw)
To: Alan Stern, Greg Kroah-Hartman; +Cc: Yangtao Li, linux-usb, linux-kernel
Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/usb/host/ehci-orion.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/usb/host/ehci-orion.c b/drivers/usb/host/ehci-orion.c
index 2cfb27dc943a..e0cf90aa3ad1 100644
--- a/drivers/usb/host/ehci-orion.c
+++ b/drivers/usb/host/ehci-orion.c
@@ -234,8 +234,7 @@ static int ehci_orion_drv_probe(struct platform_device *pdev)
if (err)
goto err;
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- regs = devm_ioremap_resource(&pdev->dev, res);
+ regs = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(regs)) {
err = PTR_ERR(regs);
goto err;
--
2.39.0
^ permalink raw reply related [flat|nested] 39+ messages in thread* [PATCH 21/30] usb: ehci-fsl: Use devm_platform_get_and_ioremap_resource()
2023-07-26 11:37 [PATCH 01/30] usb: ehci-npcm7xx: fix typo in npcm7xx_ehci_hcd_drv_probe() Yangtao Li
` (18 preceding siblings ...)
2023-07-26 11:38 ` [PATCH 20/30] usb: ehci-orion: " Yangtao Li
@ 2023-07-26 11:38 ` Yangtao Li
2023-07-26 11:38 ` [PATCH 22/30] usb: oxu210hp-hcd: " Yangtao Li
` (8 subsequent siblings)
28 siblings, 0 replies; 39+ messages in thread
From: Yangtao Li @ 2023-07-26 11:38 UTC (permalink / raw)
To: Alan Stern, Greg Kroah-Hartman; +Cc: Yangtao Li, linux-usb, linux-kernel
Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/usb/host/ehci-fsl.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c
index 81d60a695510..0ed715af54ae 100644
--- a/drivers/usb/host/ehci-fsl.c
+++ b/drivers/usb/host/ehci-fsl.c
@@ -87,8 +87,7 @@ static int fsl_ehci_drv_probe(struct platform_device *pdev)
goto err1;
}
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- hcd->regs = devm_ioremap_resource(&pdev->dev, res);
+ hcd->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(hcd->regs)) {
retval = PTR_ERR(hcd->regs);
goto err2;
--
2.39.0
^ permalink raw reply related [flat|nested] 39+ messages in thread* [PATCH 22/30] usb: oxu210hp-hcd: Use devm_platform_get_and_ioremap_resource()
2023-07-26 11:37 [PATCH 01/30] usb: ehci-npcm7xx: fix typo in npcm7xx_ehci_hcd_drv_probe() Yangtao Li
` (19 preceding siblings ...)
2023-07-26 11:38 ` [PATCH 21/30] usb: ehci-fsl: " Yangtao Li
@ 2023-07-26 11:38 ` Yangtao Li
2023-07-26 11:38 ` [PATCH 23/30] usb: ohci-pxa27x: " Yangtao Li
` (7 subsequent siblings)
28 siblings, 0 replies; 39+ messages in thread
From: Yangtao Li @ 2023-07-26 11:38 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: Yangtao Li, linux-usb, linux-kernel
Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/usb/host/oxu210hp-hcd.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/usb/host/oxu210hp-hcd.c b/drivers/usb/host/oxu210hp-hcd.c
index 50c1ccabb0f5..d467472f9d3c 100644
--- a/drivers/usb/host/oxu210hp-hcd.c
+++ b/drivers/usb/host/oxu210hp-hcd.c
@@ -4230,8 +4230,7 @@ static int oxu_drv_probe(struct platform_device *pdev)
return irq;
dev_dbg(&pdev->dev, "IRQ resource %d\n", irq);
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- base = devm_ioremap_resource(&pdev->dev, res);
+ base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(base)) {
ret = PTR_ERR(base);
goto error;
--
2.39.0
^ permalink raw reply related [flat|nested] 39+ messages in thread* [PATCH 23/30] usb: ohci-pxa27x: Use devm_platform_get_and_ioremap_resource()
2023-07-26 11:37 [PATCH 01/30] usb: ehci-npcm7xx: fix typo in npcm7xx_ehci_hcd_drv_probe() Yangtao Li
` (20 preceding siblings ...)
2023-07-26 11:38 ` [PATCH 22/30] usb: oxu210hp-hcd: " Yangtao Li
@ 2023-07-26 11:38 ` Yangtao Li
2023-07-26 11:38 ` [PATCH 24/30] usb: ehci-omap: " Yangtao Li
` (6 subsequent siblings)
28 siblings, 0 replies; 39+ messages in thread
From: Yangtao Li @ 2023-07-26 11:38 UTC (permalink / raw)
To: Alan Stern, Greg Kroah-Hartman; +Cc: Yangtao Li, linux-usb, linux-kernel
Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/usb/host/ohci-pxa27x.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c
index 7410442f720f..357d9aee38a3 100644
--- a/drivers/usb/host/ohci-pxa27x.c
+++ b/drivers/usb/host/ohci-pxa27x.c
@@ -435,8 +435,7 @@ static int ohci_hcd_pxa27x_probe(struct platform_device *pdev)
if (!hcd)
return -ENOMEM;
- r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- hcd->regs = devm_ioremap_resource(&pdev->dev, r);
+ hcd->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &r);
if (IS_ERR(hcd->regs)) {
retval = PTR_ERR(hcd->regs);
goto err;
--
2.39.0
^ permalink raw reply related [flat|nested] 39+ messages in thread* [PATCH 24/30] usb: ehci-omap: Use devm_platform_get_and_ioremap_resource()
2023-07-26 11:37 [PATCH 01/30] usb: ehci-npcm7xx: fix typo in npcm7xx_ehci_hcd_drv_probe() Yangtao Li
` (21 preceding siblings ...)
2023-07-26 11:38 ` [PATCH 23/30] usb: ohci-pxa27x: " Yangtao Li
@ 2023-07-26 11:38 ` Yangtao Li
2023-07-26 11:38 ` [PATCH 25/30] usb: ohci-spear: " Yangtao Li
` (5 subsequent siblings)
28 siblings, 0 replies; 39+ messages in thread
From: Yangtao Li @ 2023-07-26 11:38 UTC (permalink / raw)
To: Alan Stern, Greg Kroah-Hartman
Cc: Yangtao Li, linux-usb, linux-omap, linux-kernel
Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/usb/host/ehci-omap.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
index cb6509a735ac..b24f371a46f3 100644
--- a/drivers/usb/host/ehci-omap.c
+++ b/drivers/usb/host/ehci-omap.c
@@ -113,8 +113,7 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
if (irq < 0)
return irq;
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- regs = devm_ioremap_resource(dev, res);
+ regs = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(regs))
return PTR_ERR(regs);
--
2.39.0
^ permalink raw reply related [flat|nested] 39+ messages in thread* [PATCH 25/30] usb: ohci-spear: Use devm_platform_get_and_ioremap_resource()
2023-07-26 11:37 [PATCH 01/30] usb: ehci-npcm7xx: fix typo in npcm7xx_ehci_hcd_drv_probe() Yangtao Li
` (22 preceding siblings ...)
2023-07-26 11:38 ` [PATCH 24/30] usb: ehci-omap: " Yangtao Li
@ 2023-07-26 11:38 ` Yangtao Li
2023-07-26 11:38 ` [PATCH 26/30] usb: ehci-mv: " Yangtao Li
` (4 subsequent siblings)
28 siblings, 0 replies; 39+ messages in thread
From: Yangtao Li @ 2023-07-26 11:38 UTC (permalink / raw)
To: Alan Stern, Greg Kroah-Hartman; +Cc: Yangtao Li, linux-usb, linux-kernel
Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/usb/host/ohci-spear.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/usb/host/ohci-spear.c b/drivers/usb/host/ohci-spear.c
index f4b2656407dd..993f347c5c28 100644
--- a/drivers/usb/host/ohci-spear.c
+++ b/drivers/usb/host/ohci-spear.c
@@ -68,8 +68,7 @@ static int spear_ohci_hcd_drv_probe(struct platform_device *pdev)
goto fail;
}
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- hcd->regs = devm_ioremap_resource(&pdev->dev, res);
+ hcd->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(hcd->regs)) {
retval = PTR_ERR(hcd->regs);
goto err_put_hcd;
--
2.39.0
^ permalink raw reply related [flat|nested] 39+ messages in thread* [PATCH 26/30] usb: ehci-mv: Use devm_platform_get_and_ioremap_resource()
2023-07-26 11:37 [PATCH 01/30] usb: ehci-npcm7xx: fix typo in npcm7xx_ehci_hcd_drv_probe() Yangtao Li
` (23 preceding siblings ...)
2023-07-26 11:38 ` [PATCH 25/30] usb: ohci-spear: " Yangtao Li
@ 2023-07-26 11:38 ` Yangtao Li
2023-07-26 11:38 ` [PATCH 27/30] usb: uhci-platform: " Yangtao Li
` (3 subsequent siblings)
28 siblings, 0 replies; 39+ messages in thread
From: Yangtao Li @ 2023-07-26 11:38 UTC (permalink / raw)
To: Alan Stern, Greg Kroah-Hartman; +Cc: Yangtao Li, linux-usb, linux-kernel
Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/usb/host/ehci-mv.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/usb/host/ehci-mv.c b/drivers/usb/host/ehci-mv.c
index 9320cf0e5bc7..2f1fc7eb8b72 100644
--- a/drivers/usb/host/ehci-mv.c
+++ b/drivers/usb/host/ehci-mv.c
@@ -142,8 +142,7 @@ static int mv_ehci_probe(struct platform_device *pdev)
goto err_put_hcd;
}
- r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- ehci_mv->base = devm_ioremap_resource(&pdev->dev, r);
+ ehci_mv->base = devm_platform_get_and_ioremap_resource(pdev, 0, &r);
if (IS_ERR(ehci_mv->base)) {
retval = PTR_ERR(ehci_mv->base);
goto err_put_hcd;
--
2.39.0
^ permalink raw reply related [flat|nested] 39+ messages in thread* [PATCH 27/30] usb: uhci-platform: Use devm_platform_get_and_ioremap_resource()
2023-07-26 11:37 [PATCH 01/30] usb: ehci-npcm7xx: fix typo in npcm7xx_ehci_hcd_drv_probe() Yangtao Li
` (24 preceding siblings ...)
2023-07-26 11:38 ` [PATCH 26/30] usb: ehci-mv: " Yangtao Li
@ 2023-07-26 11:38 ` Yangtao Li
2023-07-26 11:38 ` [PATCH 28/30] usb: ehci-st: " Yangtao Li
` (2 subsequent siblings)
28 siblings, 0 replies; 39+ messages in thread
From: Yangtao Li @ 2023-07-26 11:38 UTC (permalink / raw)
To: Alan Stern, Greg Kroah-Hartman
Cc: Yangtao Li, linux-usb, linux-arm-kernel, linux-kernel
Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/usb/host/uhci-platform.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/usb/host/uhci-platform.c b/drivers/usb/host/uhci-platform.c
index 71ca532fc086..3dec5dd3a0d5 100644
--- a/drivers/usb/host/uhci-platform.c
+++ b/drivers/usb/host/uhci-platform.c
@@ -91,8 +91,7 @@ static int uhci_hcd_platform_probe(struct platform_device *pdev)
uhci = hcd_to_uhci(hcd);
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- hcd->regs = devm_ioremap_resource(&pdev->dev, res);
+ hcd->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(hcd->regs)) {
ret = PTR_ERR(hcd->regs);
goto err_rmr;
--
2.39.0
^ permalink raw reply related [flat|nested] 39+ messages in thread* [PATCH 28/30] usb: ehci-st: Use devm_platform_get_and_ioremap_resource()
2023-07-26 11:37 [PATCH 01/30] usb: ehci-npcm7xx: fix typo in npcm7xx_ehci_hcd_drv_probe() Yangtao Li
` (25 preceding siblings ...)
2023-07-26 11:38 ` [PATCH 27/30] usb: uhci-platform: " Yangtao Li
@ 2023-07-26 11:38 ` Yangtao Li
2023-08-28 9:08 ` Patrice CHOTARD
2023-07-26 11:38 ` [PATCH 29/30] usb: ehci-exynos: " Yangtao Li
2023-07-26 11:38 ` [PATCH 30/30] usb: ohci-st: " Yangtao Li
28 siblings, 1 reply; 39+ messages in thread
From: Yangtao Li @ 2023-07-26 11:38 UTC (permalink / raw)
To: Alan Stern, Patrice Chotard, Greg Kroah-Hartman
Cc: Yangtao Li, linux-usb, linux-arm-kernel, linux-kernel
Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/usb/host/ehci-st.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/drivers/usb/host/ehci-st.c b/drivers/usb/host/ehci-st.c
index ee0976b815b4..2dbb0d86daaa 100644
--- a/drivers/usb/host/ehci-st.c
+++ b/drivers/usb/host/ehci-st.c
@@ -158,11 +158,6 @@ static int st_ehci_platform_probe(struct platform_device *dev)
irq = platform_get_irq(dev, 0);
if (irq < 0)
return irq;
- res_mem = platform_get_resource(dev, IORESOURCE_MEM, 0);
- if (!res_mem) {
- dev_err(&dev->dev, "no memory resource provided");
- return -ENXIO;
- }
hcd = usb_create_hcd(&ehci_platform_hc_driver, &dev->dev,
dev_name(&dev->dev));
@@ -222,14 +217,13 @@ static int st_ehci_platform_probe(struct platform_device *dev)
goto err_put_clks;
}
- hcd->rsrc_start = res_mem->start;
- hcd->rsrc_len = resource_size(res_mem);
-
- hcd->regs = devm_ioremap_resource(&dev->dev, res_mem);
+ hcd->regs = devm_platform_get_and_ioremap_resource(dev, 0, &res_mem);
if (IS_ERR(hcd->regs)) {
err = PTR_ERR(hcd->regs);
goto err_put_clks;
}
+ hcd->rsrc_start = res_mem->start;
+ hcd->rsrc_len = resource_size(res_mem);
err = usb_add_hcd(hcd, irq, IRQF_SHARED);
if (err)
--
2.39.0
^ permalink raw reply related [flat|nested] 39+ messages in thread* Re: [PATCH 28/30] usb: ehci-st: Use devm_platform_get_and_ioremap_resource()
2023-07-26 11:38 ` [PATCH 28/30] usb: ehci-st: " Yangtao Li
@ 2023-08-28 9:08 ` Patrice CHOTARD
0 siblings, 0 replies; 39+ messages in thread
From: Patrice CHOTARD @ 2023-08-28 9:08 UTC (permalink / raw)
To: Yangtao Li, Alan Stern, Greg Kroah-Hartman
Cc: linux-usb, linux-arm-kernel, linux-kernel
On 7/26/23 13:38, Yangtao Li wrote:
> Convert platform_get_resource(), devm_ioremap_resource() to a single
> call to devm_platform_get_and_ioremap_resource(), as this is exactly
> what this function does.
>
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
> ---
> drivers/usb/host/ehci-st.c | 12 +++---------
> 1 file changed, 3 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/usb/host/ehci-st.c b/drivers/usb/host/ehci-st.c
> index ee0976b815b4..2dbb0d86daaa 100644
> --- a/drivers/usb/host/ehci-st.c
> +++ b/drivers/usb/host/ehci-st.c
> @@ -158,11 +158,6 @@ static int st_ehci_platform_probe(struct platform_device *dev)
> irq = platform_get_irq(dev, 0);
> if (irq < 0)
> return irq;
> - res_mem = platform_get_resource(dev, IORESOURCE_MEM, 0);
> - if (!res_mem) {
> - dev_err(&dev->dev, "no memory resource provided");
> - return -ENXIO;
> - }
>
> hcd = usb_create_hcd(&ehci_platform_hc_driver, &dev->dev,
> dev_name(&dev->dev));
> @@ -222,14 +217,13 @@ static int st_ehci_platform_probe(struct platform_device *dev)
> goto err_put_clks;
> }
>
> - hcd->rsrc_start = res_mem->start;
> - hcd->rsrc_len = resource_size(res_mem);
> -
> - hcd->regs = devm_ioremap_resource(&dev->dev, res_mem);
> + hcd->regs = devm_platform_get_and_ioremap_resource(dev, 0, &res_mem);
> if (IS_ERR(hcd->regs)) {
> err = PTR_ERR(hcd->regs);
> goto err_put_clks;
> }
> + hcd->rsrc_start = res_mem->start;
> + hcd->rsrc_len = resource_size(res_mem);
>
> err = usb_add_hcd(hcd, irq, IRQF_SHARED);
> if (err)
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Thanks
Patrice
^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH 29/30] usb: ehci-exynos: Use devm_platform_get_and_ioremap_resource()
2023-07-26 11:37 [PATCH 01/30] usb: ehci-npcm7xx: fix typo in npcm7xx_ehci_hcd_drv_probe() Yangtao Li
` (26 preceding siblings ...)
2023-07-26 11:38 ` [PATCH 28/30] usb: ehci-st: " Yangtao Li
@ 2023-07-26 11:38 ` Yangtao Li
2023-07-27 0:46 ` Andi Shyti
2023-07-26 11:38 ` [PATCH 30/30] usb: ohci-st: " Yangtao Li
28 siblings, 1 reply; 39+ messages in thread
From: Yangtao Li @ 2023-07-26 11:38 UTC (permalink / raw)
To: Alan Stern, Greg Kroah-Hartman, Krzysztof Kozlowski, Alim Akhtar
Cc: Yangtao Li, linux-usb, linux-arm-kernel, linux-samsung-soc,
linux-kernel
Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/usb/host/ehci-exynos.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/usb/host/ehci-exynos.c b/drivers/usb/host/ehci-exynos.c
index 20f8c0ec6810..f644b131cc0b 100644
--- a/drivers/usb/host/ehci-exynos.c
+++ b/drivers/usb/host/ehci-exynos.c
@@ -173,8 +173,7 @@ static int exynos_ehci_probe(struct platform_device *pdev)
if (err)
goto fail_clk;
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- hcd->regs = devm_ioremap_resource(&pdev->dev, res);
+ hcd->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(hcd->regs)) {
err = PTR_ERR(hcd->regs);
goto fail_io;
--
2.39.0
^ permalink raw reply related [flat|nested] 39+ messages in thread* Re: [PATCH 29/30] usb: ehci-exynos: Use devm_platform_get_and_ioremap_resource()
2023-07-26 11:38 ` [PATCH 29/30] usb: ehci-exynos: " Yangtao Li
@ 2023-07-27 0:46 ` Andi Shyti
0 siblings, 0 replies; 39+ messages in thread
From: Andi Shyti @ 2023-07-27 0:46 UTC (permalink / raw)
To: Yangtao Li
Cc: Alan Stern, Greg Kroah-Hartman, Krzysztof Kozlowski, Alim Akhtar,
linux-usb, linux-arm-kernel, linux-samsung-soc, linux-kernel
Hi Yangtao,
On Wed, Jul 26, 2023 at 07:38:15PM +0800, Yangtao Li wrote:
> Convert platform_get_resource(), devm_ioremap_resource() to a single
> call to devm_platform_get_and_ioremap_resource(), as this is exactly
> what this function does.
>
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
Andi
^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH 30/30] usb: ohci-st: Use devm_platform_get_and_ioremap_resource()
2023-07-26 11:37 [PATCH 01/30] usb: ehci-npcm7xx: fix typo in npcm7xx_ehci_hcd_drv_probe() Yangtao Li
` (27 preceding siblings ...)
2023-07-26 11:38 ` [PATCH 29/30] usb: ehci-exynos: " Yangtao Li
@ 2023-07-26 11:38 ` Yangtao Li
2023-08-28 9:08 ` Patrice CHOTARD
28 siblings, 1 reply; 39+ messages in thread
From: Yangtao Li @ 2023-07-26 11:38 UTC (permalink / raw)
To: Alan Stern, Patrice Chotard, Greg Kroah-Hartman
Cc: Yangtao Li, linux-arm-kernel, linux-usb, linux-kernel
Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/usb/host/ohci-st.c | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/drivers/usb/host/ohci-st.c b/drivers/usb/host/ohci-st.c
index 884e447a8098..214342013f7e 100644
--- a/drivers/usb/host/ohci-st.c
+++ b/drivers/usb/host/ohci-st.c
@@ -139,12 +139,6 @@ static int st_ohci_platform_probe(struct platform_device *dev)
if (irq < 0)
return irq;
- res_mem = platform_get_resource(dev, IORESOURCE_MEM, 0);
- if (!res_mem) {
- dev_err(&dev->dev, "no memory resource provided");
- return -ENXIO;
- }
-
hcd = usb_create_hcd(&ohci_platform_hc_driver, &dev->dev,
dev_name(&dev->dev));
if (!hcd)
@@ -199,14 +193,14 @@ static int st_ohci_platform_probe(struct platform_device *dev)
goto err_power;
}
- hcd->rsrc_start = res_mem->start;
- hcd->rsrc_len = resource_size(res_mem);
-
- hcd->regs = devm_ioremap_resource(&dev->dev, res_mem);
+ hcd->regs = devm_platform_get_and_ioremap_resource(dev, 0, &res_mem);
if (IS_ERR(hcd->regs)) {
err = PTR_ERR(hcd->regs);
goto err_power;
}
+ hcd->rsrc_start = res_mem->start;
+ hcd->rsrc_len = resource_size(res_mem);
+
err = usb_add_hcd(hcd, irq, IRQF_SHARED);
if (err)
goto err_power;
--
2.39.0
^ permalink raw reply related [flat|nested] 39+ messages in thread* Re: [PATCH 30/30] usb: ohci-st: Use devm_platform_get_and_ioremap_resource()
2023-07-26 11:38 ` [PATCH 30/30] usb: ohci-st: " Yangtao Li
@ 2023-08-28 9:08 ` Patrice CHOTARD
0 siblings, 0 replies; 39+ messages in thread
From: Patrice CHOTARD @ 2023-08-28 9:08 UTC (permalink / raw)
To: Yangtao Li, Alan Stern, Greg Kroah-Hartman
Cc: linux-arm-kernel, linux-usb, linux-kernel
On 7/26/23 13:38, Yangtao Li wrote:
> Convert platform_get_resource(), devm_ioremap_resource() to a single
> call to devm_platform_get_and_ioremap_resource(), as this is exactly
> what this function does.
>
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
> ---
> drivers/usb/host/ohci-st.c | 14 ++++----------
> 1 file changed, 4 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/usb/host/ohci-st.c b/drivers/usb/host/ohci-st.c
> index 884e447a8098..214342013f7e 100644
> --- a/drivers/usb/host/ohci-st.c
> +++ b/drivers/usb/host/ohci-st.c
> @@ -139,12 +139,6 @@ static int st_ohci_platform_probe(struct platform_device *dev)
> if (irq < 0)
> return irq;
>
> - res_mem = platform_get_resource(dev, IORESOURCE_MEM, 0);
> - if (!res_mem) {
> - dev_err(&dev->dev, "no memory resource provided");
> - return -ENXIO;
> - }
> -
> hcd = usb_create_hcd(&ohci_platform_hc_driver, &dev->dev,
> dev_name(&dev->dev));
> if (!hcd)
> @@ -199,14 +193,14 @@ static int st_ohci_platform_probe(struct platform_device *dev)
> goto err_power;
> }
>
> - hcd->rsrc_start = res_mem->start;
> - hcd->rsrc_len = resource_size(res_mem);
> -
> - hcd->regs = devm_ioremap_resource(&dev->dev, res_mem);
> + hcd->regs = devm_platform_get_and_ioremap_resource(dev, 0, &res_mem);
> if (IS_ERR(hcd->regs)) {
> err = PTR_ERR(hcd->regs);
> goto err_power;
> }
> + hcd->rsrc_start = res_mem->start;
> + hcd->rsrc_len = resource_size(res_mem);
> +
> err = usb_add_hcd(hcd, irq, IRQF_SHARED);
> if (err)
> goto err_power;
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Thanks
Patrice
^ permalink raw reply [flat|nested] 39+ messages in thread