Skip to contentSkip to conversation

regulator: Remove redundant of_match_ptr() macros

PATCH In review Chen Jiahao 2 participants 9 messages Aug 9, 2023

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v2 cover regulator: Remove redundant of_match_ptr() macros

Since these drivers depend on CONFIG_OF, it makes no difference to wrap of_match_ptr() here, nor can we save .text space from it.

Remove of_match_ptr() macros to clean it up.

Chen Jiahao (7):
regulator: da9121-regulator: Remove redundant of_match_ptr() macros
regulator: lp87565: Remove redundant of_match_ptr() macros
regulator: hi6421: Remove redundant of_match_ptr() macros
regulator: mcp16502: Remove redundant of_match_ptr() macros
regulator: mpq7920: Remove redundant of_match_ptr() macro
regulator: pfuze100-regulator: Remove redundant of_match_ptr() macro
regulator: tps6286x-regulator: Remove redundant of_match_ptr() macros

 drivers/regulator/da9121-regulator.c   | 18 +++++++++---------
 drivers/regulator/hi6421-regulator.c   | 20 ++++++++++----------
 drivers/regulator/lp87565-regulator.c  |  4 ++--
 drivers/regulator/mcp16502.c           |  6 +++---
 drivers/regulator/mpq7920.c            |  2 +-
 drivers/regulator/pfuze100-regulator.c |  3 +--
 drivers/regulator/tps6286x-regulator.c |  6 +++---
 7 files changed, 29 insertions(+), 30 deletions(-)
Signature · 7 lines
2.34.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#1 lore raw

PATCH v2 1/7 regulator: da9121-regulator: Remove redundant of_match_ptr() macros

Since the driver da9121-regulator depends on CONFIG_OF, it makes no difference to wrap of_match_ptr() here.

Remove of_match_ptr() macros to clean it up.

---
 drivers/regulator/da9121-regulator.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
drivers/regulator/da9121-regulator.c +9 -9
index 122124944749..80098035bb13 100644
@@ -440,7 +440,7 @@ static const struct regulator_desc da9121_reg = {
 	.of_match = "buck1",
 	.of_parse_cb = da9121_of_parse_cb,
 	.owner = THIS_MODULE,
-	.regulators_node = of_match_ptr("regulators"),
+	.regulators_node = "regulators",
 	.of_map_mode = da9121_map_mode,
 	.ops = &da9121_buck_ops,
 	.type = REGULATOR_VOLTAGE,
@@ -465,7 +465,7 @@ static const struct regulator_desc da9220_reg[2] = {
 		.of_match = "buck1",
 		.of_parse_cb = da9121_of_parse_cb,
 		.owner = THIS_MODULE,
-		.regulators_node = of_match_ptr("regulators"),
+		.regulators_node = "regulators",
 		.of_map_mode = da9121_map_mode,
 		.ops = &da9121_buck_ops,
 		.type = REGULATOR_VOLTAGE,
@@ -484,7 +484,7 @@ static const struct regulator_desc da9220_reg[2] = {
 		.of_match = "buck2",
 		.of_parse_cb = da9121_of_parse_cb,
 		.owner = THIS_MODULE,
-		.regulators_node = of_match_ptr("regulators"),
+		.regulators_node = "regulators",
 		.of_map_mode = da9121_map_mode,
 		.ops = &da9121_buck_ops,
 		.type = REGULATOR_VOLTAGE,
@@ -506,7 +506,7 @@ static const struct regulator_desc da9122_reg[2] = {
 		.of_match = "buck1",
 		.of_parse_cb = da9121_of_parse_cb,
 		.owner = THIS_MODULE,
-		.regulators_node = of_match_ptr("regulators"),
+		.regulators_node = "regulators",
 		.of_map_mode = da9121_map_mode,
 		.ops = &da9121_buck_ops,
 		.type = REGULATOR_VOLTAGE,
@@ -525,7 +525,7 @@ static const struct regulator_desc da9122_reg[2] = {
 		.of_match = "buck2",
 		.of_parse_cb = da9121_of_parse_cb,
 		.owner = THIS_MODULE,
-		.regulators_node = of_match_ptr("regulators"),
+		.regulators_node = "regulators",
 		.of_map_mode = da9121_map_mode,
 		.ops = &da9121_buck_ops,
 		.type = REGULATOR_VOLTAGE,
@@ -546,7 +546,7 @@ static const struct regulator_desc da9217_reg = {
 	.of_match = "buck1",
 	.of_parse_cb = da9121_of_parse_cb,
 	.owner = THIS_MODULE,
-	.regulators_node = of_match_ptr("regulators"),
+	.regulators_node = "regulators",
 	.of_map_mode = da9121_map_mode,
 	.ops = &da9121_buck_ops,
 	.type = REGULATOR_VOLTAGE,
@@ -573,7 +573,7 @@ static const struct regulator_desc da9141_reg = {
 	.of_match = "buck1",
 	.of_parse_cb = da9121_of_parse_cb,
 	.owner = THIS_MODULE,
-	.regulators_node = of_match_ptr("regulators"),
+	.regulators_node = "regulators",
 	.of_map_mode = da9121_map_mode,
 	.ops = &da9121_buck_ops,
 	.type = REGULATOR_VOLTAGE,
@@ -593,7 +593,7 @@ static const struct regulator_desc da9142_reg = {
 	.of_match = "buck1",
 	.of_parse_cb = da9121_of_parse_cb,
 	.owner = THIS_MODULE,
-	.regulators_node = of_match_ptr("regulators"),
+	.regulators_node = "regulators",
 	.of_map_mode = da9121_map_mode,
 	.ops = &da9121_buck_ops,
 	.type = REGULATOR_VOLTAGE,
@@ -1195,7 +1195,7 @@ static struct i2c_driver da9121_regulator_driver = {
 	.driver = {
 		.name = "da9121",
 		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
-		.of_match_table = of_match_ptr(da9121_dt_ids),
+		.of_match_table = da9121_dt_ids,
 	},
 	.probe = da9121_i2c_probe,
 	.remove = da9121_i2c_remove,
Signature · 7 lines
2.34.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#2 lore raw

PATCH v2 2/7 regulator: lp87565: Remove redundant of_match_ptr() macros

In reply to Chen Jiahao

Since the driver lp87565-regulator depends on CONFIG_OF, it makes no difference to wrap of_match_ptr() here.

Remove of_match_ptr() macros to clean it up.

---
 drivers/regulator/lp87565-regulator.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/regulator/lp87565-regulator.c +2 -2
index bdb60d8a7f3d..61ee5cf3f241 100644
@@ -29,8 +29,8 @@ enum LP87565_regulator_id {
 			.name			= _name,		\
 			.supply_name		= _of "-in",		\
 			.id			= _id,			\
-			.of_match		= of_match_ptr(_of),	\
-			.regulators_node	= of_match_ptr("regulators"),\
+			.of_match		= _of,			\
+			.regulators_node	= "regulators",		\
 			.ops			= &_ops,		\
 			.n_voltages		= _n,			\
 			.type			= REGULATOR_VOLTAGE,	\
Signature · 7 lines
2.34.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#3 lore raw

PATCH v2 3/7 regulator: hi6421: Remove redundant of_match_ptr() macros

In reply to Chen Jiahao

Since the driver hi6421-regulator depends on CONFIG_OF, it makes no difference to wrap of_match_ptr() here.

Remove of_match_ptr() macros to clean it up.

---
 drivers/regulator/hi6421-regulator.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
drivers/regulator/hi6421-regulator.c +10 -10
index 1b52423598d3..82e9e364d4d4 100644
@@ -131,8 +131,8 @@ static const struct regulator_ops hi6421_buck345_ops;
 	[HI6421_##_id] = {						\
 		.desc = {						\
 			.name		= #_id,				\
-			.of_match        = of_match_ptr(#_match),	\
-			.regulators_node = of_match_ptr("regulators"),	\
+			.of_match        = #_match,			\
+			.regulators_node = "regulators",		\
 			.ops		= &hi6421_ldo_ops,		\
 			.type		= REGULATOR_VOLTAGE,		\
 			.id		= HI6421_##_id,			\
@@ -170,8 +170,8 @@ static const struct regulator_ops hi6421_buck345_ops;
 	[HI6421_##_id] = {						\
 		.desc = {						\
 			.name		= #_id,				\
-			.of_match        = of_match_ptr(#_match),	\
-			.regulators_node = of_match_ptr("regulators"),	\
+			.of_match        = #_match,			\
+			.regulators_node = "regulators",		\
 			.ops		= &hi6421_ldo_linear_ops,	\
 			.type		= REGULATOR_VOLTAGE,		\
 			.id		= HI6421_##_id,			\
@@ -210,8 +210,8 @@ static const struct regulator_ops hi6421_buck345_ops;
 	[HI6421_##_id] = {						\
 		.desc = {						\
 			.name		= #_id,				\
-			.of_match        = of_match_ptr(#_match),	\
-			.regulators_node = of_match_ptr("regulators"),	\
+			.of_match        = #_match,			\
+			.regulators_node = "regulators",		\
 			.ops		= &hi6421_ldo_linear_range_ops,	\
 			.type		= REGULATOR_VOLTAGE,		\
 			.id		= HI6421_##_id,			\
@@ -247,8 +247,8 @@ static const struct regulator_ops hi6421_buck345_ops;
 	[HI6421_##_id] = {						\
 		.desc = {						\
 			.name		= #_id,				\
-			.of_match        = of_match_ptr(#_match),	\
-			.regulators_node = of_match_ptr("regulators"),	\
+			.of_match        = #_match,			\
+			.regulators_node = "regulators",		\
 			.ops		= &hi6421_buck012_ops,		\
 			.type		= REGULATOR_VOLTAGE,		\
 			.id		= HI6421_##_id,			\
@@ -284,8 +284,8 @@ static const struct regulator_ops hi6421_buck345_ops;
 	[HI6421_##_id] = {						\
 		.desc = {						\
 			.name		= #_id,				\
-			.of_match        = of_match_ptr(#_match),	\
-			.regulators_node = of_match_ptr("regulators"),	\
+			.of_match        = #_match,			\
+			.regulators_node = "regulators",		\
 			.ops		= &hi6421_buck345_ops,		\
 			.type		= REGULATOR_VOLTAGE,		\
 			.id		= HI6421_##_id,			\
Signature · 7 lines
2.34.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#4 lore raw

PATCH v2 4/7 regulator: mcp16502: Remove redundant of_match_ptr() macros

In reply to Chen Jiahao

Since the driver mcp16502 depends on CONFIG_OF, it makes no difference to wrap of_match_ptr() here.

Remove of_match_ptr() macros to clean it up.

---
 drivers/regulator/mcp16502.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/regulator/mcp16502.c +3 -3
index 6c6f5a21362b..8bf8b9899306 100644
@@ -111,7 +111,7 @@ static unsigned int mcp16502_of_map_mode(unsigned int mode)
 #define MCP16502_REGULATOR(_name, _id, _ranges, _ops, _ramp_table)	\
 	[_id] = {							\
 		.name			= _name,			\
-		.regulators_node	= of_match_ptr("regulators"),	\
+		.regulators_node	= "regulators",			\
 		.id			= _id,				\
 		.ops			= &(_ops),			\
 		.type			= REGULATOR_VOLTAGE,		\
@@ -120,7 +120,7 @@ static unsigned int mcp16502_of_map_mode(unsigned int mode)
 		.linear_ranges		= _ranges,			\
 		.linear_min_sel		= VDD_LOW_SEL,			\
 		.n_linear_ranges	= ARRAY_SIZE(_ranges),		\
-		.of_match		= of_match_ptr(_name),		\
+		.of_match		= _name,			\
 		.of_map_mode		= mcp16502_of_map_mode,		\
 		.vsel_reg		= (((_id) + 1) << 4),		\
 		.vsel_mask		= MCP16502_VSEL,		\
@@ -588,7 +588,7 @@ static struct i2c_driver mcp16502_drv = {
 	.driver		= {
 		.name	= "mcp16502-regulator",
 		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
-		.of_match_table	= of_match_ptr(mcp16502_ids),
+		.of_match_table	= mcp16502_ids,
 #ifdef CONFIG_PM
 		.pm = &mcp16502_pm_ops,
 #endif
Signature · 7 lines
2.34.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#5 lore raw

PATCH v2 5/7 regulator: mpq7920: Remove redundant of_match_ptr() macro

In reply to Chen Jiahao

Since the driver mpq7920 depends on CONFIG_OF, it makes no difference to wrap of_match_ptr() here.

Remove the of_match_ptr() macro to clean it up.

---
 drivers/regulator/mpq7920.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/mpq7920.c +1 -1
index 4926c229109b..a670e09891e7 100644
@@ -318,7 +318,7 @@ static struct i2c_driver mpq7920_regulator_driver = {
 	.driver = {
 		.name = "mpq7920",
 		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
-		.of_match_table = of_match_ptr(mpq7920_of_match),
+		.of_match_table = mpq7920_of_match,
 	},
 	.probe = mpq7920_i2c_probe,
 	.id_table = mpq7920_id,
Signature · 7 lines
2.34.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#6 lore raw

PATCH v2 6/7 regulator: pfuze100-regulator: Remove redundant of_match_ptr() macro

In reply to Chen Jiahao

Since the driver pfuze100-regulator depends on CONFIG_OF, it makes no difference to wrap of_match_ptr() here.

Remove the of_match_ptr() macro to clean it up.

---
 drivers/regulator/pfuze100-regulator.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/regulator/pfuze100-regulator.c +1 -2
index 8d7e6c323324..46854602b3ea 100644
@@ -699,8 +699,7 @@ static int pfuze100_regulator_probe(struct i2c_client *client)
 		return -ENOMEM;
 
 	if (client->dev.of_node) {
-		match = of_match_device(of_match_ptr(pfuze_dt_ids),
-				&client->dev);
+		match = of_match_device(pfuze_dt_ids, &client->dev);
 		if (!match) {
 			dev_err(&client->dev, "Error: No device match found\n");
 			return -ENODEV;
Signature · 7 lines
2.34.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#7 lore raw

PATCH v2 7/7 regulator: tps6286x-regulator: Remove redundant of_match_ptr() macros

In reply to Chen Jiahao

Since the driver tps6286x-regulator depends on CONFIG_OF, it makes no difference to wrap of_match_ptr() here.

Remove of_match_ptr() macros to clean it up.

---
 drivers/regulator/tps6286x-regulator.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/regulator/tps6286x-regulator.c +3 -3
index c06f6d1dc737..758c70269653 100644
@@ -84,11 +84,11 @@ static unsigned int tps6286x_of_map_mode(unsigned int mode)
 
 static const struct regulator_desc tps6286x_reg = {
 	.name = "tps6286x",
-	.of_match = of_match_ptr("SW"),
+	.of_match = "SW",
 	.owner = THIS_MODULE,
 	.ops = &tps6286x_regulator_ops,
 	.of_map_mode = tps6286x_of_map_mode,
-	.regulators_node = of_match_ptr("regulators"),
+	.regulators_node = "regulators",
 	.type = REGULATOR_VOLTAGE,
 	.n_voltages = ((TPS6286X_MAX_MV - TPS6286X_MIN_MV) / TPS6286X_STEP_MV) + 1,
 	.min_uV = TPS6286X_MIN_MV * 1000,
@@ -148,7 +148,7 @@ static struct i2c_driver tps6286x_regulator_driver = {
 	.driver = {
 		.name = "tps6286x",
 		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
-		.of_match_table = of_match_ptr(tps6286x_dt_ids),
+		.of_match_table = tps6286x_dt_ids,
 	},
 	.probe = tps6286x_i2c_probe,
 	.id_table = tps6286x_i2c_id,
Signature · 7 lines
2.34.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
maintainer
#8 lore raw
In reply to Chen Jiahao
Quoted 15 lines · Chen Jiahao

Since these drivers depend on CONFIG_OF, it makes no difference to wrap of_match_ptr() here, nor can we save .text space from it.

Remove of_match_ptr() macros to clean it up.

Chen Jiahao (7):
regulator: da9121-regulator: Remove redundant of_match_ptr() macros
regulator: lp87565: Remove redundant of_match_ptr() macros
regulator: hi6421: Remove redundant of_match_ptr() macros
regulator: mcp16502: Remove redundant of_match_ptr() macros
regulator: mpq7920: Remove redundant of_match_ptr() macro
regulator: pfuze100-regulator: Remove redundant of_match_ptr() macro
regulator: tps6286x-regulator: Remove redundant of_match_ptr() macros

Quoted 1 line

[...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next

Thanks!

[1/7] regulator: da9121-regulator: Remove redundant of_match_ptr() macros

      commit: 3a6d93eb5f27f313ce0f3fa3fb171cd0732c4878
[2/7] regulator: lp87565: Remove redundant of_match_ptr() macros
      commit: f410cfe8be5788cf09a3f32ce39946c339297821
[3/7] regulator: hi6421: Remove redundant of_match_ptr() macros
      commit: 656ed7467623674e6cc794a5b2ef79e8b8b81c3f
[4/7] regulator: mcp16502: Remove redundant of_match_ptr() macros
      commit: 3988795eb08c4239e865c4c21a3d5fd6fb2bd055
[5/7] regulator: mpq7920: Remove redundant of_match_ptr() macro
      commit: c329adf3026034c84ddd61c0b19db53d40510ae7
[6/7] regulator: pfuze100-regulator: Remove redundant of_match_ptr() macro
      commit: 9e8925eb7fd6e5d93d9dfa9ca4628e897f0db8f1
[7/7] regulator: tps6286x-regulator: Remove redundant of_match_ptr() macros
      commit: 252b9116aff4d04176adc931cd11f02169df54f1

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel