Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp35072196rwd; Mon, 10 Jul 2023 02:03:07 -0700 (PDT) X-Google-Smtp-Source: APBJJlHMPLAEefBXaJttAeodbZ2yImRX2o2NDcKC3I5QfR4e8kszSK0LLRUyZOFYSHSDvvROfvcR X-Received: by 2002:a17:906:1001:b0:962:46d7:c8fc with SMTP id 1-20020a170906100100b0096246d7c8fcmr14420037ejm.21.1688979787496; Mon, 10 Jul 2023 02:03:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688979787; cv=none; d=google.com; s=arc-20160816; b=WcqU4GeTK3D1KWSYCFT5+GzF9nGgPXyVDQcGcCDfVulc3MDO0j9SksX86QsS9FF4XE nyuhpio8TYDHaeqljYlYshkDO1ADsjQNUZME/65omacOUH8m+kK3c77oDXO8PUnTsQZo pN/Mg2LGp6xGoSeASi+mQRS0YBaDqOI4Za4QJCn57mfTia0/zVVrjCwdh2YKa0cnuKs7 bP/liQFE75h9lxVKBwZ/P2IPwk+i+WRnA1DCEINaFfGJWSVOds2WBkGPisEyLD8rME9G CBRV3jDqhO+DQmVkoz7U7bfH9kvpnouLnYd3WXgqhFmnEYvllkO+5uJFozPOA1sF2a53 CDdQ== 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:dkim-signature; bh=IQ16LQQncl4oFt0203FbdLPkorgckydxUISAR8SSBbM=; fh=eLTIRFjPPHRg4BJpod2dWtXqLAWJ7jRVJMhxLmNXSlw=; b=0P4QkrZuqVFMxO1JGdDodd1bJ3QprERN59U+nfrZa7ycofVqDcJ9ZsZqnodi+B7hnE sPRPH6nHPWEIHu2n+xT3HfjjonFyfZPEY7LX/BGB9bGSA+lW+dXPBXK5EbddhXuCi/xy 0EYnd8AeoRIxBqOrK6gEfp7WYwV66DxW0eGaf82w7T6bN1BVseOdvbd3LmcaovAApFbk RqFRlMIRpB9l2MZ2XslGe4UWHVSTml91lk0fV+Q7QKQM+4dVG/KKqpUigdDIbp3Ab1W7 ehVYyy+aOvEQWwtMpD029s2OpayFGcCQ2ef5FbhFKRAllhNgMlNVyVd8NgJoktMCTUWz zlYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=PHJbx9Bh; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id rn6-20020a170906d92600b009930253bc63si9124539ejb.1024.2023.07.10.02.02.43; Mon, 10 Jul 2023 02:03:07 -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; dkim=pass header.i=@intel.com header.s=Intel header.b=PHJbx9Bh; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229940AbjGJIh6 (ORCPT + 99 others); Mon, 10 Jul 2023 04:37:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229751AbjGJIhv (ORCPT ); Mon, 10 Jul 2023 04:37:51 -0400 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F3CFC3; Mon, 10 Jul 2023 01:37:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1688978270; x=1720514270; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=taRbItooKPqksE9UGA1vfQS3CJR7SSXKhTeZ7I4oIyE=; b=PHJbx9BhKALdpKtbrjEJIRRa5eQoDINx/SnoWRRa80Ot58P3jYhklV5T 7qEIyi++h8Go6jjlv1GAz+mitA8mDtBdFrmTR4buLZfYQiKyu8/Th2dgr uwPDGLbqe9VVSQyKJDKnXoSS0VmuAGmXJjedTR0MJpMTNUDX4JSNEXcpl vE0gsG5DFaAVpHlaKwgJtZwSmzf1DtHrPgMly15wTFzMnB3nbQqRqsAua aqZsk0mWVMa0pe6gqex4SAWJ3HaigM3VOvx7gjhkVxaZLTpy9RqT3mFm1 pBjW/yNhpdjqGenvKi0doWkPfRdh4uMbZ2+OmsuD8YhMqm0cT5Y/OmuXN A==; X-IronPort-AV: E=McAfee;i="6600,9927,10766"; a="427980257" X-IronPort-AV: E=Sophos;i="6.01,194,1684825200"; d="scan'208";a="427980257" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jul 2023 01:37:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10766"; a="697930973" X-IronPort-AV: E=Sophos;i="6.01,194,1684825200"; d="scan'208";a="697930973" Received: from yilunxu-optiplex-7050.sh.intel.com (HELO localhost) ([10.239.159.165]) by orsmga006.jf.intel.com with ESMTP; 10 Jul 2023 01:37:47 -0700 Date: Mon, 10 Jul 2023 16:36:20 +0800 From: Xu Yilun To: Yangtao Li Cc: Moritz Fischer , Wu Hao , Tom Rix , linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 4/8] fpga: socfpga-a10: Convert to devm_platform_ioremap_resource() Message-ID: References: <20230705094655.44753-1-frank.li@vivo.com> <20230705094655.44753-4-frank.li@vivo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230705094655.44753-4-frank.li@vivo.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE,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 2023-07-05 at 17:46:51 +0800, Yangtao Li wrote: > Use devm_platform_ioremap_resource() to simplify code. > > Signed-off-by: Yangtao Li > --- > drivers/fpga/socfpga-a10.c | 9 +++------ > 1 file changed, 3 insertions(+), 6 deletions(-) > > diff --git a/drivers/fpga/socfpga-a10.c b/drivers/fpga/socfpga-a10.c > index ac8e89b8a5cc..b7b6e0bdb3d9 100644 > --- a/drivers/fpga/socfpga-a10.c > +++ b/drivers/fpga/socfpga-a10.c > @@ -471,7 +471,6 @@ static int socfpga_a10_fpga_probe(struct platform_device *pdev) > struct a10_fpga_priv *priv; > void __iomem *reg_base; > struct fpga_manager *mgr; > - struct resource *res; > int ret; > > priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); > @@ -479,14 +478,12 @@ static int socfpga_a10_fpga_probe(struct platform_device *pdev) > return -ENOMEM; > > /* First mmio base is for register access */ > - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > - reg_base = devm_ioremap_resource(dev, res); > + reg_base = devm_platform_ioremap_resource(pdev, 0); > if (IS_ERR(reg_base)) > return PTR_ERR(reg_base); > > /* Second mmio base is for writing FPGA image data */ > - res = platform_get_resource(pdev, IORESOURCE_MEM, 1); > - priv->fpga_data_addr = devm_ioremap_resource(dev, res); > + priv->fpga_data_addr = devm_platform_ioremap_resource(pdev, 1); > if (IS_ERR(priv->fpga_data_addr)) > return PTR_ERR(priv->fpga_data_addr); > > @@ -494,7 +491,7 @@ static int socfpga_a10_fpga_probe(struct platform_device *pdev) > priv->regmap = devm_regmap_init_mmio(dev, reg_base, > &socfpga_a10_fpga_regmap_config); > if (IS_ERR(priv->regmap)) > - return -ENODEV; > + return PTR_ERR(priv->regmap); It's good. But please seperate the patch and specify in changelog. > > priv->clk = devm_clk_get(dev, NULL); > if (IS_ERR(priv->clk)) { > -- > 2.39.0 >