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-next>] [day] [month] [year] [list]
Date:	Tue, 18 Feb 2014 20:20:59 +0800
From:	Axel Lin <axel.lin@...ics.com>
To:	Mark Brown <broonie@...nel.org>
Cc:	Keerthy <j-keerthy@...com>, Liam Girdwood <lgirdwood@...il.com>,
	linux-kernel@...r.kernel.org
Subject: [PATCH 1/2] regulator: tps65218: Add terminate entry for
 of_device_id table

Fixes below build error:
FATAL: drivers/regulator/tps65218-regulator: struct of_device_id is not terminated with a NULL entry!

Also remove of_match_ptr as this is a DT-only driver.

Signed-off-by: Axel Lin <axel.lin@...ics.com>
---
 drivers/regulator/tps65218-regulator.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/drivers/regulator/tps65218-regulator.c b/drivers/regulator/tps65218-regulator.c
index 958276c..00c0114 100644
--- a/drivers/regulator/tps65218-regulator.c
+++ b/drivers/regulator/tps65218-regulator.c
@@ -96,6 +96,7 @@ static const struct of_device_id tps65218_of_match[] = {
 	TPS65218_OF_MATCH("ti,tps65218-dcdc5", tps65218_pmic_regs[DCDC5]),
 	TPS65218_OF_MATCH("ti,tps65218-dcdc6", tps65218_pmic_regs[DCDC6]),
 	TPS65218_OF_MATCH("ti,tps65218-ldo1", tps65218_pmic_regs[LDO1]),
+	{ }
 };
 MODULE_DEVICE_TABLE(of, tps65218_of_match);
 
@@ -242,14 +243,12 @@ static int tps65218_regulator_probe(struct platform_device *pdev)
 	int id;
 
 	match = of_match_device(tps65218_of_match, &pdev->dev);
-	if (match) {
-		template = match->data;
-		id = template->id;
-		init_data = of_get_regulator_init_data(&pdev->dev,
-						      pdev->dev.of_node);
-	} else {
+	if (!match)
 		return -ENODEV;
-	}
+
+	template = match->data;
+	id = template->id;
+	init_data = of_get_regulator_init_data(&pdev->dev, pdev->dev.of_node);
 
 	platform_set_drvdata(pdev, tps);
 
@@ -290,7 +289,7 @@ static struct platform_driver tps65218_regulator_driver = {
 	.driver = {
 		.name = "tps65218-pmic",
 		.owner = THIS_MODULE,
-		.of_match_table = of_match_ptr(tps65218_of_match),
+		.of_match_table = tps65218_of_match,
 	},
 	.probe = tps65218_regulator_probe,
 	.remove = tps65218_regulator_remove,
-- 
1.8.1.2



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists