All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: "André Draszik" <andre.draszik@linaro.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jirislaby@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Peter Griffin <peter.griffin@linaro.org>,
	Tudor Ambarus <tudor.ambarus@linaro.org>,
	Will McVicker <willmcvicker@google.com>,
	kernel-team@android.com, linux-kernel@vger.kernel.org,
	linux-serial@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v4 1/2] dt-bindings: serial: samsung: avoid duplicating permitted clock-names
Date: Mon, 22 Jul 2024 17:23:31 -0600	[thread overview]
Message-ID: <20240722232331.GA237402-robh@kernel.org> (raw)
In-Reply-To: <20240712-gs101-uart-binding-v4-1-24e9f8d4bdcb@linaro.org>

On Fri, Jul 12, 2024 at 03:51:17PM +0100, André Draszik wrote:
> This binding currently duplicates the permitted clock-names in various
> places, and when adding more compatibles, clock-names will have to be
> duplicated even more.
> 
> The reason is:
> 1) subschemas (-if: ...), still have to match the top-level:
>        pattern: '^clk_uart_baud[0-3]$'
> 2) there is one compatible that doesn't follow sequential numbering for
>    the clock names (samsung,s3c6400-uart)
> 3) when limiting the number of clock-names, we also want to enforce
>    sequential names
> Because of 1) and 2), the patterns can not simply be changed to
> constant strings, and later overridden in a different subschema (for
> samsung,s3c6400-uart only).
> 
> Since we can't populate the top-level clock-names based on the
> compatible, and because when limiting the number of items we generally
> want sequential numbers and not a pattern, move the permitted strings
> into a subschema of its own and populate it based on the compatible:
>     * 'uart clk_uart_baud2 clk_uart_baud3' for the one outlier
>     * 'uart clk_uart_baud0..3' for everything else
> 
> This way we can avoid having to duplicate the permitted names
> everywhere.
> 
> While at it, add blank lines as per the universal style, which is to
> have blank lines between properties, except where they are booleans.
> 
> Also add another example using a compatible that uses the default
> clock-names scheme, as opposed to the existing example that uses
> samsung,s3c6400-uart's non-default clock-names. This allows testing
> both versions of the clock-names property when running
> dt_binding_check.
> 
> Signed-off-by: André Draszik <andre.draszik@linaro.org>
> ---
>  .../devicetree/bindings/serial/samsung_uart.yaml   | 63 +++++++++++++++++-----
>  1 file changed, 50 insertions(+), 13 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/serial/samsung_uart.yaml b/Documentation/devicetree/bindings/serial/samsung_uart.yaml
> index 0f0131026911..cfa1c0de946f 100644
> --- a/Documentation/devicetree/bindings/serial/samsung_uart.yaml
> +++ b/Documentation/devicetree/bindings/serial/samsung_uart.yaml
> @@ -58,12 +58,7 @@ properties:
>    clock-names:
>      description: N = 0 is allowed for SoCs without internal baud clock mux.

The description doesn't really make sense on its own. I'd drop it.

With that,

Reviewed-by: Rob Herring (Arm) <robh@kernel.org>

>      minItems: 2
> -    items:
> -      - const: uart
> -      - pattern: '^clk_uart_baud[0-3]$'
> -      - pattern: '^clk_uart_baud[0-3]$'
> -      - pattern: '^clk_uart_baud[0-3]$'
> -      - pattern: '^clk_uart_baud[0-3]$'
> +    maxItems: 5

  reply	other threads:[~2024-07-22 23:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-12 14:51 [PATCH v4 0/2] dt-bindings: serial: samsung: style and gs101 fixes André Draszik
2024-07-12 14:51 ` [PATCH v4 1/2] dt-bindings: serial: samsung: avoid duplicating permitted clock-names André Draszik
2024-07-22 23:23   ` Rob Herring [this message]
2024-07-12 14:51 ` [PATCH v4 2/2] dt-bindings: serial: samsung: fix maxItems for gs101 André Draszik
2024-07-22 23:24   ` Rob Herring (Arm)

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=20240722232331.GA237402-robh@kernel.org \
    --to=robh@kernel.org \
    --cc=andre.draszik@linaro.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=kernel-team@android.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=peter.griffin@linaro.org \
    --cc=tudor.ambarus@linaro.org \
    --cc=willmcvicker@google.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.