Message ID | 20230328062118.86336-1-yang.lee@linux.alibaba.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2012655vqo; Mon, 27 Mar 2023 23:43:22 -0700 (PDT) X-Google-Smtp-Source: AKy350ZZOOi4+3JbccVrVa2J1tLtzh6cWcDa1JTnHHPA6LBemhxIFqUVBXWJMBdTawCK8J9ZP1Gt X-Received: by 2002:a17:907:7246:b0:944:43e:7983 with SMTP id ds6-20020a170907724600b00944043e7983mr9514677ejc.67.1679985802555; Mon, 27 Mar 2023 23:43:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679985802; cv=none; d=google.com; s=arc-20160816; b=Kkpapm9uJH8fOJfAvGf4FYfXCJgqNMHo7Gf7O6am0DwGSaXQLxCYCxJw3wxwUrvIk5 hNZxIVfwQu673FPtgzgJc7//GW01qQ+2V4KUrJSPVtI5kUYk8zL6KzW9Urs8EoxgM0du cYw2T1TeYAadgnfOuemxPSsI8CKclZv7U3t5KETRtvQ0M81Vde/e/6X8LKPh7JTnVkVk Fz9OZLiY29zzFhfrz7q9S6XrY7vFqk5uSbpYrhYdt9tJUfi9/MJbZv/A/CRfLpN6CMLZ P5ijYPD0tuu0/b43zBx1n4Vgu17jCIpgeiTtAjN9SGQA+fzMAXtvap+384aygYdiLfUy 2TnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=AZTOx4CjGj41UK0bd0ybEPKWbw0qNdC3ZssamC3HYAE=; b=nDaj0w+NeTeAHNjHLdPVNUBmV4AjNapIlDB0va8Zsy1iHyK0EdIzJa4ua3VIvQ8Dqa qg4RKqEjknnNxoYCVQaSk+8uKTgwlfxAQPL8D6Wd86KhDDP5gW52ojQVkY/nRmTrTx9o jSfRjII9uE3nQn8dEJ/DjUo5O/CmMh/Fc7PWjlAOMQTHq3iKaQ6wmmDYq/bw+4EZFh99 lmGVzeyZn3++NRobPaiZ6AtuXMJTflmd1So6v8B125Y4BvVHFum4bLUGmQytr79Zr+X/ Ew4mY1Topt395txJ0A5S0gu9TqrArmSf7WrQp8JjGb5nTGIqL1gPmSfhTZ1+0blIeAwC wCGQ== 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=alibaba.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n25-20020a170906119900b00930f71275d5si24889482eja.941.2023.03.27.23.42.59; Mon, 27 Mar 2023 23:43:22 -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=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232806AbjC1GXP (ORCPT <rfc822;kartikey406@gmail.com> + 99 others); Tue, 28 Mar 2023 02:23:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232467AbjC1GW5 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 28 Mar 2023 02:22:57 -0400 Received: from out30-131.freemail.mail.aliyun.com (out30-131.freemail.mail.aliyun.com [115.124.30.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7F273A85; Mon, 27 Mar 2023 23:21:22 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R551e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046051;MF=yang.lee@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0Verz9vm_1679984479; Received: from localhost(mailfrom:yang.lee@linux.alibaba.com fp:SMTPD_---0Verz9vm_1679984479) by smtp.aliyun-inc.com; Tue, 28 Mar 2023 14:21:20 +0800 From: Yang Li <yang.lee@linux.alibaba.com> To: broonie@kernel.org Cc: heiko@sntech.de, linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Yang Li <yang.lee@linux.alibaba.com> Subject: [PATCH -next] spi: rockchip-sfc: Use devm_platform_get_and_ioremap_resource() Date: Tue, 28 Mar 2023 14:21:18 +0800 Message-Id: <20230328062118.86336-1-yang.lee@linux.alibaba.com> X-Mailer: git-send-email 2.20.1.7.g153144c MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.0 required=5.0 tests=ENV_AND_HDR_SPF_MATCH, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL autolearn=unavailable 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761592792786089521?= X-GMAIL-MSGID: =?utf-8?q?1761592792786089521?= |
Series |
[-next] spi: rockchip-sfc: Use devm_platform_get_and_ioremap_resource()
|
|
Commit Message
Yang Li
March 28, 2023, 6:21 a.m. UTC
According to commit 890cc39a8799 ("drivers: provide
devm_platform_get_and_ioremap_resource()"), 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: Yang Li <yang.lee@linux.alibaba.com>
---
drivers/spi/spi-rockchip-sfc.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
Comments
On 3/28/23 07:21, Yang Li wrote: > According to commit 890cc39a8799 ("drivers: provide > devm_platform_get_and_ioremap_resource()"), 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: Yang Li <yang.lee@linux.alibaba.com> > --- > drivers/spi/spi-rockchip-sfc.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) If I were you I would make a single patch addressing all the drivers from SPI as this is a single logical change. You get extra points as you avoid polluting the log. > > diff --git a/drivers/spi/spi-rockchip-sfc.c b/drivers/spi/spi-rockchip-sfc.c > index 4fabd2e0439f..6830ecaa270b 100644 > --- a/drivers/spi/spi-rockchip-sfc.c > +++ b/drivers/spi/spi-rockchip-sfc.c > @@ -576,8 +576,7 @@ static int rockchip_sfc_probe(struct platform_device *pdev) > sfc = spi_master_get_devdata(master); > sfc->dev = dev; > > - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > - sfc->regbase = devm_ioremap_resource(dev, res); > + sfc->regbase = devm_platform_get_and_ioremap_resource(pdev, 0, &res); No, you better use devm_platform_ioremap_resource() as res is not used afterwards. You'll get rid of the local variable too. > if (IS_ERR(sfc->regbase)) > return PTR_ERR(sfc->regbase); >
On 3/29/23 07:06, Yang.Lee wrote: > > From:Tudor Ambarus <tudor.ambarus@linaro.org> > Send Time:2023年3月28日(星期二) 23:16 >> If I were you I would make a single patch addressing all the drivers >> from SPI as this is a single logical change. You get extra points as you >> avoid polluting the log. > > First of all, thank you for pointing out this. > Because the maintainer list of each SPI driver file is not identical, I am worried about causing trouble for too many people, so I split it into multiple patches based on this. The change is trivial enough to don't bother at all. Here's an example: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=4b23603a251d24022f2fa48ee67610eb245a4115 > >> No, you better use devm_platform_ioremap_resource() as res is not used >> afterwards. You'll get rid of the local variable too. > > It's my bad, I will send a new version. > > Regards, > Yang Li >
On Wed, Mar 29, 2023 at 08:18:27AM +0100, Tudor Ambarus wrote: > On 3/29/23 07:06, Yang.Lee wrote: > > Because the maintainer list of each SPI driver file is not identical, I am worried about causing trouble for too many people, so I split it into multiple patches based on this. > The change is trivial enough to don't bother at all. Here's an example: > https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=4b23603a251d24022f2fa48ee67610eb245a4115 No, it's fine - it doesn't really get in the way and can be helpful to people doing backports.
diff --git a/drivers/spi/spi-rockchip-sfc.c b/drivers/spi/spi-rockchip-sfc.c index 4fabd2e0439f..6830ecaa270b 100644 --- a/drivers/spi/spi-rockchip-sfc.c +++ b/drivers/spi/spi-rockchip-sfc.c @@ -576,8 +576,7 @@ static int rockchip_sfc_probe(struct platform_device *pdev) sfc = spi_master_get_devdata(master); sfc->dev = dev; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - sfc->regbase = devm_ioremap_resource(dev, res); + sfc->regbase = devm_platform_get_and_ioremap_resource(pdev, 0, &res); if (IS_ERR(sfc->regbase)) return PTR_ERR(sfc->regbase);