From patchwork Tue Dec 10 20:31:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yangtao Li X-Patchwork-Id: 11283217 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A9304138C for ; Tue, 10 Dec 2019 20:32:12 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6FF4A2077B for ; Tue, 10 Dec 2019 20:32:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="exk7IJRq"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="U47CDhuz" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6FF4A2077B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=1UyDkzrPY882IXpPFX+A74/qw0akDkBH+BwaMfKVSzU=; b=exk 7IJRqfv5DMEH/+S9EVEC+z7XAyrECYab+yyWcu+KOu3mGP9gVnBpGLKfuP7cRJIa7zwGilmsotOtQ 6jHYw16LbZI5aFZVy+xw1uKOv6QJYSyhhFAekVfSosQCq8IP1cU9mhj6bzHjF1mvVICihtagZXafS xBz5ddJDTVjx3TLjMSv5NWJdwAm+GV0cBFXtcMG7ceUHVjr4aOzPPI0212rBldBvaSRn4Nacy6joZ q7O9YWE4yseK7j29AAcHrrgn5fqHcWo+1jrqyMAVqyuqEdgT5zw4sGEFr96CkfQRSzLvPWqjTwRlO V4vB7uW2GIV1TIII+4cJbszRwKs9c8g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iemB1-00015G-1g; Tue, 10 Dec 2019 20:32:11 +0000 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iemAn-0000ta-Rb; Tue, 10 Dec 2019 20:31:59 +0000 Received: by mail-pg1-x542.google.com with SMTP id a33so9218051pgm.5; Tue, 10 Dec 2019 12:31:57 -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; bh=AXdgRPOupq8mpOVW9fDaoE7i0os1nP349i6MmUYJbLw=; b=U47CDhuz0r/IRPYg0nOXL/3oQEygnoHNuYbU416HhjOKsXQBiAh+ym1mFxz/CLQKm5 PAVLw4SDABvaWmZ6bDTz999xnkwov7EtfUtskkLSFlFlTOTXZ48HnONY5r+XacqxAKbd e4orxhyQU+VQR1rtMO9s9kf40rm/F46gVN2XfWisUUBCx5FZAv2/cKL9APa/XGbuMcLj YrBY7CV0GV3tSsguNm5eZkG6axi5HxyKGuXGYLQtKtZxVp4Hx/n7cWGME6g5Zwul9k3A zU0r7xiXBLYg6HK48jJ/YaRswjyf0ppp2QCqkioiri5++NRLEcL34BqwDMkr+uoLZ7GT AM9A== 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; bh=AXdgRPOupq8mpOVW9fDaoE7i0os1nP349i6MmUYJbLw=; b=GFJuPZVJdi48d7erIo6zqz2+b6hnisVvaa5S14gaK/gAzFWcwAJMWWHH5CMddxzDce Dw7OzkhbQWMXrXTPfHzESos0uQETjl1OXXCCEYPvI1Xm0Xao2NNitMKRm3y3LwdlrLee lmshSwAJFRDEtTDhSsFCa7mQy1J6S6+jY2bmDww9jzhxx1LQOGXMvWZCQlRhtMVshOqM UPc4bitK3IwCWsrp5au7lRKzJkwt+q3kLO2F3DF34RqQu5CyyzPQnQrbPVwSqjMibbsE YWOUzCiRF4FuIBNpQuAL6FctuE2FnKpFXK7pYBb0bWT8z5JcQbHBTbtp7ZzGMqEJ+5RI 6okQ== X-Gm-Message-State: APjAAAVcmRQ87H//0j3wRembLlEJ+sccF9uk8qymMkECo1HbBWUzZQ7B HmQLPW2TxX39pjKI34phYNc= X-Google-Smtp-Source: APXvYqxPRg90G2e3ms8KufWeN+ZC2r3Ex2vY+OO9rQ98PC7ykiMNV67F2VhmRn+uvjDiPQaOrmxL8A== X-Received: by 2002:aa7:8b55:: with SMTP id i21mr37408207pfd.249.1576009916862; Tue, 10 Dec 2019 12:31:56 -0800 (PST) Received: from localhost ([2001:19f0:6001:12c8:5400:2ff:fe72:6403]) by smtp.gmail.com with ESMTPSA id b21sm4604086pfp.0.2019.12.10.12.31.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2019 12:31:56 -0800 (PST) From: Yangtao Li To: gregkh@linuxfoundation.org, rafael@kernel.org, srinivas.kandagatla@linaro.org, vz@mleia.com, khilman@baylibre.com, mripard@kernel.org, wens@csie.org, andriy.shevchenko@linux.intel.com, mchehab+samsung@kernel.org, mans@mansr.com, treding@nvidia.com, suzuki.poulose@arm.com, bgolaszewski@baylibre.com, tglx@linutronix.de Subject: [PATCH] drivers: add devm_platform_ioremap_resource_byname() helper Date: Tue, 10 Dec 2019 20:31:45 +0000 Message-Id: <20191210203149.7115-1-tiny.windzz@gmail.com> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191210_123157_916789_39086291 X-CRM114-Status: UNSURE ( 9.71 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:542 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (tiny.windzz[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Yangtao Li , linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org There are currently 300+ instances of using platform_get_resource_byname() and devm_ioremap_resource() together in the kernel tree. This patch wraps these two calls in a single helper. Signed-off-by: Yangtao Li --- drivers/base/platform.c | 22 +++++++++++++++++++++- include/linux/platform_device.h | 3 +++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/drivers/base/platform.c b/drivers/base/platform.c index b6c6c7d97d5b..9c4f5e229600 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -60,6 +60,7 @@ struct resource *platform_get_resource(struct platform_device *dev, } EXPORT_SYMBOL_GPL(platform_get_resource); +#ifdef CONFIG_HAS_IOMEM /** * devm_platform_ioremap_resource - call devm_ioremap_resource() for a platform * device @@ -68,7 +69,7 @@ EXPORT_SYMBOL_GPL(platform_get_resource); * resource management * @index: resource index */ -#ifdef CONFIG_HAS_IOMEM + void __iomem *devm_platform_ioremap_resource(struct platform_device *pdev, unsigned int index) { @@ -78,6 +79,25 @@ void __iomem *devm_platform_ioremap_resource(struct platform_device *pdev, return devm_ioremap_resource(&pdev->dev, res); } EXPORT_SYMBOL_GPL(devm_platform_ioremap_resource); + +/** + * devm_platform_ioremap_resource_byname - call devm_ioremap_resource() for + * a platform device + * + * @pdev: platform device to use both for memory resource lookup as well as + * resource managemend + * @name: resource name + */ +void __iomem * +devm_platform_ioremap_resource_byname(struct platform_device *pdev, + const char *name) +{ + struct resource *res; + + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, name); + return devm_ioremap_resource(&pdev->dev, res); +} +EXPORT_SYMBOL_GPL(devm_platform_ioremap_resource_byname); #endif /* CONFIG_HAS_IOMEM */ static int __platform_get_irq(struct platform_device *dev, unsigned int num) diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index 1b5cec067533..24ff5da9c532 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h @@ -63,6 +63,9 @@ extern int platform_irq_count(struct platform_device *); extern struct resource *platform_get_resource_byname(struct platform_device *, unsigned int, const char *); +extern void __iomem * +devm_platform_ioremap_resource_byname(struct platform_device *pdev, + const char *name); extern int platform_get_irq_byname(struct platform_device *, const char *); extern int platform_add_devices(struct platform_device **, int); From patchwork Tue Dec 10 20:31:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yangtao Li X-Patchwork-Id: 11283225 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AF196138C for ; Tue, 10 Dec 2019 20:32:45 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8C8A920652 for ; Tue, 10 Dec 2019 20:32:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="N2STqbBI"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="rmsu+hX/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8C8A920652 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=fVy5lLB8KD4Fe2qIVz4UblrNiP7n0paRXJcDXy0rJZo=; b=N2STqbBIuTM4LtDhnDGbYMvWMJ RuNxEi0v7Ooo628KdZunziAouKa+a/8JDKXI0/KNNXwmlAARV+tMyWRBNw1bhUMl1oFZk79dti9yX dUpMZnp1Xm2bSosMRBa6sTyPrsn7qT25EmKce7rl4xbZpAmB7G67dqckdze0l4i5lI66kTLgvmxJJ OCFY6aR0v8GCzU7xuU3MfzkFWGzmJJtgCiIzMLeWQCzoyHh1DiatEyG5TTlkdCFXOdlaFxscNBsv+ o01AjwxIlUA6d+W4fZ6/0PfBvdKl6dmwWcloClHgDgOWD+acC267eS+G7ZfHj16i9X8beZoSMNVkQ 5Q01m4pw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iemBY-0001ho-Hc; Tue, 10 Dec 2019 20:32:44 +0000 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iemAr-0000ug-4Y; Tue, 10 Dec 2019 20:32:02 +0000 Received: by mail-pf1-x444.google.com with SMTP id n13so412219pff.1; Tue, 10 Dec 2019 12:32:01 -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=DeuPvEztiSd7kwjPtC2mIn2agkbYJRYt91C1Dr0gXE0=; b=rmsu+hX/vtvPaWJCq4ljOZUIP/cy9yN52b7v/ouD0Lh2irVI2MBDIZc4axiNpaklzQ tA4uM7Hz+jvc7llrhG/UZDyK2O4vTkMOHK9T9ozJVuIRkIWV6BXQW2iMJN0JYpihdN0A ee1mgMWjdlolzMH+VSdLEwHtep8kltmatJWWXItL6j0HaW4qSR3pdbd2mG64hiCRKR50 UbSD1PcRFjjokwgE9nqeytHDcxtwWdPgmE48NLJ/eL0mvM5KAF8bYHGRyjU1CFU5NAao X9mp6hnQO3YF3o9T7rRrJTlUpDUYPUX1JvFF8IRJz80gwH7TfaBaI2tVJOkaSAke3u+7 BD6g== 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=DeuPvEztiSd7kwjPtC2mIn2agkbYJRYt91C1Dr0gXE0=; b=cabTn/tfcdsnI4lBcxG/RsZPz4YS8WBKa4h1QwnQsD61Yr++sY2cgyKo7k30PBXbEt poPcT6yl/6buKywBmAziQ6fKbrh8YvZVct3ykOq5y34XvG2JWTb0tf6CCs9owQWb+EkI kNi3vp7lhtdfNjWTVqCc8AG2c7Rw7aGdgyiZ88CQB+rS+yCZRetJ2EhWJWYByJCST20p 0dn1+TMPL48Utv2lrW8HDjaxpX0BiiPjCCcHSPbcXOOffh8hQL8VNq9MrB/Iwwbd5zNI P6Pk0W8QDsmypYJGF5thzeAS8qR4DV02N42Zw6pyMa3gTmgwhwN4jTlJ7Sld42z2d7JX m1BA== X-Gm-Message-State: APjAAAU5lFop5vnjRUuAApccear3UJ7878kJIUSb3yAX7Kmk/MVm+uWw vJLg4kt7xEnsvDv3WynIn4Q= X-Google-Smtp-Source: APXvYqw7AoFbBg2zwdq2kcqlhEL98Zy/ORPpibsdgJWtVjsbOp7kvJtHC0tBmKZiEZAgIMFoZm00rg== X-Received: by 2002:a63:c207:: with SMTP id b7mr26754619pgd.422.1576009920632; Tue, 10 Dec 2019 12:32:00 -0800 (PST) Received: from localhost ([2001:19f0:6001:12c8:5400:2ff:fe72:6403]) by smtp.gmail.com with ESMTPSA id gc1sm3621984pjb.20.2019.12.10.12.31.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2019 12:32:00 -0800 (PST) From: Yangtao Li To: gregkh@linuxfoundation.org, rafael@kernel.org, srinivas.kandagatla@linaro.org, vz@mleia.com, khilman@baylibre.com, mripard@kernel.org, wens@csie.org, andriy.shevchenko@linux.intel.com, mchehab+samsung@kernel.org, mans@mansr.com, treding@nvidia.com, suzuki.poulose@arm.com, bgolaszewski@baylibre.com, tglx@linutronix.de Subject: [PATCH 2/5] nvmem: lpc18xx_otp: convert to devm_platform_ioremap_resource Date: Tue, 10 Dec 2019 20:31:47 +0000 Message-Id: <20191210203149.7115-3-tiny.windzz@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191210203149.7115-1-tiny.windzz@gmail.com> References: <20191210203149.7115-1-tiny.windzz@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191210_123201_222786_E1346ED4 X-CRM114-Status: UNSURE ( 9.95 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:444 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (tiny.windzz[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Yangtao Li , linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li --- drivers/nvmem/lpc18xx_otp.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/nvmem/lpc18xx_otp.c b/drivers/nvmem/lpc18xx_otp.c index 16c92ea85d49..8faed05e3cbe 100644 --- a/drivers/nvmem/lpc18xx_otp.c +++ b/drivers/nvmem/lpc18xx_otp.c @@ -68,14 +68,12 @@ static int lpc18xx_otp_probe(struct platform_device *pdev) { struct nvmem_device *nvmem; struct lpc18xx_otp *otp; - struct resource *res; otp = devm_kzalloc(&pdev->dev, sizeof(*otp), GFP_KERNEL); if (!otp) return -ENOMEM; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - otp->base = devm_ioremap_resource(&pdev->dev, res); + otp->base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(otp->base)) return PTR_ERR(otp->base); From patchwork Tue Dec 10 20:31:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yangtao Li X-Patchwork-Id: 11283229 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1A0A7112B for ; Tue, 10 Dec 2019 20:33:00 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BD95520652 for ; Tue, 10 Dec 2019 20:32:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="KTaTrQtu"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gZQzknzI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BD95520652 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=Pt8crEHMFcWLZEV07O75/IoHhAU+V/IWPh0zqt4oqrw=; b=KTaTrQtu29TmmWNYHZRAbUXjzl eo006QwiJqBdRyjD4x4uVp5d+mjZJuV07WMHlinX3XidTFmePuI9Rn5wZumnErwBS+GZDlncDlYD4 xMYzkgge6tX+lDH1V96EMz7bD5EsleRbvo0pfmmdJDysnyGvmo7EC8od5Q6JlItNbet3QtY01GYnB m8I2YH1+7KegzBexStxBRYUlVu2fh2deEy51nfEH0NjVBNZoiw75bxPxKR6L9ZQSB+uIbpQszz0L1 HNIW1Dy62QztmAkNppwpF/OSZ8EbX1m3FTlw5hlXKE9k8NpTUy50lfaWIUWLahEMfI65sAx5bKsvw 3yU4yhhw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iemBn-0001xy-6l; Tue, 10 Dec 2019 20:32:59 +0000 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iemAt-0000wO-DN; Tue, 10 Dec 2019 20:32:04 +0000 Received: by mail-pg1-x544.google.com with SMTP id r11so9450267pgf.1; Tue, 10 Dec 2019 12:32:03 -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=aJjh4TX7tIu5i+rCa4IwoPtzkcCu3DVe+AmQ4LsjGFE=; b=gZQzknzIqIApPvJCk1iRFQHzHlvudGFa4DkvphsH88qXsxvVZFHlomcdllkrTb27YN yUfG0AmPrk+30Tye1b5PugmQGyqJDdZqm3lInbKWgQX0ckY6j4kr0krsu9Sl+YtCGg/8 Nl+mstS5YXfIlY74w+zEx6qGpzpz7tvHYtDiS5u0zk8wCbvCfswNmZzCnOAYUspw0DFb nOGUg6vMezl4ZafiDAMU8aAp8EhiyG/vR6ux/mAJbnxQ4Q/8lawY52cvRwL9tyuy6sHO EVDGTQC6kfmIBDfqJbS2sL1+9nuGYq+/3zmIy5OROU2Io97zdmX1ImU/BeTwYp5FZRtK RSxA== 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=aJjh4TX7tIu5i+rCa4IwoPtzkcCu3DVe+AmQ4LsjGFE=; b=OoJ7In8v6IOqgksc+IrHIVadUdDq4vu/2OLTb6FdBkPagPbSh0+Gy1BkYT5OBI89N1 ab0Nwj6ilzyCDs5JUVMlJEqHfPSwgCoHTYYBVDD7z2PIJ+fMnmKmd3h2Ie+gVmFfYQvY SkdobELFtULZhy7RTJeKoI6WtckUH3h6pH8f8a/Ob6t5N4AOkXwQ/IKj/krfmuHx1xL4 lM4bUpCwWR09NoliEIcBiYpiL1qPkFpWZNGbvrzjbqEs6aCbqzkwaz64sDtDsJ+hBBp0 XEJUo4s5D1OHKy+ZDQsYpfs+C6aYTuGsIs36ccvaA9Q6UCjymfM27uaRr6RJUeWP9OAo RvEg== X-Gm-Message-State: APjAAAWt9kkwljc97+Px2ApEc31v+s8z8OViSX3PIt9b9PAxrFHkxS9q 9BGEQLjsMb3luAgrF8xWhH4= X-Google-Smtp-Source: APXvYqy9wb5VG/J8/gfbuJhrl2x731RJNVx5EKN7oDXSF1O1sSK9iEaSoweWjC42n/RNrAITMDlheg== X-Received: by 2002:a63:4d1b:: with SMTP id a27mr17289782pgb.352.1576009922481; Tue, 10 Dec 2019 12:32:02 -0800 (PST) Received: from localhost ([2001:19f0:6001:12c8:5400:2ff:fe72:6403]) by smtp.gmail.com with ESMTPSA id w6sm4839677pfq.99.2019.12.10.12.32.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2019 12:32:01 -0800 (PST) From: Yangtao Li To: gregkh@linuxfoundation.org, rafael@kernel.org, srinivas.kandagatla@linaro.org, vz@mleia.com, khilman@baylibre.com, mripard@kernel.org, wens@csie.org, andriy.shevchenko@linux.intel.com, mchehab+samsung@kernel.org, mans@mansr.com, treding@nvidia.com, suzuki.poulose@arm.com, bgolaszewski@baylibre.com, tglx@linutronix.de Subject: [PATCH 3/5] nvmem: meson-mx-efuse: convert to devm_platform_ioremap_resource Date: Tue, 10 Dec 2019 20:31:48 +0000 Message-Id: <20191210203149.7115-4-tiny.windzz@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191210203149.7115-1-tiny.windzz@gmail.com> References: <20191210203149.7115-1-tiny.windzz@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191210_123203_473905_72DBB297 X-CRM114-Status: GOOD ( 10.25 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:544 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (tiny.windzz[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Yangtao Li , linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li Reviewed-by: Martin Blumenstingl --- drivers/nvmem/meson-mx-efuse.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/nvmem/meson-mx-efuse.c b/drivers/nvmem/meson-mx-efuse.c index 07c9f38c1c60..24c6e8b15987 100644 --- a/drivers/nvmem/meson-mx-efuse.c +++ b/drivers/nvmem/meson-mx-efuse.c @@ -194,7 +194,6 @@ static int meson_mx_efuse_probe(struct platform_device *pdev) { const struct meson_mx_efuse_platform_data *drvdata; struct meson_mx_efuse *efuse; - struct resource *res; drvdata = of_device_get_match_data(&pdev->dev); if (!drvdata) @@ -204,8 +203,7 @@ static int meson_mx_efuse_probe(struct platform_device *pdev) if (!efuse) return -ENOMEM; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - efuse->base = devm_ioremap_resource(&pdev->dev, res); + efuse->base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(efuse->base)) return PTR_ERR(efuse->base); From patchwork Tue Dec 10 20:31:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yangtao Li X-Patchwork-Id: 11283233 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 48368138C for ; Tue, 10 Dec 2019 20:33:14 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1AA5120652 for ; Tue, 10 Dec 2019 20:33:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="RuJqp8YF"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SBWiep0Y" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1AA5120652 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=c9epYK8Nhd4DHf6iQOil5hppEDCHeSmORUmJEnidoC4=; b=RuJqp8YFTOw2lb4KeztqnnOi+4 7mNsuh7V/LpSz22jnK3ShgMey1tXb6Hb7UKLKM4QnEoTA50TZ+CeboOM8A3A1OonVU8mBF5M00LIb fFeewcOCKdncBSN3xNuOcJ/8MpqGzSSg/t5QAfrer0vED+yguPdoHb34SVhfY7XCtuj3eV+sFFdyk qZTPrn1wofdQNGrSWk4cnk69/a8Id9GT6nvtLN6hqrZi8nhGvGfSDZ13ZE0iI/LRG6EK+dYQQXvHp RgW/s/fVh0HAknGa2lq6ZKHsgJpYyF6vF6oiO+cO4vPi+fpnlBvLZRJ1GjIrUE2E+TB/3b6SKyKIj WfKZ9l9g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iemC0-0002Gs-TU; Tue, 10 Dec 2019 20:33:12 +0000 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iemAu-0000yU-UY; Tue, 10 Dec 2019 20:32:06 +0000 Received: by mail-pg1-x542.google.com with SMTP id a33so9218225pgm.5; Tue, 10 Dec 2019 12:32:04 -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=YFx2eeL+mMfvTTf1lfSUrY023GFsFEPvhm+wP8s61nE=; b=SBWiep0YvtZPWNzdZjLGonPbi9n/uBVRyUymQTVSTLhY9kWFbpUUomQ2NP+HJpHC6Y wn4KC5VcDJwJtEzcVIHxzfaTaz5BuaEiap31NcVRZ2Q6ELoAdUwy+XFshLt5l6/bkjHU zFmIfX4GM+CVFaavy5frhpYe8RYvztIsU1v+U2C4XrKmEtcHlzN4FcoYwSZTSo3J5qXU gdLgGKY7AMQams6+9gyArIEcDwvX7l31ejau5nY9vokwSY5QblStrk7OsKRSWVTVEypD RMTg2Bupob+7C/0kxZ6PN1pPd1/a9EW+TKfzMm6QwDr+nGt2vSADC5vGP7B94+AgwYhz 80DQ== 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=YFx2eeL+mMfvTTf1lfSUrY023GFsFEPvhm+wP8s61nE=; b=IlZskxcsgom91oWzI1qHKDRTvboDDmB+HSwahSn/2Uaj4UJE+bIkEMZzCTCOXeI7YF EaSV2Ssk19/VfgIvtmD1kL21ShW1jiv75red1A3TS30kBaW/0qjL3HM8YXhMmJyORjwG 9Rwx4rtIJLnfC00os0ZUJdc2CaAkBdcU2mkAzRjjlnS+Lls3u0GwMXWE+UdgdzINH3xE wqjKEjrmJ8SdE412ncvZgtLvtVcsYL1OPvqjZpL7Z6SCBypvcaieEm17wbIrH0Zf1S4T +vVulu1IStAMN7r+GnqcEaDcXalJvDb+cl1AG6VvxHc0u8jEQ3wp+yMpYvidEq/+nYgS UAXg== X-Gm-Message-State: APjAAAXlehPfi3nAdvRvDAqqOSZr+4DNHcL3idbcwE42+QjgacNJuJTi 77SZbTBWAzq4IvOHgT8wDNY= X-Google-Smtp-Source: APXvYqz0RhGoHF4qhZt0cmp90qwcWKRuRuKFQWCZVCoKkL/hxwYPB5yhwE3N4YwcmAmyN923ReuvJw== X-Received: by 2002:a62:ed0b:: with SMTP id u11mr36347939pfh.46.1576009924303; Tue, 10 Dec 2019 12:32:04 -0800 (PST) Received: from localhost ([2001:19f0:6001:12c8:5400:2ff:fe72:6403]) by smtp.gmail.com with ESMTPSA id l14sm2360727pgt.42.2019.12.10.12.32.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2019 12:32:03 -0800 (PST) From: Yangtao Li To: gregkh@linuxfoundation.org, rafael@kernel.org, srinivas.kandagatla@linaro.org, vz@mleia.com, khilman@baylibre.com, mripard@kernel.org, wens@csie.org, andriy.shevchenko@linux.intel.com, mchehab+samsung@kernel.org, mans@mansr.com, treding@nvidia.com, suzuki.poulose@arm.com, bgolaszewski@baylibre.com, tglx@linutronix.de Subject: [PATCH 4/5] nvmem: bcm-ocotp: convert to devm_platform_ioremap_resource Date: Tue, 10 Dec 2019 20:31:49 +0000 Message-Id: <20191210203149.7115-5-tiny.windzz@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191210203149.7115-1-tiny.windzz@gmail.com> References: <20191210203149.7115-1-tiny.windzz@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191210_123205_016100_B8E24E63 X-CRM114-Status: GOOD ( 10.69 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:542 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (tiny.windzz[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Yangtao Li , linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li --- drivers/nvmem/bcm-ocotp.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/nvmem/bcm-ocotp.c b/drivers/nvmem/bcm-ocotp.c index a8097511582a..87b7198a7676 100644 --- a/drivers/nvmem/bcm-ocotp.c +++ b/drivers/nvmem/bcm-ocotp.c @@ -254,7 +254,6 @@ MODULE_DEVICE_TABLE(acpi, bcm_otpc_acpi_ids); static int bcm_otpc_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; - struct resource *res; struct otpc_priv *priv; struct nvmem_device *nvmem; int err; @@ -269,8 +268,7 @@ static int bcm_otpc_probe(struct platform_device *pdev) return -ENODEV; /* Get OTP base address register. */ - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - priv->base = devm_ioremap_resource(dev, res); + priv->base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(priv->base)) { dev_err(dev, "unable to map I/O memory\n"); return PTR_ERR(priv->base);