Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp31009904rwd; Thu, 6 Jul 2023 14:14:51 -0700 (PDT) X-Google-Smtp-Source: APBJJlFIyHB9J2pdiWnL9ILqsSAX3Skfu8PzSAzO06EERVw7KQfOBvVkjZHFFwoSVxuDHiN8Nkgu X-Received: by 2002:a05:6830:4c2:b0:6b8:8be0:b0b with SMTP id s2-20020a05683004c200b006b88be00b0bmr3077039otd.10.1688678090878; Thu, 06 Jul 2023 14:14:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688678090; cv=none; d=google.com; s=arc-20160816; b=tXW/JSWX9wDEHYqAX2n0va7uK4DLBjbQK3o3TBb+wSmxu3EeDFhewUvHjoMCfo/L7p MbT+XJ9l7i+r804reALaWtgCAER2FES8xxFJgTQQx25lWRGQm9UqBgqPBtw/iCBQwA+o 8T6R2VFqg8a59KyOhgYk0PMphdU8gLWxLaDNFc4SkuJfiZ6gOUKX5Ni50wyG0nlMVmvb 88PSeYA2FxGqDPC7PSE/D9WP6gQUJSaLo7qedA6RCJBwQH1Ae8sEa8zl/1+8bLrplGXx XJRKUQD/o709tNwcM8jhW0T89j6OayIIPPaXhrOPpbny9gp2odcBcHHzHyMh0sMJCkll hs7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject; bh=ICtCiddM3eP6dkCOwKYAbf0jSASXughEls7XY/Aw/gc=; fh=NxK186UNMJ4+KgXNOJvB6qlYAw6Uw3TUVrdKR9pYHfU=; b=KLci73+hxhPr3f9NPojF0bHANzaF7DBxUb0kM/ozaAxyEEsP+kKR4AZjXXqwnVNl22 9IPTFiA1XEQAkaLEvdQpPfzB+3vMwDxBemWB9VNrdzlqHxX5LPPhNGR4zUcuCOs/cD61 CiRCe7iNVmIAEAGfc5Y7+WtfjizI/x0xci1DfO0vgzwSdoGh9mB4MLPAhGVKLVQ3zSbD wwM7ss72wgxrtRd6hC6/4zhocJNaPi+5fX5s1gB1JW94c2j1fU0CiMLinEVqtUxVJulR X4T9i4nmyFYVEOZBOZYtxavrUFtD0f/0ujpwQPitHEJhfYcdekW67N5hujLYdP1Pk0u7 RMNA== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b7-20020a656687000000b0055bd8c2b3bdsi2253494pgw.153.2023.07.06.14.14.38; Thu, 06 Jul 2023 14:14:50 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232163AbjGFVLC (ORCPT + 99 others); Thu, 6 Jul 2023 17:11:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231820AbjGFVKj (ORCPT ); Thu, 6 Jul 2023 17:10:39 -0400 Received: from mx01.omp.ru (mx01.omp.ru [90.154.21.10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E9C619A7; Thu, 6 Jul 2023 14:10:38 -0700 (PDT) Received: from [192.168.1.103] (178.176.74.43) by msexch01.omp.ru (10.188.4.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.986.14; Fri, 7 Jul 2023 00:10:31 +0300 Subject: Re: [PATCH 5/8] ata: sata_rcar: Convert to devm_platform_ioremap_resource() To: Yangtao Li , Damien Le Moal CC: , , References: <20230706124239.23366-1-frank.li@vivo.com> <20230706124239.23366-5-frank.li@vivo.com> From: Sergey Shtylyov Organization: Open Mobile Platform Message-ID: <845da26d-0369-ba58-fb53-d37e6eac39a3@omp.ru> Date: Fri, 7 Jul 2023 00:10:30 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20230706124239.23366-5-frank.li@vivo.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [178.176.74.43] X-ClientProxiedBy: msexch01.omp.ru (10.188.4.12) To msexch01.omp.ru (10.188.4.12) X-KSE-ServerInfo: msexch01.omp.ru, 9 X-KSE-AntiSpam-Interceptor-Info: scan successful X-KSE-AntiSpam-Version: 5.9.59, Database issued on: 07/06/2023 20:37:23 X-KSE-AntiSpam-Status: KAS_STATUS_NOT_DETECTED X-KSE-AntiSpam-Method: none X-KSE-AntiSpam-Rate: 59 X-KSE-AntiSpam-Info: Lua profiles 178485 [Jul 06 2023] X-KSE-AntiSpam-Info: Version: 5.9.59.0 X-KSE-AntiSpam-Info: Envelope from: s.shtylyov@omp.ru X-KSE-AntiSpam-Info: LuaCore: 520 520 ccb018a655251011855942a2571029252d3d69a2 X-KSE-AntiSpam-Info: {rep_avail} X-KSE-AntiSpam-Info: {Tracking_uf_ne_domains} X-KSE-AntiSpam-Info: {Tracking_from_domain_doesnt_match_to} X-KSE-AntiSpam-Info: {relay has no DNS name} X-KSE-AntiSpam-Info: {SMTP from is not routable} X-KSE-AntiSpam-Info: {Found in DNSBL: 178.176.74.43 in (user) b.barracudacentral.org} X-KSE-AntiSpam-Info: {Found in DNSBL: 178.176.74.43 in (user) dbl.spamhaus.org} X-KSE-AntiSpam-Info: 178.176.74.43:7.7.3,7.1.2,7.4.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;omp.ru:7.1.1;127.0.0.199:7.1.2;git.kernel.org:7.1.1 X-KSE-AntiSpam-Info: {iprep_blacklist} X-KSE-AntiSpam-Info: ApMailHostAddress: 178.176.74.43 X-KSE-AntiSpam-Info: {DNS response errors} X-KSE-AntiSpam-Info: Rate: 59 X-KSE-AntiSpam-Info: Status: not_detected X-KSE-AntiSpam-Info: Method: none X-KSE-AntiSpam-Info: Auth:dmarc=temperror header.from=omp.ru;spf=temperror smtp.mailfrom=omp.ru;dkim=none X-KSE-Antiphishing-Info: Clean X-KSE-Antiphishing-ScanningType: Heuristic X-KSE-Antiphishing-Method: None X-KSE-Antiphishing-Bases: 07/06/2023 20:41:00 X-KSE-Antivirus-Interceptor-Info: scan successful X-KSE-Antivirus-Info: Clean, bases: 7/6/2023 6:28:00 PM X-KSE-Attachment-Filter-Triggered-Rules: Clean X-KSE-Attachment-Filter-Triggered-Filters: Clean X-KSE-BulkMessagesFiltering-Scan-Result: InTheLimit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 7/6/23 3:42 PM, Yangtao Li wrote: > Use devm_platform_ioremap_resource() to simplify code. > > Signed-off-by: Yangtao Li > --- > drivers/ata/sata_rcar.c | 9 ++------- > 1 file changed, 2 insertions(+), 7 deletions(-) > > diff --git a/drivers/ata/sata_rcar.c b/drivers/ata/sata_rcar.c > index 34790f15c1b8..63f8337c2a98 100644 > --- a/drivers/ata/sata_rcar.c > +++ b/drivers/ata/sata_rcar.c > @@ -861,15 +861,11 @@ static int sata_rcar_probe(struct platform_device *pdev) > struct device *dev = &pdev->dev; > struct ata_host *host; > struct sata_rcar_priv *priv; > - struct resource *mem; > - int irq; > - int ret = 0; > + int irq, ret; This unneeded init of ret should be in a separate patch. > > irq = platform_get_irq(pdev, 0); > if (irq < 0) > return irq; > - if (!irq) > - return -EINVAL; This is a separate issue too. I thought I've removed this myself but apparently not, the commit [1] took shamefully long time to merge... :-( [...] > @@ -890,8 +886,7 @@ static int sata_rcar_probe(struct platform_device *pdev) > > host->private_data = priv; > > - mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); > - priv->base = devm_ioremap_resource(dev, mem); > + priv->base = devm_platform_ioremap_resource(pdev, 0); > if (IS_ERR(priv->base)) { > ret = PTR_ERR(priv->base); > goto err_pm_put; The (documented) change looks OK. [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ce753ad1549cbe9ccaea4c06a1f5fa47432c8289 MBR, Seregy