From: Tony Lindgren <tony@atomide.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-omap@vger.kernel.org,
Thierry Reding <thierry.reding@gmail.com>,
Nishanth Menon <nm@ti.com>, Vignesh Raghavendra <vigneshr@ti.com>
Subject: Re: [PATCH v2 1/2] dt-bindings: pwm: Allow decimal format in addition to hex format
Date: Tue, 22 Nov 2022 13:11:43 +0200 [thread overview]
Message-ID: <Y3yubxJ3ZCIIed3T@atomide.com> (raw)
In-Reply-To: <20221122105710.5aow5qsri6pikgri@pengutronix.de>
* Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [221122 10:47]:
> On Tue, Nov 22, 2022 at 12:37:26PM +0200, Tony Lindgren wrote:
> > * Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [221122 09:26]:
> > > On Tue, Nov 22, 2022 at 06:43:55AM +0200, Tony Lindgren wrote:
> > > > * Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> [221121 16:05]:
> > > > > On 21/11/2022 15:48, Tony Lindgren wrote:
> > > > > > * Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [221121 14:30]:
> > > > > >> On Mon, Nov 21, 2022 at 01:55:24PM +0200, Tony Lindgren wrote:
> > > > > >>> Let's allow node numbering in decimal format too.
> > > > > >>>
> > > > > >>> Simple human-readable increments/IDs are usually decimal, hex is only for
> > > > > >>> addresses as noted by Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>.
> > > > > >>>
> > > > > >>> Cc: Thierry Reding <thierry.reding@gmail.com>
> > > > > >>> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > > > > >>> Suggested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > > > > >>> Signed-off-by: Tony Lindgren <tony@atomide.com>
> > > > > >>> ---
> > > > > >>> Documentation/devicetree/bindings/pwm/pwm.yaml | 2 +-
> > > > > >>> 1 file changed, 1 insertion(+), 1 deletion(-)
> > > > > >>>
> > > > > >>> diff --git a/Documentation/devicetree/bindings/pwm/pwm.yaml b/Documentation/devicetree/bindings/pwm/pwm.yaml
> > > > > >>> --- a/Documentation/devicetree/bindings/pwm/pwm.yaml
> > > > > >>> +++ b/Documentation/devicetree/bindings/pwm/pwm.yaml
> > > > > >>> @@ -13,7 +13,7 @@ select: false
> > > > > >>>
> > > > > >>> properties:
> > > > > >>> $nodename:
> > > > > >>> - pattern: "^pwm(@.*|-[0-9a-f])*$"
> > > > > >>> + pattern: "^pwm(@.*|-([0-9a-f]|1[0-5]))*$"
> > > > > >>
> > > > > >> I wonder why you don't make this:
> > > > > >>
> > > > > >> + pattern: "^pwm(@.*|-[0-9a-f]*)$"
> > > > >
> > > > > Yes, the '*' should be within ().
> > > >
> > > > Sorry I guess I don't follow. So for what type of naming is the second '*'
> > > > actually needed here, or is it needed at all?
> > > >
> > > > We only want to match the following:
> > > >
> > > > pwm@1234
> > > >
> > > > pwm-0
> > > > ...
> > > > pwm-f
> > > >
> > > > And now also:
> > > >
> > > > pwm-0
> > > > ...
> > > > pwm-15
> > > >
> > > > Is there yet another format I'm missing?
> > >
> > > I think there is a misunderstanding about the type of pattern here. Do
> > > we talk about a shell pattern where "[0-9a-f]*" matches a name starting
> > > with a hex digit followed by any number of any caracter, or is it a
> > > regexp where the * means "any number of the preceding pattern", so
> > > effectively a word consisting of only hex digits.
> > >
> > > The .* part makes me think we're talking about a regexp, so the old
> > > pattern ("^pwm(@.*|-[0-9a-f])*$") means that
> > >
> > > pwm-1-2-3-4
> > >
> > > is allowed but
> > >
> > > pwm-10
> > >
> > > isn't. And I think what we want is:
> > >
> > > "^pwm(@.*|-[0-9a-f]*)$"
> >
> > Heh so this fails for just node name pwm:
> >
> > pwm: $nodename:0: 'pwm' does not match '^pwm(@.*|-[0-9a-f]*)$'
> >
> > Maybe that's why the second '..)*$' was there originally for?
> > And adding it back there fixes pwm but allows pwm-1-2-3..
> >
> > > (or maybe better "^pwm(@.+|-[0-9a-f]+)$" ?)
> >
> > And this too fails for just pwm node name.
>
> Then let's pick:
>
>
> "^pwm(@.+|-[0-9a-f]+)?$"
That works for pwm and pwm-11, but now fails for pwm11 :)
Tony
WARNING: multiple messages have this Message-ID (diff)
From: Tony Lindgren <tony@atomide.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-omap@vger.kernel.org,
Thierry Reding <thierry.reding@gmail.com>,
Nishanth Menon <nm@ti.com>, Vignesh Raghavendra <vigneshr@ti.com>
Subject: Re: [PATCH v2 1/2] dt-bindings: pwm: Allow decimal format in addition to hex format
Date: Tue, 22 Nov 2022 13:11:43 +0200 [thread overview]
Message-ID: <Y3yubxJ3ZCIIed3T@atomide.com> (raw)
In-Reply-To: <20221122105710.5aow5qsri6pikgri@pengutronix.de>
* Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [221122 10:47]:
> On Tue, Nov 22, 2022 at 12:37:26PM +0200, Tony Lindgren wrote:
> > * Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [221122 09:26]:
> > > On Tue, Nov 22, 2022 at 06:43:55AM +0200, Tony Lindgren wrote:
> > > > * Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> [221121 16:05]:
> > > > > On 21/11/2022 15:48, Tony Lindgren wrote:
> > > > > > * Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [221121 14:30]:
> > > > > >> On Mon, Nov 21, 2022 at 01:55:24PM +0200, Tony Lindgren wrote:
> > > > > >>> Let's allow node numbering in decimal format too.
> > > > > >>>
> > > > > >>> Simple human-readable increments/IDs are usually decimal, hex is only for
> > > > > >>> addresses as noted by Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>.
> > > > > >>>
> > > > > >>> Cc: Thierry Reding <thierry.reding@gmail.com>
> > > > > >>> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > > > > >>> Suggested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > > > > >>> Signed-off-by: Tony Lindgren <tony@atomide.com>
> > > > > >>> ---
> > > > > >>> Documentation/devicetree/bindings/pwm/pwm.yaml | 2 +-
> > > > > >>> 1 file changed, 1 insertion(+), 1 deletion(-)
> > > > > >>>
> > > > > >>> diff --git a/Documentation/devicetree/bindings/pwm/pwm.yaml b/Documentation/devicetree/bindings/pwm/pwm.yaml
> > > > > >>> --- a/Documentation/devicetree/bindings/pwm/pwm.yaml
> > > > > >>> +++ b/Documentation/devicetree/bindings/pwm/pwm.yaml
> > > > > >>> @@ -13,7 +13,7 @@ select: false
> > > > > >>>
> > > > > >>> properties:
> > > > > >>> $nodename:
> > > > > >>> - pattern: "^pwm(@.*|-[0-9a-f])*$"
> > > > > >>> + pattern: "^pwm(@.*|-([0-9a-f]|1[0-5]))*$"
> > > > > >>
> > > > > >> I wonder why you don't make this:
> > > > > >>
> > > > > >> + pattern: "^pwm(@.*|-[0-9a-f]*)$"
> > > > >
> > > > > Yes, the '*' should be within ().
> > > >
> > > > Sorry I guess I don't follow. So for what type of naming is the second '*'
> > > > actually needed here, or is it needed at all?
> > > >
> > > > We only want to match the following:
> > > >
> > > > pwm@1234
> > > >
> > > > pwm-0
> > > > ...
> > > > pwm-f
> > > >
> > > > And now also:
> > > >
> > > > pwm-0
> > > > ...
> > > > pwm-15
> > > >
> > > > Is there yet another format I'm missing?
> > >
> > > I think there is a misunderstanding about the type of pattern here. Do
> > > we talk about a shell pattern where "[0-9a-f]*" matches a name starting
> > > with a hex digit followed by any number of any caracter, or is it a
> > > regexp where the * means "any number of the preceding pattern", so
> > > effectively a word consisting of only hex digits.
> > >
> > > The .* part makes me think we're talking about a regexp, so the old
> > > pattern ("^pwm(@.*|-[0-9a-f])*$") means that
> > >
> > > pwm-1-2-3-4
> > >
> > > is allowed but
> > >
> > > pwm-10
> > >
> > > isn't. And I think what we want is:
> > >
> > > "^pwm(@.*|-[0-9a-f]*)$"
> >
> > Heh so this fails for just node name pwm:
> >
> > pwm: $nodename:0: 'pwm' does not match '^pwm(@.*|-[0-9a-f]*)$'
> >
> > Maybe that's why the second '..)*$' was there originally for?
> > And adding it back there fixes pwm but allows pwm-1-2-3..
> >
> > > (or maybe better "^pwm(@.+|-[0-9a-f]+)$" ?)
> >
> > And this too fails for just pwm node name.
>
> Then let's pick:
>
>
> "^pwm(@.+|-[0-9a-f]+)?$"
That works for pwm and pwm-11, but now fails for pwm11 :)
Tony
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2022-11-22 11:11 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-21 11:55 [PATCH v2 1/2] dt-bindings: pwm: Allow decimal format in addition to hex format Tony Lindgren
2022-11-21 11:55 ` Tony Lindgren
2022-11-21 11:55 ` [PATCH v2 2/2] dt-bindings: pwm: ti,pwm-omap-dmtimer: Update binding for yaml Tony Lindgren
2022-11-21 11:55 ` Tony Lindgren
2022-11-21 12:20 ` Krzysztof Kozlowski
2022-11-21 12:20 ` Krzysztof Kozlowski
2022-11-21 12:20 ` [PATCH v2 1/2] dt-bindings: pwm: Allow decimal format in addition to hex format Krzysztof Kozlowski
2022-11-21 12:20 ` Krzysztof Kozlowski
2022-11-21 14:40 ` Uwe Kleine-König
2022-11-21 14:40 ` Uwe Kleine-König
2022-11-21 14:48 ` Tony Lindgren
2022-11-21 14:48 ` Tony Lindgren
2022-11-21 16:15 ` Krzysztof Kozlowski
2022-11-21 16:15 ` Krzysztof Kozlowski
2022-11-22 4:43 ` Tony Lindgren
2022-11-22 4:43 ` Tony Lindgren
2022-11-22 7:36 ` Krzysztof Kozlowski
2022-11-22 7:36 ` Krzysztof Kozlowski
2022-11-22 8:11 ` Tony Lindgren
2022-11-22 8:11 ` Tony Lindgren
2022-11-22 8:29 ` Krzysztof Kozlowski
2022-11-22 8:29 ` Krzysztof Kozlowski
2022-11-22 9:36 ` Uwe Kleine-König
2022-11-22 9:36 ` Uwe Kleine-König
2022-11-22 10:37 ` Tony Lindgren
2022-11-22 10:37 ` Tony Lindgren
2022-11-22 10:57 ` Uwe Kleine-König
2022-11-22 10:57 ` Uwe Kleine-König
2022-11-22 11:11 ` Tony Lindgren [this message]
2022-11-22 11:11 ` Tony Lindgren
2022-11-22 11:30 ` Krzysztof Kozlowski
2022-11-22 11:30 ` Krzysztof Kozlowski
2022-11-22 11:40 ` Tony Lindgren
2022-11-22 11:40 ` Tony Lindgren
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y3yubxJ3ZCIIed3T@atomide.com \
--to=tony@atomide.com \
--cc=devicetree@vger.kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=krzysztof.kozlowski@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=nm@ti.com \
--cc=robh+dt@kernel.org \
--cc=thierry.reding@gmail.com \
--cc=u.kleine-koenig@pengutronix.de \
--cc=vigneshr@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.