All of lore.kernel.org
 help / color / mirror / Atom feed
From: srinivas.kandagatla@linaro.org
To: gregkh@linuxfoundation.org
Cc: linux-kernel@vger.kernel.org, srinivas.kandagatla@linaro.org,
	Andrey Smirnov <andrew.smirnov@gmail.com>,
	Heiko Stuebner <heiko@sntech.de>,
	Masahiro Yamada <yamada.masahiro@socionext.com>,
	Carlo Caione <carlo@caione.org>,
	Kevin Hilman <khilman@baylibre.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	cphealy@gmail.com, linux-mediatek@lists.infradead.org,
	linux-rockchip@lists.infradead.org,
	linux-amlogic@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH 07/25] nvmem: snvs_lgpr: Convert to use devm_nvmem_register()
Date: Fri,  9 Mar 2018 14:47:01 +0000	[thread overview]
Message-ID: <20180309144719.29904-8-srinivas.kandagatla@linaro.org> (raw)
In-Reply-To: <20180309144719.29904-1-srinivas.kandagatla@linaro.org>

From: Andrey Smirnov <andrew.smirnov@gmail.com>

Drop all of the code related to .remove hook and make use of
devm_nvmem_register() instead.

Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Heiko Stuebner <heiko@sntech.de>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Carlo Caione <carlo@caione.org>
Cc: Kevin Hilman <khilman@baylibre.com>
Cc: Matthias Brugger <matthias.bgg@gmail.com>
Cc: cphealy@gmail.com
Cc: linux-kernel@vger.kernel.org
Cc: linux-mediatek@lists.infradead.org
Cc: linux-rockchip@lists.infradead.org
Cc: linux-amlogic@lists.infradead.org
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 drivers/nvmem/snvs_lpgpr.c | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

diff --git a/drivers/nvmem/snvs_lpgpr.c b/drivers/nvmem/snvs_lpgpr.c
index e5c2a4a17f03..cb471d5e8e86 100644
--- a/drivers/nvmem/snvs_lpgpr.c
+++ b/drivers/nvmem/snvs_lpgpr.c
@@ -117,20 +117,9 @@ static int snvs_lpgpr_probe(struct platform_device *pdev)
 	cfg->reg_read  = snvs_lpgpr_read,
 	cfg->reg_write = snvs_lpgpr_write,
 
-	nvmem = nvmem_register(cfg);
-	if (IS_ERR(nvmem))
-		return PTR_ERR(nvmem);
+	nvmem = devm_nvmem_register(dev, cfg);
 
-	platform_set_drvdata(pdev, nvmem);
-
-	return 0;
-}
-
-static int snvs_lpgpr_remove(struct platform_device *pdev)
-{
-	struct nvmem_device *nvmem = platform_get_drvdata(pdev);
-
-	return nvmem_unregister(nvmem);
+	return PTR_ERR_OR_ZERO(nvmem);
 }
 
 static const struct of_device_id snvs_lpgpr_dt_ids[] = {
@@ -143,7 +132,6 @@ MODULE_DEVICE_TABLE(of, snvs_lpgpr_dt_ids);
 
 static struct platform_driver snvs_lpgpr_driver = {
 	.probe	= snvs_lpgpr_probe,
-	.remove	= snvs_lpgpr_remove,
 	.driver = {
 		.name	= "snvs_lpgpr",
 		.of_match_table = snvs_lpgpr_dt_ids,
-- 
2.15.1

WARNING: multiple messages have this Message-ID
From: srinivas.kandagatla@linaro.org (srinivas.kandagatla at linaro.org)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 07/25] nvmem: snvs_lgpr: Convert to use devm_nvmem_register()
Date: Fri,  9 Mar 2018 14:47:01 +0000	[thread overview]
Message-ID: <20180309144719.29904-8-srinivas.kandagatla@linaro.org> (raw)
In-Reply-To: <20180309144719.29904-1-srinivas.kandagatla@linaro.org>

From: Andrey Smirnov <andrew.smirnov@gmail.com>

Drop all of the code related to .remove hook and make use of
devm_nvmem_register() instead.

Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Heiko Stuebner <heiko@sntech.de>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Carlo Caione <carlo@caione.org>
Cc: Kevin Hilman <khilman@baylibre.com>
Cc: Matthias Brugger <matthias.bgg@gmail.com>
Cc: cphealy at gmail.com
Cc: linux-kernel at vger.kernel.org
Cc: linux-mediatek at lists.infradead.org
Cc: linux-rockchip at lists.infradead.org
Cc: linux-amlogic at lists.infradead.org
Cc: linux-arm-kernel at lists.infradead.org
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 drivers/nvmem/snvs_lpgpr.c | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

diff --git a/drivers/nvmem/snvs_lpgpr.c b/drivers/nvmem/snvs_lpgpr.c
index e5c2a4a17f03..cb471d5e8e86 100644
--- a/drivers/nvmem/snvs_lpgpr.c
+++ b/drivers/nvmem/snvs_lpgpr.c
@@ -117,20 +117,9 @@ static int snvs_lpgpr_probe(struct platform_device *pdev)
 	cfg->reg_read  = snvs_lpgpr_read,
 	cfg->reg_write = snvs_lpgpr_write,
 
-	nvmem = nvmem_register(cfg);
-	if (IS_ERR(nvmem))
-		return PTR_ERR(nvmem);
+	nvmem = devm_nvmem_register(dev, cfg);
 
-	platform_set_drvdata(pdev, nvmem);
-
-	return 0;
-}
-
-static int snvs_lpgpr_remove(struct platform_device *pdev)
-{
-	struct nvmem_device *nvmem = platform_get_drvdata(pdev);
-
-	return nvmem_unregister(nvmem);
+	return PTR_ERR_OR_ZERO(nvmem);
 }
 
 static const struct of_device_id snvs_lpgpr_dt_ids[] = {
@@ -143,7 +132,6 @@ MODULE_DEVICE_TABLE(of, snvs_lpgpr_dt_ids);
 
 static struct platform_driver snvs_lpgpr_driver = {
 	.probe	= snvs_lpgpr_probe,
-	.remove	= snvs_lpgpr_remove,
 	.driver = {
 		.name	= "snvs_lpgpr",
 		.of_match_table = snvs_lpgpr_dt_ids,
-- 
2.15.1

WARNING: multiple messages have this Message-ID
From: srinivas.kandagatla@linaro.org (srinivas.kandagatla at linaro.org)
To: linus-amlogic@lists.infradead.org
Subject: [PATCH 07/25] nvmem: snvs_lgpr: Convert to use devm_nvmem_register()
Date: Fri,  9 Mar 2018 14:47:01 +0000	[thread overview]
Message-ID: <20180309144719.29904-8-srinivas.kandagatla@linaro.org> (raw)
In-Reply-To: <20180309144719.29904-1-srinivas.kandagatla@linaro.org>

From: Andrey Smirnov <andrew.smirnov@gmail.com>

Drop all of the code related to .remove hook and make use of
devm_nvmem_register() instead.

Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Heiko Stuebner <heiko@sntech.de>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Carlo Caione <carlo@caione.org>
Cc: Kevin Hilman <khilman@baylibre.com>
Cc: Matthias Brugger <matthias.bgg@gmail.com>
Cc: cphealy at gmail.com
Cc: linux-kernel at vger.kernel.org
Cc: linux-mediatek at lists.infradead.org
Cc: linux-rockchip at lists.infradead.org
Cc: linux-amlogic at lists.infradead.org
Cc: linux-arm-kernel at lists.infradead.org
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 drivers/nvmem/snvs_lpgpr.c | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

diff --git a/drivers/nvmem/snvs_lpgpr.c b/drivers/nvmem/snvs_lpgpr.c
index e5c2a4a17f03..cb471d5e8e86 100644
--- a/drivers/nvmem/snvs_lpgpr.c
+++ b/drivers/nvmem/snvs_lpgpr.c
@@ -117,20 +117,9 @@ static int snvs_lpgpr_probe(struct platform_device *pdev)
 	cfg->reg_read  = snvs_lpgpr_read,
 	cfg->reg_write = snvs_lpgpr_write,
 
-	nvmem = nvmem_register(cfg);
-	if (IS_ERR(nvmem))
-		return PTR_ERR(nvmem);
+	nvmem = devm_nvmem_register(dev, cfg);
 
-	platform_set_drvdata(pdev, nvmem);
-
-	return 0;
-}
-
-static int snvs_lpgpr_remove(struct platform_device *pdev)
-{
-	struct nvmem_device *nvmem = platform_get_drvdata(pdev);
-
-	return nvmem_unregister(nvmem);
+	return PTR_ERR_OR_ZERO(nvmem);
 }
 
 static const struct of_device_id snvs_lpgpr_dt_ids[] = {
@@ -143,7 +132,6 @@ MODULE_DEVICE_TABLE(of, snvs_lpgpr_dt_ids);
 
 static struct platform_driver snvs_lpgpr_driver = {
 	.probe	= snvs_lpgpr_probe,
-	.remove	= snvs_lpgpr_remove,
 	.driver = {
 		.name	= "snvs_lpgpr",
 		.of_match_table = snvs_lpgpr_dt_ids,
-- 
2.15.1

  parent reply	other threads:[~2018-03-09 14:47 UTC|newest]

Thread overview: 73+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-09 14:46 [PATCH 00/25] nvmem: patches for v4.17 srinivas.kandagatla
2018-03-09 14:46 ` [PATCH 01/25] nvmem: Document struct nvmem_config srinivas.kandagatla
2018-03-09 14:46   ` srinivas.kandagatla at linaro.org
2018-03-09 14:46   ` srinivas.kandagatla at linaro.org
2018-03-09 14:46   ` srinivas.kandagatla-QSEj5FYQhm4dnm+yROfE0A
2018-03-09 14:46 ` [PATCH 02/25] nvmem: core: Allow specifying device name verbatim srinivas.kandagatla
2018-03-09 14:46   ` srinivas.kandagatla at linaro.org
2018-03-09 14:46   ` srinivas.kandagatla at linaro.org
2018-03-09 14:46   ` srinivas.kandagatla-QSEj5FYQhm4dnm+yROfE0A
2018-03-09 14:46 ` [PATCH 03/25] nvmem: Introduce devm_nvmem_(un)register() srinivas.kandagatla
2018-03-09 14:46   ` srinivas.kandagatla at linaro.org
2018-03-09 14:46   ` srinivas.kandagatla at linaro.org
2018-03-09 14:46   ` srinivas.kandagatla-QSEj5FYQhm4dnm+yROfE0A
2018-03-09 14:46 ` [PATCH 04/25] nvmem: vf610-ocotp: Convert to use devm_nvmem_register() srinivas.kandagatla
2018-03-09 14:46   ` srinivas.kandagatla at linaro.org
2018-03-09 14:46   ` srinivas.kandagatla at linaro.org
2018-03-09 14:46   ` srinivas.kandagatla-QSEj5FYQhm4dnm+yROfE0A
2018-03-09 14:46 ` [PATCH 05/25] nvmem: imx-ocotp: " srinivas.kandagatla
2018-03-09 14:46   ` srinivas.kandagatla at linaro.org
2018-03-09 14:46   ` srinivas.kandagatla at linaro.org
2018-03-09 14:46   ` srinivas.kandagatla
2018-03-09 14:47 ` [PATCH 06/25] nvmem: uniphier-efuse: " srinivas.kandagatla
2018-03-09 14:47   ` srinivas.kandagatla at linaro.org
2018-03-09 14:47   ` srinivas.kandagatla at linaro.org
2018-03-09 14:47 ` srinivas.kandagatla [this message]
2018-03-09 14:47   ` [PATCH 07/25] nvmem: snvs_lgpr: " srinivas.kandagatla at linaro.org
2018-03-09 14:47   ` srinivas.kandagatla at linaro.org
2018-03-09 14:47 ` [PATCH 08/25] nvmem: rockchip-efuse: " srinivas.kandagatla
2018-03-09 14:47   ` srinivas.kandagatla at linaro.org
2018-03-09 14:47   ` srinivas.kandagatla at linaro.org
2018-03-09 14:47 ` [PATCH 09/25] nvmem: mtk-efuse: " srinivas.kandagatla
2018-03-09 14:47   ` srinivas.kandagatla at linaro.org
2018-03-09 14:47   ` srinivas.kandagatla at linaro.org
2018-03-09 14:47 ` [PATCH 10/25] nvmem: meson-mx-efuse: " srinivas.kandagatla
2018-03-09 14:47   ` srinivas.kandagatla at linaro.org
2018-03-09 14:47   ` srinivas.kandagatla at linaro.org
2018-03-09 14:47 ` [PATCH 11/25] nvmem: meson-efuse: " srinivas.kandagatla
2018-03-09 14:47   ` srinivas.kandagatla at linaro.org
2018-03-09 14:47   ` srinivas.kandagatla at linaro.org
2018-03-09 14:47 ` [PATCH 12/25] nvmem: lpc18xx_otp: " srinivas.kandagatla
2018-03-09 14:47   ` srinivas.kandagatla at linaro.org
2018-03-09 14:47   ` srinivas.kandagatla at linaro.org
2018-03-09 14:47 ` [PATCH 13/25] nvmem: imx-iim: " srinivas.kandagatla
2018-03-09 14:47   ` srinivas.kandagatla at linaro.org
2018-03-09 14:47   ` srinivas.kandagatla at linaro.org
2018-03-09 14:47 ` [PATCH 14/25] nvmem: bcm-ocotp: " srinivas.kandagatla
2018-03-09 14:47   ` srinivas.kandagatla at linaro.org
2018-03-09 14:47   ` srinivas.kandagatla at linaro.org
2018-03-09 14:47 ` [PATCH 15/25] nvmem: qfprom: " srinivas.kandagatla
2018-03-09 14:47   ` srinivas.kandagatla at linaro.org
2018-03-09 14:47   ` srinivas.kandagatla at linaro.org
2018-03-09 14:47 ` [PATCH 16/25] nvmem: snvs_lpgpr: Convert commas to semicolons srinivas.kandagatla
2018-03-09 14:47   ` srinivas.kandagatla at linaro.org
2018-03-09 14:47   ` srinivas.kandagatla at linaro.org
2018-03-09 14:47 ` [PATCH 17/25] nvmem: rockchip-efuse: Make use of of_device_get_match_data() srinivas.kandagatla
2018-03-09 14:47   ` srinivas.kandagatla at linaro.org
2018-03-09 14:47   ` srinivas.kandagatla at linaro.org
2018-03-09 14:47 ` [PATCH 18/25] nvmem: vf610-ocotp: Do not use "&pdev->dev" explicitly srinivas.kandagatla
2018-03-09 14:47   ` srinivas.kandagatla at linaro.org
2018-03-09 14:47   ` srinivas.kandagatla at linaro.org
2018-03-09 14:47 ` [PATCH 19/25] nvmem: rockchip-efuse: " srinivas.kandagatla
2018-03-09 14:47   ` srinivas.kandagatla at linaro.org
2018-03-09 14:47   ` srinivas.kandagatla at linaro.org
2018-03-09 14:47 ` [PATCH 20/25] nvmem: imx-iim: " srinivas.kandagatla
2018-03-09 14:47   ` srinivas.kandagatla at linaro.org
2018-03-09 14:47   ` srinivas.kandagatla at linaro.org
2018-03-09 14:47 ` [PATCH 21/25] nvmem: bcm-ocotp: " srinivas.kandagatla
2018-03-09 14:47   ` srinivas.kandagatla at linaro.org
2018-03-09 14:47   ` srinivas.kandagatla at linaro.org
2018-03-09 14:47 ` [PATCH 22/25] nvmem: add i.MX7 support to snvs-lpgpr srinivas.kandagatla
2018-03-09 14:47 ` [PATCH 23/25] nvmem: sunxi-sid: fix H3 SID controller support srinivas.kandagatla
2018-03-09 14:47 ` [PATCH 24/25] dt-bindings: nvmem: imx-ocotp: update the binding to reflect data cells srinivas.kandagatla
2018-03-09 14:47 ` [PATCH 25/25] nvmem: imx-ocotp: remove unused dead code srinivas.kandagatla

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180309144719.29904-8-srinivas.kandagatla@linaro.org \
    --to=srinivas.kandagatla@linaro.org \
    --cc=andrew.smirnov@gmail.com \
    --cc=carlo@caione.org \
    --cc=cphealy@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=heiko@sntech.de \
    --cc=khilman@baylibre.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=yamada.masahiro@socionext.com \
    --subject='Re: [PATCH 07/25] nvmem: snvs_lgpr: Convert to use devm_nvmem_register()' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.