linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/2] dt-binding: regulator: anatop: make regulator name property required
@ 2017-04-14 14:30 Dong Aisheng
  2017-04-14 14:32 ` [PATCH v2 2/2] regulator: anatop: make sure regulator name is properly defined Dong Aisheng
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Dong Aisheng @ 2017-04-14 14:30 UTC (permalink / raw)
  To: linux-kernel; +Cc: Dong Aisheng, Rob Herring, Mark Rutland, devicetree

We actually can't allow the missing of the regualor name, thus update
the binding doc to make regulator-name property to be required.

Cc: Rob Herring <robh+dt@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: devicetree@vger.kernel.org
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
---
 Documentation/devicetree/bindings/regulator/anatop-regulator.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/regulator/anatop-regulator.txt b/Documentation/devicetree/bindings/regulator/anatop-regulator.txt
index 1d58c8c..a3106c7 100644
--- a/Documentation/devicetree/bindings/regulator/anatop-regulator.txt
+++ b/Documentation/devicetree/bindings/regulator/anatop-regulator.txt
@@ -2,6 +2,7 @@ Anatop Voltage regulators
 
 Required properties:
 - compatible: Must be "fsl,anatop-regulator"
+- regulator-name: A string used as a descriptive name for regulator outputs
 - anatop-reg-offset: Anatop MFD register offset
 - anatop-vol-bit-shift: Bit shift for the register
 - anatop-vol-bit-width: Number of bits used in the register
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v2 2/2] regulator: anatop: make sure regulator name is properly defined
  2017-04-14 14:30 [PATCH v2 1/2] dt-binding: regulator: anatop: make regulator name property required Dong Aisheng
@ 2017-04-14 14:32 ` Dong Aisheng
  2017-04-14 17:09   ` Mark Brown
  2017-04-14 17:12   ` Applied "regulator: anatop: make sure regulator name is properly defined" to the regulator tree Mark Brown
  2017-04-19 15:33 ` [PATCH v2 1/2] dt-binding: regulator: anatop: make regulator name property required A.S. Dong
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 8+ messages in thread
From: Dong Aisheng @ 2017-04-14 14:32 UTC (permalink / raw)
  To: linux-kernel; +Cc: broonie, Dong Aisheng

For anatop regulator we must have a name accordingly. Make sure the name
is properly checked before using it to avoid a possible kernel NULL
point crash.

Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
---
 drivers/regulator/anatop-regulator.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/regulator/anatop-regulator.c b/drivers/regulator/anatop-regulator.c
index 6135995..7d6478e 100644
--- a/drivers/regulator/anatop-regulator.c
+++ b/drivers/regulator/anatop-regulator.c
@@ -198,6 +198,10 @@ static int anatop_regulator_probe(struct platform_device *pdev)
 	rdesc->owner = THIS_MODULE;
 
 	of_property_read_string(np, "regulator-name", &rdesc->name);
+	if (!rdesc->name) {
+		dev_err(dev, "failed to get a regulator-name\n");
+		return -EINVAL;
+	}
 
 	initdata = of_get_regulator_init_data(dev, np, rdesc);
 	if (!initdata)
@@ -300,8 +304,7 @@ static int anatop_regulator_probe(struct platform_device *pdev)
 			sreg->sel = 22;
 
 		/* set the default voltage of the pcie phy to be 1.100v */
-		if (!sreg->sel && rdesc->name &&
-		    !strcmp(rdesc->name, "vddpcie"))
+		if (!sreg->sel && !strcmp(rdesc->name, "vddpcie"))
 			sreg->sel = 0x10;
 
 		if (!sreg->bypass && !sreg->sel) {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 2/2] regulator: anatop: make sure regulator name is properly defined
  2017-04-14 14:32 ` [PATCH v2 2/2] regulator: anatop: make sure regulator name is properly defined Dong Aisheng
@ 2017-04-14 17:09   ` Mark Brown
  2017-04-14 17:12   ` Applied "regulator: anatop: make sure regulator name is properly defined" to the regulator tree Mark Brown
  1 sibling, 0 replies; 8+ messages in thread
From: Mark Brown @ 2017-04-14 17:09 UTC (permalink / raw)
  To: Dong Aisheng; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 260 bytes --]

On Fri, Apr 14, 2017 at 10:32:43PM +0800, Dong Aisheng wrote:
> For anatop regulator we must have a name accordingly. Make sure the name
> is properly checked before using it to avoid a possible kernel NULL
> point crash.

I don't seem to have patch 1/1 here?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Applied "regulator: anatop: make sure regulator name is properly defined" to the regulator tree
  2017-04-14 14:32 ` [PATCH v2 2/2] regulator: anatop: make sure regulator name is properly defined Dong Aisheng
  2017-04-14 17:09   ` Mark Brown
@ 2017-04-14 17:12   ` Mark Brown
  1 sibling, 0 replies; 8+ messages in thread
From: Mark Brown @ 2017-04-14 17:12 UTC (permalink / raw)
  To: Dong Aisheng; +Cc: Mark Brown, linux-kernel, broonie, linux-kernel

The patch

   regulator: anatop: make sure regulator name is properly defined

has been applied to the regulator tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git 

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

>From 4af5924c02818ca170bb6902dbb883687b969aeb Mon Sep 17 00:00:00 2001
From: Dong Aisheng <aisheng.dong@nxp.com>
Date: Fri, 14 Apr 2017 22:32:43 +0800
Subject: [PATCH] regulator: anatop: make sure regulator name is properly
 defined

For anatop regulator we must have a name accordingly. Make sure the name
is properly checked before using it to avoid a possible kernel NULL
point crash.

Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/regulator/anatop-regulator.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/regulator/anatop-regulator.c b/drivers/regulator/anatop-regulator.c
index fa27c9de6744..606f3fa6de62 100644
--- a/drivers/regulator/anatop-regulator.c
+++ b/drivers/regulator/anatop-regulator.c
@@ -198,6 +198,10 @@ static int anatop_regulator_probe(struct platform_device *pdev)
 	rdesc->owner = THIS_MODULE;
 
 	of_property_read_string(np, "regulator-name", &rdesc->name);
+	if (!rdesc->name) {
+		dev_err(dev, "failed to get a regulator-name\n");
+		return -EINVAL;
+	}
 
 	initdata = of_get_regulator_init_data(dev, np, rdesc);
 	if (!initdata)
@@ -300,8 +304,7 @@ static int anatop_regulator_probe(struct platform_device *pdev)
 			sreg->sel = 22;
 
 		/* set the default voltage of the pcie phy to be 1.100v */
-		if (!sreg->sel && rdesc->name &&
-		    !strcmp(rdesc->name, "vddpcie"))
+		if (!sreg->sel && !strcmp(rdesc->name, "vddpcie"))
 			sreg->sel = 0x10;
 
 		if (!sreg->bypass && !sreg->sel) {
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* RE: [PATCH v2 1/2] dt-binding: regulator: anatop: make regulator name property required
  2017-04-14 14:30 [PATCH v2 1/2] dt-binding: regulator: anatop: make regulator name property required Dong Aisheng
  2017-04-14 14:32 ` [PATCH v2 2/2] regulator: anatop: make sure regulator name is properly defined Dong Aisheng
@ 2017-04-19 15:33 ` A.S. Dong
  2017-04-20 20:26   ` Mark Brown
  2017-04-20 13:50 ` Rob Herring
  2017-04-21 17:28 ` Applied "regulator: anatop: make regulator name property required" to the regulator tree Mark Brown
  3 siblings, 1 reply; 8+ messages in thread
From: A.S. Dong @ 2017-04-19 15:33 UTC (permalink / raw)
  To: A.S. Dong, linux-kernel, broonie; +Cc: Rob Herring, Mark Rutland, devicetree

> -----Original Message-----
> From: Dong Aisheng [mailto:aisheng.dong@nxp.com]
> Sent: Friday, April 14, 2017 10:31 PM
> To: linux-kernel@vger.kernel.org
> Cc: A.S. Dong; Rob Herring; Mark Rutland; devicetree@vger.kernel.org
> Subject: [PATCH v2 1/2] dt-binding: regulator: anatop: make regulator name
> property required
> 
> We actually can't allow the missing of the regualor name, thus update the
> binding doc to make regulator-name property to be required.
> 
> Cc: Rob Herring <robh+dt@kernel.org>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Cc: devicetree@vger.kernel.org
> Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>

Sorry, Mark, missed you about this one.

Regards
Dong Aisheng

> ---
>  Documentation/devicetree/bindings/regulator/anatop-regulator.txt | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/Documentation/devicetree/bindings/regulator/anatop-
> regulator.txt b/Documentation/devicetree/bindings/regulator/anatop-
> regulator.txt
> index 1d58c8c..a3106c7 100644
> --- a/Documentation/devicetree/bindings/regulator/anatop-regulator.txt
> +++ b/Documentation/devicetree/bindings/regulator/anatop-regulator.txt
> @@ -2,6 +2,7 @@ Anatop Voltage regulators
> 
>  Required properties:
>  - compatible: Must be "fsl,anatop-regulator"
> +- regulator-name: A string used as a descriptive name for regulator
> +outputs
>  - anatop-reg-offset: Anatop MFD register offset
>  - anatop-vol-bit-shift: Bit shift for the register
>  - anatop-vol-bit-width: Number of bits used in the register
> --
> 2.7.4

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 1/2] dt-binding: regulator: anatop: make regulator name property required
  2017-04-14 14:30 [PATCH v2 1/2] dt-binding: regulator: anatop: make regulator name property required Dong Aisheng
  2017-04-14 14:32 ` [PATCH v2 2/2] regulator: anatop: make sure regulator name is properly defined Dong Aisheng
  2017-04-19 15:33 ` [PATCH v2 1/2] dt-binding: regulator: anatop: make regulator name property required A.S. Dong
@ 2017-04-20 13:50 ` Rob Herring
  2017-04-21 17:28 ` Applied "regulator: anatop: make regulator name property required" to the regulator tree Mark Brown
  3 siblings, 0 replies; 8+ messages in thread
From: Rob Herring @ 2017-04-20 13:50 UTC (permalink / raw)
  To: Dong Aisheng; +Cc: linux-kernel, Mark Rutland, devicetree

On Fri, Apr 14, 2017 at 10:30:33PM +0800, Dong Aisheng wrote:
> We actually can't allow the missing of the regualor name, thus update
> the binding doc to make regulator-name property to be required.
> 
> Cc: Rob Herring <robh+dt@kernel.org>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Cc: devicetree@vger.kernel.org
> Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
> ---
>  Documentation/devicetree/bindings/regulator/anatop-regulator.txt | 1 +
>  1 file changed, 1 insertion(+)

Acked-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 1/2] dt-binding: regulator: anatop: make regulator name property required
  2017-04-19 15:33 ` [PATCH v2 1/2] dt-binding: regulator: anatop: make regulator name property required A.S. Dong
@ 2017-04-20 20:26   ` Mark Brown
  0 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2017-04-20 20:26 UTC (permalink / raw)
  To: A.S. Dong; +Cc: linux-kernel, Rob Herring, Mark Rutland, devicetree

[-- Attachment #1: Type: text/plain, Size: 282 bytes --]

On Wed, Apr 19, 2017 at 03:33:03PM +0000, A.S. Dong wrote:

> > We actually can't allow the missing of the regualor name, thus update the
> > binding doc to make regulator-name property to be required.

> Sorry, Mark, missed you about this one.

Please resend, I don't have a copy.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Applied "regulator: anatop: make regulator name property required" to the regulator tree
  2017-04-14 14:30 [PATCH v2 1/2] dt-binding: regulator: anatop: make regulator name property required Dong Aisheng
                   ` (2 preceding siblings ...)
  2017-04-20 13:50 ` Rob Herring
@ 2017-04-21 17:28 ` Mark Brown
  3 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2017-04-21 17:28 UTC (permalink / raw)
  To: Dong Aisheng
  Cc: Rob Herring, Mark Brown, linux-kernel, Rob Herring, Mark Rutland,
	devicetree, linux-kernel

The patch

   regulator: anatop: make regulator name property required

has been applied to the regulator tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git 

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

>From 0e69c2eceb7c71327086c6f48db42a0ba2378cbb Mon Sep 17 00:00:00 2001
From: Dong Aisheng <aisheng.dong@nxp.com>
Date: Fri, 21 Apr 2017 10:53:52 +0800
Subject: [PATCH] regulator: anatop: make regulator name property required

We actually can't allow the missing of the regualor name, thus update
the binding doc to make regulator-name property to be required.

Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 Documentation/devicetree/bindings/regulator/anatop-regulator.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/regulator/anatop-regulator.txt b/Documentation/devicetree/bindings/regulator/anatop-regulator.txt
index 37c4ea076f88..312060658a53 100644
--- a/Documentation/devicetree/bindings/regulator/anatop-regulator.txt
+++ b/Documentation/devicetree/bindings/regulator/anatop-regulator.txt
@@ -2,6 +2,7 @@ Anatop Voltage regulators
 
 Required properties:
 - compatible: Must be "fsl,anatop-regulator"
+- regulator-name: A string used as a descriptive name for regulator outputs
 - anatop-reg-offset: Anatop MFD register offset
 - anatop-vol-bit-shift: Bit shift for the register
 - anatop-vol-bit-width: Number of bits used in the register
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-04-21 18:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-14 14:30 [PATCH v2 1/2] dt-binding: regulator: anatop: make regulator name property required Dong Aisheng
2017-04-14 14:32 ` [PATCH v2 2/2] regulator: anatop: make sure regulator name is properly defined Dong Aisheng
2017-04-14 17:09   ` Mark Brown
2017-04-14 17:12   ` Applied "regulator: anatop: make sure regulator name is properly defined" to the regulator tree Mark Brown
2017-04-19 15:33 ` [PATCH v2 1/2] dt-binding: regulator: anatop: make regulator name property required A.S. Dong
2017-04-20 20:26   ` Mark Brown
2017-04-20 13:50 ` Rob Herring
2017-04-21 17:28 ` Applied "regulator: anatop: make regulator name property required" to the regulator tree Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).