From: andrew.smirnov@gmail.com (Andrey Smirnov)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 16/20] nvmem: rockchip-efuse: Make use of of_device_get_match_data()
Date: Wed, 27 Dec 2017 14:59:52 -0800 [thread overview]
Message-ID: <20171227225956.14442-17-andrew.smirnov@gmail.com> (raw)
In-Reply-To: <20171227225956.14442-1-andrew.smirnov@gmail.com>
Simplify code a bit by using of_device_get_match_data() instead of
of_match_device().
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: Joachim Eastwood <manabian@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>
---
drivers/nvmem/rockchip-efuse.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/nvmem/rockchip-efuse.c b/drivers/nvmem/rockchip-efuse.c
index d6dc1330f895..979ba0a376a0 100644
--- a/drivers/nvmem/rockchip-efuse.c
+++ b/drivers/nvmem/rockchip-efuse.c
@@ -193,11 +193,11 @@ static int rockchip_efuse_probe(struct platform_device *pdev)
struct resource *res;
struct nvmem_device *nvmem;
struct rockchip_efuse_chip *efuse;
- const struct of_device_id *match;
+ const void *data;
struct device *dev = &pdev->dev;
- match = of_match_device(dev->driver->of_match_table, dev);
- if (!match || !match->data) {
+ data = of_device_get_match_data(dev);
+ if (!data) {
dev_err(dev, "failed to get match data\n");
return -EINVAL;
}
@@ -218,7 +218,7 @@ static int rockchip_efuse_probe(struct platform_device *pdev)
efuse->dev = &pdev->dev;
econfig.size = resource_size(res);
- econfig.reg_read = match->data;
+ econfig.reg_read = data;
econfig.priv = efuse;
econfig.dev = efuse->dev;
nvmem = devm_nvmem_register(dev, &econfig);
--
2.14.3
next prev parent reply other threads:[~2017-12-27 22:59 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-27 22:59 [PATCH 00/20] Verbatim device names and devm_nvmem_(un)register() Andrey Smirnov
2017-12-27 22:59 ` [PATCH 01/20] nvmem: core: Allow specifying device name verbatim Andrey Smirnov
2017-12-27 22:59 ` [PATCH 02/20] nvmem: Introduce devm_nvmem_(un)register() Andrey Smirnov
2017-12-27 22:59 ` [PATCH 03/20] nvmem: vf610-ocotp: Convert to use devm_nvmem_register() Andrey Smirnov
2017-12-27 22:59 ` [PATCH 04/20] nvmem: imx-ocotp: " Andrey Smirnov
2017-12-27 22:59 ` [PATCH 05/20] nvmem: uniphier-efuse: " Andrey Smirnov
2017-12-27 22:59 ` [PATCH 06/20] nvmem: snvs_lgpr: " Andrey Smirnov
2017-12-27 22:59 ` [PATCH 07/20] nvmem: rockchip-efuse: " Andrey Smirnov
2017-12-27 22:59 ` [PATCH 08/20] nvmem: qfprom: " Andrey Smirnov
2017-12-27 22:59 ` [PATCH 09/20] nvmem: mtk-efuse: " Andrey Smirnov
2017-12-27 22:59 ` [PATCH 10/20] nvmem: meson-mx-efuse: " Andrey Smirnov
2017-12-27 22:59 ` [PATCH 11/20] nvmem: meson-efuse: " Andrey Smirnov
2017-12-30 6:38 ` kbuild test robot
2017-12-27 22:59 ` [PATCH 12/20] nvmem: lpc18xx_otp: " Andrey Smirnov
2017-12-27 22:59 ` [PATCH 13/20] nvmem: imx-iim: " Andrey Smirnov
2017-12-27 22:59 ` [PATCH 14/20] nvmem: bcm-ocotp: " Andrey Smirnov
2017-12-27 22:59 ` [PATCH 15/20] nvmem: snvs_lpgpr: Convert commas to semicolons Andrey Smirnov
2017-12-27 22:59 ` Andrey Smirnov [this message]
2017-12-27 22:59 ` [PATCH 17/20] nvmem: vf610-ocotp: Do not use "&pdev->dev" explicitly Andrey Smirnov
2017-12-27 22:59 ` [PATCH 18/20] nvmem: rockchip-efuse: " Andrey Smirnov
2017-12-27 22:59 ` [PATCH 19/20] nvmem: imx-iim: " Andrey Smirnov
2017-12-27 22:59 ` [PATCH 20/20] nvmem: bcm-ocotp: " Andrey Smirnov
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=20171227225956.14442-17-andrew.smirnov@gmail.com \
--to=andrew.smirnov@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox