Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3867653ybb; Mon, 23 Mar 2020 09:08:38 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvZ3oHUO9xJcoVeLrrDKc/xNdWBYXjJzAwkbwPg7xIXz8CKSgSCI0uDB8TA+lQkn51X5Tqs X-Received: by 2002:aca:ef82:: with SMTP id n124mr19640oih.73.1584979718146; Mon, 23 Mar 2020 09:08:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584979718; cv=none; d=google.com; s=arc-20160816; b=S03NYXxHJhRTziW71ifoy8FqXh6qyenhRhA0KgQaxvJEQENZ3qKGXCkRQrcO+0Pmee T/ZG2MvK6aKvctpI5HnN4akddpfeHZZ6PKg0+WKWdE0WXceM1Hf9A0GMGgCzydTf3gyT lcJXcnXgMrQDGFZrwXxi8i28gNafs2Tv38L7jkrnYa3qTkUnUp6jORk0H/gRpTS1iL1Y /Fd2XNqACcR7y0jZsppkLMpNg/1ZEQPBifeRm8zRGb4Ij7ls1TEdWL6bl0e8a4GgESUg VjYq7FgOJaWf422lSO+BsN0D0IQArJnKolaeaP2gs+B2OKA4TaNQuK1eklzWke0pcGrv n15w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=uK1iorBXF9BB4oGseEqjv4lqsBJQT04CW0YTLmh51Gc=; b=HEYYbjhpj4OtmremNoxLcuHxTvdDAXgiUMRjomQKOL2bCW6hZg3r2iz1PJ7eaZAF43 jvHDN/27psKfutPhEUZ+nd1S33+bTa6OGDdFbFc0OP2myhbcAA9Mo5SjNOX+ICmyPPLc 1/qPOMXG1JB/qqthE2UHOiPiXYcSyVdLotqP8Obj6k0zGxAeyzNh+bpctxgjZaAiGXTh ik2G9xTFG/+KfNvc2B6JPa+i5XGbb7zGJxJTLEAlUPiIfjRxXATFcMAwE7Oc+Z2TbhFF 9gsrk6X5f5DzRTkIqAYvb+tSGjQTxnk1zSXPhoUGA3o/Buyeajz4Ur+5CHlXcHtvd4UN EQcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=enFns1JT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j206si8061587oia.158.2020.03.23.09.08.23; Mon, 23 Mar 2020 09:08:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=enFns1JT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727575AbgCWQG4 (ORCPT + 99 others); Mon, 23 Mar 2020 12:06:56 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:35887 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727282AbgCWQG4 (ORCPT ); Mon, 23 Mar 2020 12:06:56 -0400 Received: by mail-pg1-f196.google.com with SMTP id j29so534698pgl.3; Mon, 23 Mar 2020 09:06:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uK1iorBXF9BB4oGseEqjv4lqsBJQT04CW0YTLmh51Gc=; b=enFns1JTPAAQxePIF5XR/UkwY8Cc6ppWp3dRroiZAdFgisuXjzD/OwK6FCuu988wz1 a31lIJSe2W9hVqDk0SjUSyV778lcJE6Dl1tZ/wW7NLRcj15if/hViAQ80LrIj3C3WCTX zc+irBWnrZLZn/G5ZefV8FDCllViW7lE7QZghgAuUtj/KXzwV/CvSyTGZOPByI/NW2iC DkIFLKfoxRLyRZo+EboDkwgL43rYSaNFQcLUOqF+t6JF5QrQdIL3CHopXbCHcZxb/p8N EC1Ab3O2M8z54vDF2Ff4np/penjbARCtAlrPcK/BeWObWzyLcMAnmRBoUdnq8oXw0MEi 7Y5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uK1iorBXF9BB4oGseEqjv4lqsBJQT04CW0YTLmh51Gc=; b=rl+Uh2earBgboWUIGfEgpuVYD2ouR0w5IDcFbzrgvfm6zllU/d5BDZY3ConWGN79fA 1mCBP7iK6ik3MMOokh1u5YY+4HMW+WDqiFszpiSZb/Lnrxt/n1j8nFy61R98wXzS6gFN W6kv8nMAwHlkEj3AF4z6yQKUU30LDQODv0PgWrHn9J7WyT78C5TXRkJp+DwlrYF/bfpN nQay9waqDig8dfFRo6DCZlSSRVxi5qXwUzJdPhG/FqSmpycKgsOp5Uq86z+XPYAQigdv OovZ67+usgr+S5RZWbfuWDZD5JI4gav0P7rKjDRV2SB/U+XIzjinjLHVPSzXniRxLDQ9 fkZQ== X-Gm-Message-State: ANhLgQ0MrZor4fvR9y+8IkvkaR3O+M7TAFT+Yk4vAfSE4Yr+bbVn95qy 528d7hPdTWMyoyMBoOKOfvo= X-Received: by 2002:a63:5d04:: with SMTP id r4mr22463802pgb.241.1584979613571; Mon, 23 Mar 2020 09:06:53 -0700 (PDT) Received: from localhost (176.122.158.203.16clouds.com. [176.122.158.203]) by smtp.gmail.com with ESMTPSA id x190sm13510335pfb.96.2020.03.23.09.06.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Mar 2020 09:06:53 -0700 (PDT) From: Dejin Zheng To: gregkh@linuxfoundation.org, rafael@kernel.org, hminas@synopsys.com, mathias.nyman@intel.com, bgolaszewski@baylibre.com, arnd@arndb.de, geert+renesas@glider.be, tomas.winkler@intel.com, tglx@linutronix.de, hdegoede@redhat.com, treding@nvidia.com, suzuki.poulose@arm.com Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Dejin Zheng , Geert Uytterhoeven Subject: [PATCH v4 5/5] driver core: platform: Reimplement devm_platform_ioremap_resource Date: Tue, 24 Mar 2020 00:06:12 +0800 Message-Id: <20200323160612.17277-6-zhengdejin5@gmail.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200323160612.17277-1-zhengdejin5@gmail.com> References: <20200323160612.17277-1-zhengdejin5@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Reimplement devm_platform_ioremap_resource() by calling devm_platform_ioremap_and_get_resource() with res = NULL to simplify the code. Suggested-by: Geert Uytterhoeven Reviewed-by: Geert Uytterhoeven Signed-off-by: Dejin Zheng --- v3 -> v4: - modified this patch's commit comment. v2 -> v3: - add this patch to simplify the code by Geert's suggestion. drivers/base/platform.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 3e8a9fb91dcd..16b54ebc6958 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -95,10 +95,7 @@ EXPORT_SYMBOL_GPL(devm_platform_get_and_ioremap_resource); void __iomem *devm_platform_ioremap_resource(struct platform_device *pdev, unsigned int index) { - struct resource *res; - - res = platform_get_resource(pdev, IORESOURCE_MEM, index); - return devm_ioremap_resource(&pdev->dev, res); + return devm_platform_get_and_ioremap_resource(pdev, index, NULL); } EXPORT_SYMBOL_GPL(devm_platform_ioremap_resource); -- 2.25.0