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]
Message-Id: <20230903164832.83077-2-biju.das.jz@bp.renesas.com>
Date:   Sun,  3 Sep 2023 17:48:31 +0100
From:   Biju Das <biju.das.jz@...renesas.com>
To:     Liam Girdwood <lgirdwood@...il.com>,
        Mark Brown <broonie@...nel.org>
Cc:     Biju Das <biju.das.jz@...renesas.com>,
        linux-kernel@...r.kernel.org, Biju Das <biju.das.au@...il.com>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Subject: [PATCH v3 1/2] regulator: pv880x0: Drop ifdeffery

Drop of_match_ptr() from pv88080_regulator_driver and get rid of ugly
CONFIG_OF ifdeffery. This slightly increases the size of pv88080_dt_ids
on non-OF system and shouldn't be an issue.

Add mod_devicetable.h include.

While at it, remove trailing comma in the terminator entry for OF/ID
table.

Suggested-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Signed-off-by: Biju Das <biju.das.jz@...renesas.com>
---
v2->v3:
 * Swapped the patch.
 * Removed trailing comma in the terminator entry for OF/ID table.
 * Restored OF table position.
 * Updated commit description.
v2:
 * New patch.
---
 drivers/regulator/pv88080-regulator.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/regulator/pv88080-regulator.c b/drivers/regulator/pv88080-regulator.c
index 7ab3e4a9bd28..1b2a8385e2e8 100644
--- a/drivers/regulator/pv88080-regulator.c
+++ b/drivers/regulator/pv88080-regulator.c
@@ -5,6 +5,7 @@
 
 #include <linux/err.h>
 #include <linux/i2c.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/of.h>
 #include <linux/init.h>
@@ -196,15 +197,13 @@ static const struct pv88080_compatible_regmap pv88080_ba_regs = {
 	.hvbuck_vsel_mask		  = PV88080_VHVBUCK_MASK,
 };
 
-#ifdef CONFIG_OF
 static const struct of_device_id pv88080_dt_ids[] = {
 	{ .compatible = "pvs,pv88080",    .data = (void *)TYPE_PV88080_AA },
 	{ .compatible = "pvs,pv88080-aa", .data = (void *)TYPE_PV88080_AA },
 	{ .compatible = "pvs,pv88080-ba", .data = (void *)TYPE_PV88080_BA },
-	{},
+	{}
 };
 MODULE_DEVICE_TABLE(of, pv88080_dt_ids);
-#endif
 
 static unsigned int pv88080_buck_get_mode(struct regulator_dev *rdev)
 {
@@ -550,7 +549,7 @@ static const struct i2c_device_id pv88080_i2c_id[] = {
 	{ "pv88080",    TYPE_PV88080_AA },
 	{ "pv88080-aa", TYPE_PV88080_AA },
 	{ "pv88080-ba", TYPE_PV88080_BA },
-	{},
+	{}
 };
 MODULE_DEVICE_TABLE(i2c, pv88080_i2c_id);
 
@@ -558,7 +557,7 @@ static struct i2c_driver pv88080_regulator_driver = {
 	.driver = {
 		.name = "pv88080",
 		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
-		.of_match_table = of_match_ptr(pv88080_dt_ids),
+		.of_match_table = pv88080_dt_ids,
 	},
 	.probe = pv88080_i2c_probe,
 	.id_table = pv88080_i2c_id,
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ