lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 27 Dec 2017 14:59:52 -0800
From:   Andrey Smirnov <andrew.smirnov@...il.com>
To:     Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
Cc:     Andrey Smirnov <andrew.smirnov@...il.com>,
        Heiko Stuebner <heiko@...ech.de>,
        Masahiro Yamada <yamada.masahiro@...ionext.com>,
        Carlo Caione <carlo@...one.org>,
        Kevin Hilman <khilman@...libre.com>,
        Matthias Brugger <matthias.bgg@...il.com>,
        Joachim Eastwood <manabian@...il.com>, cphealy@...il.com,
        linux-kernel@...r.kernel.org, linux-mediatek@...ts.infradead.org,
        linux-rockchip@...ts.infradead.org,
        linux-amlogic@...ts.infradead.org,
        linux-arm-kernel@...ts.infradead.org
Subject: [PATCH 16/20] nvmem: rockchip-efuse: Make use of of_device_get_match_data()

Simplify code a bit by using of_device_get_match_data() instead of
of_match_device().

Cc: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
Cc: Heiko Stuebner <heiko@...ech.de>
Cc: Masahiro Yamada <yamada.masahiro@...ionext.com>
Cc: Carlo Caione <carlo@...one.org>
Cc: Kevin Hilman <khilman@...libre.com>
Cc: Matthias Brugger <matthias.bgg@...il.com>
Cc: Joachim Eastwood <manabian@...il.com>
Cc: cphealy@...il.com
Cc: linux-kernel@...r.kernel.org
Cc: linux-mediatek@...ts.infradead.org
Cc: linux-rockchip@...ts.infradead.org
Cc: linux-amlogic@...ts.infradead.org
Cc: linux-arm-kernel@...ts.infradead.org
Signed-off-by: Andrey Smirnov <andrew.smirnov@...il.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ