Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp13013633ybl; Sun, 29 Dec 2019 02:46:09 -0800 (PST) X-Google-Smtp-Source: APXvYqyi4oPomEGwwnoOI1eYqPlKMmuzeIRwjNozuw1sYHLzdwR0iUwr+qk7WK5YQ3j5/K+TBo1Y X-Received: by 2002:a9d:748d:: with SMTP id t13mr65600123otk.181.1577616369905; Sun, 29 Dec 2019 02:46:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577616369; cv=none; d=google.com; s=arc-20160816; b=H1Z56T6blMOzLHRQBJOovNuqAVvBFevooFW+u/sPqPap0l5X6XUUWhSo6P9susse8/ vD4lFqug6oZos1YCd5J7+Da41m4GOAe2jpyo4C4Uu4FoB5lhWJP5apQyjI3H/FZfZwAv r++KtvnayqmEknkI3TKYSSrGBDFe0I0tBXvQX1VGKs0jJNGd9WnYNNPvG3pS1GX1utjj a0BWEMr8bmwE1xgUZ/9xZphq/CFKBrLNoZPUBTIvLuc+0fiXY0rKlvooh8Yb3v6GQ+tz fVNRmT/tGnL2cW04S+RfqmChEXUu3TI7Qzv+VJ4qlfC81ZDmtFfKFRX0rEYUZDJ4UNaQ J1wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=7DhzWBS5UwZiGHnoV8xDhDhB0j8GNMpnSRjHD30dKiE=; b=UAPlBe1OHoY6ueWxisE2pFaV0R+VR94FArPh9exbQi9+RLusUbAeWpSXvJcGVq9z7o qGr/sqBdYGi5Z/+rfghJR/1j+XXXH+8i2ZNsXOhHWh9067VI0oAslUSdfFgtu885N3OQ Vw9N1KoaTCiFRxrA5JKSKcLleRXCXYM28s6vkm+xLo44tdkXO+hcrvne4kpncgSJJHMB 4gaDtEFqtHCHp+pocQ27lRbmIEsT8YwJDBGIIf9KjPPvfmrQeY/HEHu/ZXznB5VY5WfS 4oyddgCSnjudk5nsUJmOh+bWq36Jryv9t05YQvSj2KPmtvCzIofngtt/fsFahFp1l+vF IP3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=sszXrU01; 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 i25si19239892oii.259.2019.12.29.02.45.41; Sun, 29 Dec 2019 02:46:09 -0800 (PST) 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=sszXrU01; 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 S1726602AbfL2Knd (ORCPT + 99 others); Sun, 29 Dec 2019 05:43:33 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:44191 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726476AbfL2Knc (ORCPT ); Sun, 29 Dec 2019 05:43:32 -0500 Received: by mail-pg1-f195.google.com with SMTP id x7so16703420pgl.11; Sun, 29 Dec 2019 02:43:32 -0800 (PST) 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; bh=7DhzWBS5UwZiGHnoV8xDhDhB0j8GNMpnSRjHD30dKiE=; b=sszXrU01FkjSQNPJF1nqy/MQQXF7rxTjkbovF2bmOpxYKb8r7VpoBgjRlQmd1364L7 jb5j1mDM9sUPOlU4ypGG5BrARsRWlzjo2QT2F8sjeS08tNLeSi/p/4FV4ALcdE4ink8F O8FyWnbW7XxO9v0qNNu3V2BvEQSeZ9LcQKR2TmpTVRk7BkVHnV634WHLIr3qnVeYGV4M ZQfonQdiI6JxjEQi1uweWguvdiZoyj0mcoCU+eVLkoP/3nMrB6OtpEqNDgqmarv/PEVL 0fnZaQ4mCIwzHtxVLnpXiSFyJ7vjvsN3flzXqPteO+2dccj9ZjqMiQGyl6UXamLzIzWM DHfQ== 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; bh=7DhzWBS5UwZiGHnoV8xDhDhB0j8GNMpnSRjHD30dKiE=; b=FoV5tcCLqCp8FET8XhbHxvyY+j3tI+HKisIiKQqsOOINQ6Rr1NcwonB/E4dd0uDgxr GJaJupgFqdF8eY5HMG+M0InMUwzLgVsDkbRjKtd32OM3/clcHoi1l4ZtbFPOYJiZhfuH 7yKvodLUqB7TnX0mzIW4JTxSfLOdm/Zn6AjnoN0xsp1PSF25hNfcuBBLN1pWbJdUnJ6a 3foBlAx1doipZFFumvN8ObWdM8NlRoS8xcunmK8OmWLQkwD/w8J0QrO68mVWoGQuCago fYZ1lPzLvfmXGam1en3ptQBZgwHGxTlBh/qaWcQ7M3NxsRmoUIDofw7S5khGMhDifjaT GWqQ== X-Gm-Message-State: APjAAAVaUb2IHkFaEJ1CQ0IrBww3fj8VFs+ZcR8QbHqbQPuOmFsFlcNm 4u9pb3+hb1bQIGh5B/ym/hw= X-Received: by 2002:a65:4344:: with SMTP id k4mr64812391pgq.193.1577616211982; Sun, 29 Dec 2019 02:43:31 -0800 (PST) Received: from localhost ([2001:19f0:6001:12c8:5400:2ff:fe72:6403]) by smtp.gmail.com with ESMTPSA id p16sm43147484pgi.50.2019.12.29.02.43.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 29 Dec 2019 02:43:31 -0800 (PST) From: Yangtao Li To: corbet@lwn.net, gregkh@linuxfoundation.org, bgolaszewski@baylibre.com, arnd@arndb.de, sboyd@kernel.org, mchehab+samsung@kernel.org, matti.vaittinen@fi.rohmeurope.com, phil.edworthy@renesas.com, suzuki.poulose@arm.com, saravanak@google.com, heikki.krogerus@linux.intel.com, dan.j.williams@intel.com, joe@perches.com, jeffrey.t.kirsher@intel.com, mans@mansr.com, tglx@linutronix.de, hdegoede@redhat.com, akpm@linux-foundation.org, ulf.hansson@linaro.org, ztuowen@gmail.com, sergei.shtylyov@cogentembedded.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Yangtao Li Subject: [PATCH 2/2] drivers: platform: provide devm_platform_ioremap_resource_nocache() Date: Sun, 29 Dec 2019 10:43:25 +0000 Message-Id: <20191229104325.10132-3-tiny.windzz@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191229104325.10132-1-tiny.windzz@gmail.com> References: <20191229104325.10132-1-tiny.windzz@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Provide a nocache variant of devm_platform_ioremap_resource(). Signed-off-by: Yangtao Li --- .../driver-api/driver-model/devres.rst | 1 + drivers/base/platform.c | 19 +++++++++++++++++++ include/linux/platform_device.h | 3 +++ 3 files changed, 23 insertions(+) diff --git a/Documentation/driver-api/driver-model/devres.rst b/Documentation/driver-api/driver-model/devres.rst index af1b1b9e3a17..3b79a3207490 100644 --- a/Documentation/driver-api/driver-model/devres.rst +++ b/Documentation/driver-api/driver-model/devres.rst @@ -320,6 +320,7 @@ IOMAP devm_ioremap_resource_nocache() devm_ioremap_resource_wc() devm_platform_ioremap_resource() : calls devm_ioremap_resource() for platform device + devm_platform_ioremap_resource_nocache() devm_platform_ioremap_resource_wc() devm_platform_ioremap_resource_byname() devm_iounmap() diff --git a/drivers/base/platform.c b/drivers/base/platform.c index cf6b6b722e5c..80f420b9b4d7 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -79,6 +79,25 @@ void __iomem *devm_platform_ioremap_resource(struct platform_device *pdev, } EXPORT_SYMBOL_GPL(devm_platform_ioremap_resource); +/** + * devm_platform_ioremap_resource_nocache - nocache variant of + * devm_platform_ioremap_resource() + * + * @pdev: platform device to use both for memory resource lookup as well as + * resource management + * @index: resource index + */ +void __iomem * +devm_platform_ioremap_resource_nocache(struct platform_device *pdev, + unsigned int index) +{ + struct resource *res; + + res = platform_get_resource(pdev, IORESOURCE_MEM, index); + return devm_ioremap_resource_nocache(&pdev->dev, res); +} +EXPORT_SYMBOL_GPL(devm_platform_ioremap_resource_nocache); + /** * devm_platform_ioremap_resource_wc - write-combined variant of * devm_platform_ioremap_resource() diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index 276a03c24691..b803e670b1c5 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h @@ -58,6 +58,9 @@ extern void __iomem * devm_platform_ioremap_resource(struct platform_device *pdev, unsigned int index); extern void __iomem * +devm_platform_ioremap_resource_nocache(struct platform_device *pdev, + unsigned int index); +extern void __iomem * devm_platform_ioremap_resource_wc(struct platform_device *pdev, unsigned int index); extern void __iomem * -- 2.17.1