From: Patrice CHOTARD <patrice.chotard@foss.st.com>
To: Yangtao Li <frank.li@vivo.com>,
Alan Stern <stern@rowland.harvard.edu>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: <linux-usb@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 28/30] usb: ehci-st: Use devm_platform_get_and_ioremap_resource()
Date: Mon, 28 Aug 2023 11:08:35 +0200 [thread overview]
Message-ID: <c54227f2-9bba-c4bb-baf9-0530b4a644bd@foss.st.com> (raw)
In-Reply-To: <20230726113816.888-28-frank.li@vivo.com>
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
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-08-28 9:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20230726113816.888-1-frank.li@vivo.com>
[not found] ` <20230726113816.888-29-frank.li@vivo.com>
2023-07-27 0:46 ` [PATCH 29/30] usb: ehci-exynos: Use devm_platform_get_and_ioremap_resource() Andi Shyti
[not found] ` <20230726113816.888-8-frank.li@vivo.com>
2023-07-27 5:34 ` [PATCH 08/30] usb: gadget/atmel_usba_udc: " claudiu beznea
2023-07-27 12:20 ` Cristian.Birsan
[not found] ` <20230726113816.888-10-frank.li@vivo.com>
2023-07-27 5:35 ` [PATCH 10/30] usb: ehci-atmel: " claudiu beznea
[not found] ` <20230726113816.888-4-frank.li@vivo.com>
2023-07-27 5:35 ` [PATCH 04/30] usb: ohci-at91: Remove redundant msg at probe time claudiu beznea
[not found] ` <20230726113816.888-28-frank.li@vivo.com>
2023-08-28 9:08 ` Patrice CHOTARD [this message]
[not found] ` <20230726113816.888-30-frank.li@vivo.com>
2023-08-28 9:08 ` [PATCH 30/30] usb: ohci-st: Use devm_platform_get_and_ioremap_resource() Patrice CHOTARD
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c54227f2-9bba-c4bb-baf9-0530b4a644bd@foss.st.com \
--to=patrice.chotard@foss.st.com \
--cc=frank.li@vivo.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox