regulator: fp9931: Make vin-supply mandatory
v2 cover regulator: fp9931: Make vin-supply mandatory
The FP9931 regulator requires a valid "vin" supply to operate correctly. Therefore, the driver should treat "vin" as a mandatory supply.
This patchset updates the binding documentation to mark vin-supply as a required property, and modifies the driver accordingly. As suggested in the reviews from Andreas and Mark, v2 switches to using devm_regulator_get() since the supply is mandatory.
Changes in v2:
- Addressed feedback from Andreas and Mark by replacing devm_regulator_get_optional() with devm_regulator_get() because VIN is required.
- Added a new patch updating the binding documentation to make vin-supply a required property.
v1: https://patchwork.kernel.org/project/imx/patch/20260312040148.GA4007088@shlinux88/
Robby Cai (2):
dt-bindings: regulator: fitipower,fp9931: Make vin-supply property as
required
regulator: fp9931: Fix handling of mandatory "vin" supply
.../devicetree/bindings/regulator/fitipower,fp9931.yaml | 1 + drivers/regulator/fp9931.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)
Signature · 1 line
2.37.1
PATCH v2 1/2 dt-bindings: regulator: fp9931: Make vin-supply property as required
The FP9931 requires a vin power supply to operate, so mark vin-supply as a required property in the binding.
--- .../devicetree/bindings/regulator/fitipower,fp9931.yaml | 1 + 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/regulator/fitipower,fp9931.yaml +1 -0
@@ -66,6 +66,7 @@ properties: required: - compatible - reg + - vin-supply - pg-gpios - enable-gpios
Signature · 1 line
2.37.1
Mark Brown
maintainerRe: [PATCH v2 1/2] dt-bindings: regulator: fp9931: Make vin-supply property as required
Quoted 2 lines · Robby Cai
The FP9931 requires a vin power supply to operate, so mark vin-supply as a required property in the binding.
Please submit patches using subject lines reflecting the style for the subsystem, this makes it easier for people to identify relevant patches. Look at what existing commits in the area you're changing are doing and make sure your subject lines visually resemble what they're doing. There's no need to resubmit to fix this alone.
Re: [PATCH v2 1/2] dt-bindings: regulator: fp9931: Make vin-supply property as required
Quoted 9 lines · On Fri, 13 Mar 2026 13:33:36 +0000 Mark Brown <[email protected]> wrote:
Quoted 2 lines · Robby Cai
The FP9931 requires a vin power supply to operate, so mark vin-supply as a required property in the binding.
Please submit patches using subject lines reflecting the style for the subsystem, this makes it easier for people to identify relevant patches. Look at what existing commits in the area you're changing are doing and make sure your subject lines visually resemble what they're doing. There's no need to resubmit to fix this alone.
in short words (but manually typed, so time-consuming):
s/dt-bindings: regulator:/regulator: dt-bindings:/
Since I once have misunderstood that text block myself:
- this sounds like you are talking about the subject line as a whole and not only the prefix.
- Looking at common practice:
git log --pretty=format:%s -- Documentation/devicetree/bindings/regulator/ | sed 's/^\([^:]*\):\([^:]*\):.*/\1:\2/' | grep binding | head -n 100 | sort | uniq -c shows (besides random other stuff) around 70% "regulator: dt-bindings" and 30% "dt-bindings: regulator"
so chances are that people might see a bunch of "dt-bindings: regulator" (happened to me once)
if they do not invest time in doing proper statistic, I hove once thought: my prefix is right,
so lets try to adjust the wording.
- for an unbiased reader, reading Documentation/devicetree/bindings/submitting-patches.rst helps
Maybe that helps to reduce some unnecessary churn in the future
Regards,
Andreas
Mark Brown
maintainerRe: [PATCH v2 1/2] dt-bindings: regulator: fp9931: Make vin-supply property as required
Quoted 11 lines · Andreas Kemnade
Quoted 5 lines · Mark Brown
Please submit patches using subject lines reflecting the style for the subsystem, this makes it easier for people to identify relevant patches. Look at what existing commits in the area you're changing are doing and make sure your subject lines visually resemble what they're doing. There's no need to resubmit to fix this alone.
Since I once have misunderstood that text block myself:
- this sounds like you are talking about the subject line as a whole and not only the prefix.
It *might* be the rest of the subject line as well, very much less often but it does happen (excessively long lines for example).
Re: [PATCH v2 1/2] dt-bindings: regulator: fp9931: Make vin-supply property as required
In reply to Robby Caipw-bot: not-applicable
PATCH v2 2/2 regulator: fp9931: Fix handling of mandatory "vin" supply
In reply to Robby CaiThe FP9931 requires a mandatory "vin" power supply to operate. Replace devm_regulator_get_optional() with devm_regulator_get() to enforce this mandatory dependency.
--- drivers/regulator/fp9931.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/fp9931.c +1 -1
@@ -444,7 +444,7 @@ static int fp9931_probe(struct i2c_client *client)return dev_err_probe (&client->dev,PTR_ERR (data->regmap),"failed to allocate regmap!\n" ); - data->vin_reg =devm_regulator_get_optional (&client->dev,"vin" ); + data->vin_reg =devm_regulator_get (&client->dev,"vin" );if (IS_ERR (data->vin_reg))return dev_err_probe (&client->dev,PTR_ERR (data->vin_reg),"failed to get vin regulator\n" );
Signature · 1 line
2.37.1
Re: [PATCH v2 2/2] regulator: fp9931: Fix handling of mandatory "vin" supply
Quoted 15 lines · Robby Cai
The FP9931 requires a mandatory "vin" power supply to operate. Replace
devm_regulator_get_optional()withdevm_regulator_get()to enforce this mandatory dependency.Fixes 12d821bd13d42 ("regulator: Add FP9931/JD9930 driver")Signed-off-by Robby Cai <[email protected]>--- drivers/regulator/fp9931.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/regulator/fp9931.c +0
-0
drivers/regulator/fp9931.c static int fp9931_probe(struct i2c_client *client) · line 447
Quoted 5 lines
drivers/regulator/fp9931.c +1
-1@@ -444,7 +444,7 @@ static int fp9931_probe(struct i2c_client *client)return dev_err_probe (&client->dev,PTR_ERR (data->regmap),"failed to allocate regmap!\n" ); - data->vin_reg =devm_regulator_get_optional (&client->dev,"vin" ); + data->vin_reg =devm_regulator_get (&client->dev,"vin" );
And this isn't an ABI break because the regulator core will invent a dummy regulator?
What's the functional difference here?
Quoted 6 lines
drivers/regulator/fp9931.c +0
-0if (IS_ERR (data->vin_reg))return dev_err_probe (&client->dev,PTR_ERR (data->vin_reg),"failed to get vin regulator\n" );Signature · 1 line
2.37.1
Re: [PATCH v2 2/2] regulator: fp9931: Fix handling of mandatory "vin" supply
Quoted 19 lines · Conor Dooley
Quoted 18 lines · Robby Cai
The FP9931 requires a mandatory "vin" power supply to operate. Replace
devm_regulator_get_optional()withdevm_regulator_get()to enforce this mandatory dependency.Fixes 12d821bd13d42 ("regulator: Add FP9931/JD9930 driver")Signed-off-by Robby Cai <[email protected]>--- drivers/regulator/fp9931.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/regulator/fp9931.c +0
-0@@ -444,7 +444,7 @@ static int fp9931_probe(struct i2c_client *client)return dev_err_probe (&client->dev,PTR_ERR (data->regmap),"failed to allocate regmap!\n" );
Quoted 8 lines
drivers/regulator/fp9931.c static int fp9931_probe(struct i2c_client *client) · line 447
Quoted 2 lines
drivers/regulator/fp9931.c +1
-1- data->vin_reg =devm_regulator_get_optional (&client->dev,"vin" ); + data->vin_reg =devm_regulator_get (&client->dev,"vin" );And this isn't an ABI break because the regulator core will invent a dummy regulator?
What's the functional difference here?
Yes, this change does not introduce an ABI break.
If the DT already specifies the 'vin' supply, nothing changes.
If the DT omits 'vin', the previous driver treated that as "no regulator" via devm_regulator_get_optional() [1]. After this change, the driver still continues to probe; the regulator core reports that a dummy supply is being used.
[1] The original handling of devm_regulator_get_optional() had a defect, which v1 attempted to fix. Switching to devm_regulator_get() reflects the actual hardware requirement.
Regards,
Robby
Re: [PATCH v2 2/2] regulator: fp9931: Fix handling of mandatory "vin" supply
In reply to Conor DooleyQuoted 19 lines · On Fri, 13 Mar 2026 17:24:31 +0000 Conor Dooley <[email protected]> wrote:
Quoted 18 lines · Robby Cai
The FP9931 requires a mandatory "vin" power supply to operate. Replace
devm_regulator_get_optional()withdevm_regulator_get()to enforce this mandatory dependency.Fixes 12d821bd13d42 ("regulator: Add FP9931/JD9930 driver")Signed-off-by Robby Cai <[email protected]>--- drivers/regulator/fp9931.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/regulator/fp9931.c +0
-0@@ -444,7 +444,7 @@ static int fp9931_probe(struct i2c_client *client)return dev_err_probe (&client->dev,PTR_ERR (data->regmap),"failed to allocate regmap!\n" );
Quoted 6 lines
drivers/regulator/fp9931.c static int fp9931_probe(struct i2c_client *client) · line 447
Quoted 2 lines
drivers/regulator/fp9931.c +1
-1- data->vin_reg =devm_regulator_get_optional (&client->dev,"vin" ); + data->vin_reg =devm_regulator_get (&client->dev,"vin" );And this isn't an ABI break because the regulator core will invent a dummy regulator?
On most devices I see a dummy regulator somewhere.
What IMHO itches more is that one has to invent a regulator in devicetree if the property is mandatory and the supply is not known, you have to add a dummy regulator in the devicetree to make dtbs_check happy.
Regards,
Andreas
Mark Brown
maintainerQuoted 7 lines · Robby Cai
The FP9931 regulator requires a valid "vin" supply to operate correctly. Therefore, the driver should treat "vin" as a mandatory supply.
This patchset updates the binding documentation to mark vin-supply as a required property, and modifies the driver accordingly. As suggested in the reviews from Andreas and Mark, v2 switches to using
devm_regulator_get()since the supply is mandatory.
Please do not submit new versions of already applied patches, please submit incremental updates to the existing code. Modifying existing commits creates problems for other users building on top of those commits so it's best practice to only change pubished git commits if absolutely essential.
Mark Brown
maintainerQuoted 9 lines · Mark Brown
Quoted 7 lines · Robby Cai
The FP9931 regulator requires a valid "vin" supply to operate correctly. Therefore, the driver should treat "vin" as a mandatory supply.
This patchset updates the binding documentation to mark vin-supply as a required property, and modifies the driver accordingly. As suggested in the reviews from Andreas and Mark, v2 switches to using
devm_regulator_get()since the supply is mandatory.
Quoted 5 lines
Please do not submit new versions of already applied patches, please submit incremental updates to the existing code. Modifying existing commits creates problems for other users building on top of those commits so it's best practice to only change pubished git commits if absolutely essential.
Your v1 was at the tip of the branch so I did actually just drop it, but please don't do this.
Quoted 10 lines · Mark Brown
Quoted 8 lines · Mark Brown
Quoted 7 lines · Robby Cai
The FP9931 regulator requires a valid "vin" supply to operate correctly. Therefore, the driver should treat "vin" as a mandatory supply.
This patchset updates the binding documentation to mark vin-supply as a required property, and modifies the driver accordingly. As suggested in the reviews from Andreas and Mark, v2 switches to using
devm_regulator_get()since the supply is mandatory.
Quoted 8 lines
Quoted 5 lines
Please do not submit new versions of already applied patches, please submit incremental updates to the existing code. Modifying existing commits creates problems for other users building on top of those commits so it's best practice to only change pubished git commits if absolutely essential.
Your v1 was at the tip of the branch so I did actually just drop it, but please don't do this.
Thanks for the clarification.
Just to confirm: since you already dropped the v1 from your tree, does that mean I should wait and only send an incremental patch when there is a further change needed?
Regards,
Robby
Mark Brown
maintainerQuoted 10 lines · Robby Cai
Quoted 2 lines · Mark Brown
Your v1 was at the tip of the branch so I did actually just drop it, but please don't do this.
Thanks for the clarification.
Just to confirm: since you already dropped the v1 from your tree, does that mean I should wait and only send an incremental patch when there is a further change needed?
Yes, exactly.
Mark Brown
maintainerQuoted 9 lines · Robby Cai
The FP9931 regulator requires a valid "vin" supply to operate correctly. Therefore, the driver should treat "vin" as a mandatory supply.
This patchset updates the binding documentation to mark vin-supply as a required property, and modifies the driver accordingly. As suggested in the reviews from Andreas and Mark, v2 switches to using
devm_regulator_get()since the supply is mandatory.[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next
Thanks!
[1/2] dt-bindings: regulator: fp9931: Make vin-supply property as required
https://git.kernel.org/broonie/misc/c/d342f5e355aa [2/2] regulator: fp9931: Fix handling of mandatory "vin" supply https://git.kernel.org/broonie/misc/c/58068932402c
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
Mark Brown
maintainerQuoted 11 lines · Robby Cai
regulator: fp9931: Make vin-supply mandatory
The FP9931 regulator requires a valid "vin" supply to operate correctly. Therefore, the driver should treat "vin" as a mandatory supply.
This patchset updates the binding documentation to mark vin-supply as a required property, and modifies the driver accordingly. As suggested in the reviews from Andreas and Mark, v2 switches to using
devm_regulator_get()since the supply is mandatory.[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-7.1
Thanks!
[1/2] dt-bindings: regulator: fp9931: Make vin-supply property as required
https://git.kernel.org/broonie/regulator/c/d342f5e355aa [2/2] regulator: fp9931: Fix handling of mandatory "vin" supply https://git.kernel.org/broonie/regulator/c/58068932402c
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