[v2,1/2] dt-bindings: phy: mediatek,tphy: allow simple nodename pattern

Message ID 20230814093931.9298-1-eugen.hristev@collabora.com
State New
Headers
Series [v2,1/2] dt-bindings: phy: mediatek,tphy: allow simple nodename pattern |

Commit Message

Eugen Hristev Aug. 14, 2023, 9:39 a.m. UTC
  The pattern for the nodename only allows t-phy@... , however, for the case
when the t-phy has no `reg` and only `ranges` (basically when the t-phy
is just a parent node), dtc will throw this warning:

Warning (unit_address_vs_reg): /t-phy@1a243000: node has a unit name, but no reg or ranges property

For a node like this:

	sata_phy: t-phy@1a243000 {
		ranges;

		sata_port: sata-phy@1a243000 {
			reg = <0 0x1a243000 0 0x0100>;
		};
	};

it is normal that the parent node 't-phy' would be without any address, as in:

	sata_phy: t-phy {
		ranges;

		sata_port: sata-phy@1a243000 {
			reg = <0 0x1a243000 0 0x0100>;
		};
	};

because being just a holder it does not have its own reg.

However the binding does not allow such a name for the t-phy, so with this
patch, making the `@[0-9a-f]+` part optional, such node is possible.

Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
---
Changes in v2:
- none
 Documentation/devicetree/bindings/phy/mediatek,tphy.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Conor Dooley Aug. 14, 2023, 4:19 p.m. UTC | #1
On Mon, Aug 14, 2023 at 12:39:30PM +0300, Eugen Hristev wrote:
> The pattern for the nodename only allows t-phy@... , however, for the case
> when the t-phy has no `reg` and only `ranges` (basically when the t-phy
> is just a parent node), dtc will throw this warning:
> 
> Warning (unit_address_vs_reg): /t-phy@1a243000: node has a unit name, but no reg or ranges property
> 
> For a node like this:
> 
> 	sata_phy: t-phy@1a243000 {
> 		ranges;
> 
> 		sata_port: sata-phy@1a243000 {
> 			reg = <0 0x1a243000 0 0x0100>;
> 		};
> 	};
> 
> it is normal that the parent node 't-phy' would be without any address, as in:
> 
> 	sata_phy: t-phy {
> 		ranges;
> 
> 		sata_port: sata-phy@1a243000 {
> 			reg = <0 0x1a243000 0 0x0100>;
> 		};
> 	};
> 
> because being just a holder it does not have its own reg.
> 
> However the binding does not allow such a name for the t-phy, so with this
> patch, making the `@[0-9a-f]+` part optional, such node is possible.
> 
> Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>

This seems reasonable to me, perhaps the lads will scream.
Acked-by: Conor Dooley <conor.dooley@microchip.com>

Thanks,
Conor.

> ---
> Changes in v2:
> - none
>  Documentation/devicetree/bindings/phy/mediatek,tphy.yaml | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/phy/mediatek,tphy.yaml b/Documentation/devicetree/bindings/phy/mediatek,tphy.yaml
> index 230a17f24966..2bb91542e984 100644
> --- a/Documentation/devicetree/bindings/phy/mediatek,tphy.yaml
> +++ b/Documentation/devicetree/bindings/phy/mediatek,tphy.yaml
> @@ -64,7 +64,7 @@ description: |
>  
>  properties:
>    $nodename:
> -    pattern: "^t-phy@[0-9a-f]+$"
> +    pattern: "^t-phy(@[0-9a-f]+)?$"
>  
>    compatible:
>      oneOf:
> -- 
> 2.34.1
>
  
Vinod Koul Aug. 17, 2023, 9:55 a.m. UTC | #2
On Mon, 14 Aug 2023 12:39:30 +0300, Eugen Hristev wrote:
> The pattern for the nodename only allows t-phy@... , however, for the case
> when the t-phy has no `reg` and only `ranges` (basically when the t-phy
> is just a parent node), dtc will throw this warning:
> 
> Warning (unit_address_vs_reg): /t-phy@1a243000: node has a unit name, but no reg or ranges property
> 
> For a node like this:
> 
> [...]

Applied, thanks!

[1/2] dt-bindings: phy: mediatek,tphy: allow simple nodename pattern
      commit: e4077ca4ebdefa1b4616e4dafcb67b621253b233

Best regards,
  

Patch

diff --git a/Documentation/devicetree/bindings/phy/mediatek,tphy.yaml b/Documentation/devicetree/bindings/phy/mediatek,tphy.yaml
index 230a17f24966..2bb91542e984 100644
--- a/Documentation/devicetree/bindings/phy/mediatek,tphy.yaml
+++ b/Documentation/devicetree/bindings/phy/mediatek,tphy.yaml
@@ -64,7 +64,7 @@  description: |
 
 properties:
   $nodename:
-    pattern: "^t-phy@[0-9a-f]+$"
+    pattern: "^t-phy(@[0-9a-f]+)?$"
 
   compatible:
     oneOf: