Skip to contentSkip to conversation

regulator: sy7636a: Add terminating entry for platform_device_id table

PATCH In review Axel Lin 3 participants 7 messages Jun 16, 2021 Voltage and current regulator framework

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/3 regulator: sy7636a: Add terminating entry for platform_device_id table

The platform_device_id table is supposed to be zero-terminated.

---
 drivers/regulator/sy7636a-regulator.c | 1 +
 1 file changed, 1 insertion(+)
drivers/regulator/sy7636a-regulator.c +1 -0
index c384c2b6ac46..54ab1be1001e 100644
@@ -110,6 +110,7 @@ static int sy7636a_regulator_probe(struct platform_device *pdev)
 
 static const struct platform_device_id sy7636a_regulator_id_table[] = {
 	{ "sy7636a-regulator", },
+	{ }
 };
 MODULE_DEVICE_TABLE(platform, sy7636a_regulator_id_table);
 
Signature · 1 line
2.25.1
author
#1 lore raw

PATCH 2/3 regulator: sy7636a: Make regulator_desc static const

It's only used in this file and never changed, make it static const.

---
 drivers/regulator/sy7636a-regulator.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/regulator/sy7636a-regulator.c +2 -2
index 54ab1be1001e..c71c0a007d95 100644
@@ -53,7 +53,7 @@ static const struct regulator_ops sy7636a_vcom_volt_ops = {
 	.get_status = sy7636a_get_status,
 };
 
-struct regulator_desc desc = {
+static const struct regulator_desc desc = {
 	.name = "vcom",
 	.id = 0,
 	.ops = &sy7636a_vcom_volt_ops,
@@ -61,7 +61,7 @@ struct regulator_desc desc = {
 	.owner = THIS_MODULE,
 	.enable_reg = SY7636A_REG_OPERATION_MODE_CRL,
 	.enable_mask = SY7636A_OPERATION_MODE_CRL_ONOFF,
-	.poll_enabled_time	= SY7636A_POLL_ENABLED_TIME,
+	.poll_enabled_time = SY7636A_POLL_ENABLED_TIME,
 	.regulators_node = of_match_ptr("regulators"),
 	.of_match = of_match_ptr("vcom"),
 };
Signature · 1 line
2.25.1
Reviewed-by on v1 2/3
#2 lore raw

Re: [PATCH 2/3] regulator: sy7636a: Make regulator_desc static const

Quoted 3 lines · Axel Lin

It's only used in this file and never changed, make it static const.

Quoted 30 lines

---
drivers/regulator/sy7636a-regulator.c | 4 ++--

1 file changed, 2 insertions(+), 2 deletions(-)
drivers/regulator/sy7636a-regulator.c +2 -2
index 54ab1be1001e..c71c0a007d95 100644
@@ -53,7 +53,7 @@ static const struct regulator_ops sy7636a_vcom_volt_ops = {
 .get_status = sy7636a_get_status,
 };
 
-struct regulator_desc desc = {
+static const struct regulator_desc desc = {
 .name = "vcom",
 .id = 0,
 .ops = &sy7636a_vcom_volt_ops,
@@ -61,7 +61,7 @@ struct regulator_desc desc = {
 .owner = THIS_MODULE,
 .enable_reg = SY7636A_REG_OPERATION_MODE_CRL,
 .enable_mask = SY7636A_OPERATION_MODE_CRL_ONOFF,
- .poll_enabled_time = SY7636A_POLL_ENABLED_TIME,
+ .poll_enabled_time = SY7636A_POLL_ENABLED_TIME,
 .regulators_node = of_match_ptr("regulators"),
 .of_match = of_match_ptr("vcom"),
 };
Signature · 1 line
2.25.1
author
#3 lore raw

PATCH 3/3 regulator: sy7636a: Use rdev_get_drvdata at proper place

In reply to Axel Lin

At the context with *rdev, use rdev_get_drvdata() is more intuitive.

---
 drivers/regulator/sy7636a-regulator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/sy7636a-regulator.c +1 -1
index c71c0a007d95..e021ae08cbaa 100644
@@ -35,7 +35,7 @@ static int sy7636a_get_vcom_voltage_op(struct regulator_dev *rdev)
 
 static int sy7636a_get_status(struct regulator_dev *rdev)
 {
-	struct sy7636a *sy7636a = dev_get_drvdata(rdev->dev.parent);
+	struct sy7636a *sy7636a = rdev_get_drvdata(rdev);
 	int ret = 0;
 
 	ret = gpiod_get_value_cansleep(sy7636a->pgood_gpio);
Signature · 1 line
2.25.1
Reviewed-by on v1 3/3
#4 lore raw

Re: [PATCH 3/3] regulator: sy7636a: Use rdev_get_drvdata at proper place

Quoted 3 lines · Axel Lin

At the context with *rdev, use rdev_get_drvdata() is more intuitive.

Quoted 21 lines

---
drivers/regulator/sy7636a-regulator.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/sy7636a-regulator.c +1 -1
index c71c0a007d95..e021ae08cbaa 100644
@@ -35,7 +35,7 @@ static int sy7636a_get_vcom_voltage_op(struct regulator_dev *rdev)
 
 static int sy7636a_get_status(struct regulator_dev *rdev)
 {
- struct sy7636a *sy7636a = dev_get_drvdata(rdev->dev.parent);
+ struct sy7636a *sy7636a = rdev_get_drvdata(rdev);
 int ret = 0;
 
 ret = gpiod_get_value_cansleep(sy7636a->pgood_gpio);
Signature · 1 line
2.25.1
Reviewed-by on v1 1/3
#5 lore raw
In reply to Axel Lin
Quoted 3 lines · Axel Lin

The platform_device_id table is supposed to be zero-terminated.

Quoted 20 lines

---
drivers/regulator/sy7636a-regulator.c | 1 +

1 file changed, 1 insertion(+)
drivers/regulator/sy7636a-regulator.c +1 -0
index c384c2b6ac46..54ab1be1001e 100644
@@ -110,6 +110,7 @@ static int sy7636a_regulator_probe(struct platform_device *pdev)
 
 static const struct platform_device_id sy7636a_regulator_id_table[] = {
 { "sy7636a-regulator", },
+ { }
 };
 MODULE_DEVICE_TABLE(platform, sy7636a_regulator_id_table);
 
Signature · 1 line
2.25.1
maintainer
#6 lore raw
In reply to Axel Lin
Quoted 1 line · Axel Lin

The platform_device_id table is supposed to be zero-terminated.

Applied to

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

Thanks!

[1/3] regulator: sy7636a: Add terminating entry for platform_device_id table

      commit: 686f6b31bf6cea71ca941b6dbf9e1388d54222b6
[2/3] regulator: sy7636a: Make regulator_desc static const
      commit: 31a89d297e196472875dc7d4a8f5dd0aaefcc0b4
[3/3] regulator: sy7636a: Use rdev_get_drvdata at proper place
      commit: 830c364f4a2299e8215c40f0a2ba9229c0fdeede

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