Skip to content

Commit 7b4e76c

Browse files
ndreysgregkh
authored andcommitted
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 <[email protected]> Cc: Heiko Stuebner <[email protected]> Cc: Masahiro Yamada <[email protected]> Cc: Carlo Caione <[email protected]> Cc: Kevin Hilman <[email protected]> Cc: Matthias Brugger <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Signed-off-by: Andrey Smirnov <[email protected]> Signed-off-by: Srinivas Kandagatla <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 0e18989 commit 7b4e76c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/nvmem/rockchip-efuse.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,11 +259,11 @@ static int rockchip_efuse_probe(struct platform_device *pdev)
259259
struct resource *res;
260260
struct nvmem_device *nvmem;
261261
struct rockchip_efuse_chip *efuse;
262-
const struct of_device_id *match;
262+
const void *data;
263263
struct device *dev = &pdev->dev;
264264

265-
match = of_match_device(dev->driver->of_match_table, dev);
266-
if (!match || !match->data) {
265+
data = of_device_get_match_data(dev);
266+
if (!data) {
267267
dev_err(dev, "failed to get match data\n");
268268
return -EINVAL;
269269
}
@@ -286,7 +286,7 @@ static int rockchip_efuse_probe(struct platform_device *pdev)
286286
if (of_property_read_u32(dev->of_node, "rockchip,efuse-size",
287287
&econfig.size))
288288
econfig.size = resource_size(res);
289-
econfig.reg_read = match->data;
289+
econfig.reg_read = data;
290290
econfig.priv = efuse;
291291
econfig.dev = efuse->dev;
292292
nvmem = devm_nvmem_register(dev, &econfig);

0 commit comments

Comments
 (0)