Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp4424260rwr; Sun, 30 Apr 2023 07:07:58 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4+cBGIYIqB8PTbVCcW2zj5tdT91ef0VPhXy13xscSEVeES6igMIghgq6HhNBjdjSSmmbuc X-Received: by 2002:a05:6a20:42a2:b0:f2:15f7:a7f8 with SMTP id o34-20020a056a2042a200b000f215f7a7f8mr14494384pzj.2.1682863677905; Sun, 30 Apr 2023 07:07:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682863677; cv=none; d=google.com; s=arc-20160816; b=XNVyR6gB7SfmUAx3w1LZXSN7N+rI9ArRHR9ZTUjqsjAeLlEiEkgJtrw64eq8MpHTlY kop69jrZAuQt6ADNdELeAiv7brUvEjq3Pi5fd5aEv5WgvqHW2nUzRKxlqnzArwzkbom7 cm1TeNyoQ8eMDKrX4q+rKINkZ0sXermipC8OMo1Bsh/iNNDpyHwS1JHH8o70KVy4vxqg HFaURegjs5YYx6Ou+oziGHC1DwzLr/SODwPUJ7wUh+F/4ecqXEdsgz11vKmqbAuzucyg e2Tgb4/y0Ja6f72xGZAPNoctqIW733bkDXIfWodv78D1h1C5krFzkeLvhLcE4sXHDROc YlbA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=GNEKtGh7ADX3KWbrFMNuCx+KnJldxYTCBlnrZ0uFvGE=; b=i2cNyaGcheZ3y2rz3T1WFDvK/8h+x+KYIQz7l+VqZdjDyLd4Eu1nm0uwpQ/HpC6mDz CsXtA56kQCyquF7Q0YONhrQY6KBRMjKNF1yioaCKtbc9WI2n9izHf2gLL0HUAmOGlvun nEx8MGaKgpHRwO3OMsHiZpRTD0Wrn1k763XfdnX9kaDgJ6ZbabdRi9Ix5aGuwWzg/4c5 /F2QzfGGoHbRNCpzdbH7m4uOQsLijZn3bw+yG+Tcyav7ApoWb/lpx8Rgl/7W6W7k9SmR 7O+LEAx9ieT5usEGhR5KEM96tZC3YxxM4WdhlpiBhEQxIIZppQY7WLQxOQNxtgzmfUk9 hhfg== 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 lw1-20020a17090b180100b0024b60d77608si3813453pjb.30.2023.04.30.07.07.44; Sun, 30 Apr 2023 07:07:57 -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 S230287AbjD3MyV (ORCPT + 99 others); Sun, 30 Apr 2023 08:54:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229755AbjD3MyR (ORCPT ); Sun, 30 Apr 2023 08:54:17 -0400 Received: from hust.edu.cn (unknown [202.114.0.240]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F30B2D67; Sun, 30 Apr 2023 05:54:10 -0700 (PDT) Received: from ubuntu.localdomain ([10.12.172.67]) (user=saraday@hust.edu.cn mech=LOGIN bits=0) by mx1.hust.edu.cn with ESMTP id 33UCr6nY027403-33UCr6na027403 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Sun, 30 Apr 2023 20:53:26 +0800 From: Ziliang Liao To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Linus Walleij Cc: hust-os-kernel-patches@googlegroups.com, Ziliang Liao , Dongliang Mu , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] bus: qcom-ebi2: simplify the code in qcom_ebi2_probe() Date: Sun, 30 Apr 2023 20:51:54 +0800 Message-Id: <20230430125154.126863-2-saraday@hust.edu.cn> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230430125154.126863-1-saraday@hust.edu.cn> References: <20230430125154.126863-1-saraday@hust.edu.cn> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-FEAS-AUTH-USER: saraday@hust.edu.cn X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, 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 The code use platform_get_resource() and devm_ioremap_resource() to allocate memory resources for the device. It can be simplified by using devm_platform_ioremap_resource(). Fixes: 335a12754808 ("bus: qcom: add EBI2 driver") Signed-off-by: Ziliang Liao Reviewed-by: Dongliang Mu --- drivers/bus/qcom-ebi2.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/bus/qcom-ebi2.c b/drivers/bus/qcom-ebi2.c index 3999e969e1cf..bd419398d1c1 100644 --- a/drivers/bus/qcom-ebi2.c +++ b/drivers/bus/qcom-ebi2.c @@ -294,7 +294,6 @@ static int qcom_ebi2_probe(struct platform_device *pdev) struct device_node *np = pdev->dev.of_node; struct device_node *child; struct device *dev = &pdev->dev; - struct resource *res; void __iomem *ebi2_base; void __iomem *ebi2_xmem; struct clk *ebi2xclk; @@ -315,14 +314,12 @@ static int qcom_ebi2_probe(struct platform_device *pdev) return PTR_ERR(ebi2clk); } - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - ebi2_base = devm_ioremap_resource(dev, res); + ebi2_base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(ebi2_base)) { return PTR_ERR(ebi2_base); } - res = platform_get_resource(pdev, IORESOURCE_MEM, 1); - ebi2_xmem = devm_ioremap_resource(dev, res); + ebi2_xmem = devm_platform_ioremap_resource(pdev, 1); if (IS_ERR(ebi2_xmem)) { return PTR_ERR(ebi2_xmem); } -- 2.25.1