From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D3DEC001B0 for ; Wed, 26 Jul 2023 14:29:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233881AbjGZO3d (ORCPT ); Wed, 26 Jul 2023 10:29:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233628AbjGZO3a (ORCPT ); Wed, 26 Jul 2023 10:29:30 -0400 Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 6490B1BF2 for ; Wed, 26 Jul 2023 07:29:29 -0700 (PDT) Received: (qmail 1924383 invoked by uid 1000); 26 Jul 2023 10:29:28 -0400 Date: Wed, 26 Jul 2023 10:29:28 -0400 From: Alan Stern To: Yangtao Li Cc: Greg Kroah-Hartman , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 03/30] usb: ohci-at91: Use devm_platform_get_and_ioremap_resource() Message-ID: References: <20230726113816.888-1-frank.li@vivo.com> <20230726113816.888-3-frank.li@vivo.com> <2ab38659-a25b-43a8-934a-5d44533a51c2@rowland.harvard.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2ab38659-a25b-43a8-934a-5d44533a51c2@rowland.harvard.edu> Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org 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 > > --- > > 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 Alan Stern