Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1175881rwb; Wed, 26 Jul 2023 08:36:24 -0700 (PDT) X-Google-Smtp-Source: APBJJlEqR+48zyp9gx6I7Bzm4qbXpL5HLkLw8U2ApYAiB9fTpjsQwpkfRvdJiir1RaW9A91smnGQ X-Received: by 2002:a17:90a:a393:b0:262:e598:6046 with SMTP id x19-20020a17090aa39300b00262e5986046mr2332397pjp.28.1690385784279; Wed, 26 Jul 2023 08:36:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690385784; cv=none; d=google.com; s=arc-20160816; b=wB7fNxD7lW7nzbbAM4ekSI18iWFFHZwvLlguNalRjqj1wQs/B97jjY8qzT5TbWtpx/ bpefpsY1DbrcgVlHKjjhEKrCyr5X3h70m5VPDHzxgReIRP+Cl1PJTdBddvRFprTAP74Z CqV+jE1u8lP6J2fT10PQtPDAxLcltJU0sMAo7vkjiFyD/Lyz4SNhIaIIYHw3/NmKtjaW Gx4tGhoN9Ec9DHWX0tkYv4/5JBaoezQRYCFpph6fi/tvXtO7PKaNe96Pgd6dt2iE/DaR MoWZ0d0vd/V6RWmRf/0YtcKGUY/kAxq0p/Dkm8+FF798j3b2eV17FauD6mFpJp343/DS 7imA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=d7N7pGqctx0Zb9LL7uNU8231jon3LNmCpGZjJNnhq0s=; fh=dNsTFAT/hAqmNUa30hsRe98KQmr2svm1TfdQ+9QoAwU=; b=fsC4lDtqFQQbcfVDUcg8QMfdBveSRScG8LmekM5XmnWiqFxgwvMLKKbRre9NwKFnrR iMG8JFkyiucjTyXRWgvjmLTjGzk979Rnku/JJAYvd7GgO9fLOqOKkNIU5T+4Uc7TyRv2 XIk9xW3zmwL8ZARre4wi65n+B4skL11wj73fWNMHdb79/r/tfRCKoEpIKeoIUCOU88hB Q3nFCEIq08Sv9AHXvqKH0GUvBS1bRKuHaIQe8MLfZ/VX54QRNOrlCHQayGrZ2FGcojrz l1pOCaCgL6D4kn/jsqBJM48o3XHASOfVZhYJOOlFK3fiIQsDE2kOoxcg7AUZ/lZBt3TR 5i+g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=harvard.edu Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s23-20020a17090aad9700b0026803b4ddfcsi1253987pjq.103.2023.07.26.08.36.11; Wed, 26 Jul 2023 08:36:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=harvard.edu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233901AbjGZO1q (ORCPT + 99 others); Wed, 26 Jul 2023 10:27:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232253AbjGZO1p (ORCPT ); Wed, 26 Jul 2023 10:27:45 -0400 Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 7A5A810A for ; Wed, 26 Jul 2023 07:27:44 -0700 (PDT) Received: (qmail 1924318 invoked by uid 1000); 26 Jul 2023 10:27:43 -0400 Date: Wed, 26 Jul 2023 10:27:43 -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: <2ab38659-a25b-43a8-934a-5d44533a51c2@rowland.harvard.edu> References: <20230726113816.888-1-frank.li@vivo.com> <20230726113816.888-3-frank.li@vivo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230726113816.888-3-frank.li@vivo.com> X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Alan Stern