From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A86E8C54EE9 for ; Thu, 8 Sep 2022 16:07:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=xVwl47jxRWcdIG4OJr2Qoe3XHswP0oriOCGZTxa+og0=; b=YTzmSwFjqpxP8r C1izPKp5ippXszy2sAaQgWn8WKJIajDoe+GNWyQm7WrjEPegCZVKdICxevYXAasbICVwMPKKbxaCN VcmWCSW9/xr4cp3S6FUGPpvsc11qmcQEQMEjQB7VzdVYHKn4tie4D7yh73Fc+Vpp46ykfu3dUQwti lhBeMp/UdAsB5zGrGDuMd6oxEjf5v6bF/oPaO7cZBu15M63QY2lTGzN0ZvKNH7JRJKbS9JOgcZQSn gV4ja8+Gm6FWMIoOmbyppeZ4v5ilRq/nFteVSxrFZ/V1FYQNX37hd9GBjkCyz5Dfj7CWz6aN/Dsfq +dHQOISSznL2nigvzGlw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oWK2N-005Ycd-Br; Thu, 08 Sep 2022 16:05:55 +0000 Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oWK2K-005YaN-5e for linux-arm-kernel@lists.infradead.org; Thu, 08 Sep 2022 16:05:53 +0000 Received: by mail-lf1-x131.google.com with SMTP id u18so16219405lfo.8 for ; Thu, 08 Sep 2022 09:05:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date; bh=jAEzEWGfThUgGqQnHMOL1f5To09yVbEuEWo/Ad2g1YE=; b=c/Ng0z6ssSxi+cpYifD3Vfr1VP3RANTiQEUR6gMXz5q7H52V/1QlW79+sQxsIsnigc ko+17v26gBwHYzcLiMjPH2aeVRBIJDBsQCgekYeDxDc8yQjoMJJnetu0CXNni8QVpQAf aPxxKuLWxU4TG2mZbhutLQV1TAFVwbZDs7ZFnLI2vob89qKTzWOYITOUKDPfhnySnsgA 6FxC/bofZVHS8qp3Ae+yiikz+7+OMxW5p2gg7qtot7Xw4JADqKB4J63ijWi8A26ndVVa zIj6435QZQdKw4GcFpwHOYXSaK1Aexsw58IdCoCqwhrYXC0eAhLxkRBsUV4QZnQV8lpU CVVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date; bh=jAEzEWGfThUgGqQnHMOL1f5To09yVbEuEWo/Ad2g1YE=; b=TuJSGXmLyNfJq8UIieeIzABldA+NNuqAFtWvc3TqOp41FnnOK5txfzxiz5ODGXiWw3 i4nl/6WUMNturjeDI1PmhhDalOCGZNrfoOO4akTifzInCgnk8PmAHDBMPoc5Lv+EC6xj dkWFO2OUAjEJfntlyFXwtyUpTyNOO/ClADxorsAyFFqgVBhuiw7OqWaJ19NCLcbKs3e0 jICQy+LPUQFuzAE5qVJc329EVJG+z9dYnhDuiyJNYQndy/OB2FGcDaSd3pQIxR0bQ6zN xvizq11z2uh7VQW2AOAiBCYEgiUwlaA/teQXtP+6t2y9sU55sLo8Xg9XrCvvbpWs27TF ZYGA== X-Gm-Message-State: ACgBeo14cT/Lqp7GZUm8YEVFGfti9XBkP1GPUwhXPhE+HTXg2mbligZ7 ZTN3agm+W9NB0HuzuiUTb86ysQ== X-Google-Smtp-Source: AA6agR6wR8uJbmz0AnOAI2ki1zJ4q03Vfc9sBBd2mOdp+EOPC5CGqg0mWL2FdJ3CzGHLAyt4QEZvEA== X-Received: by 2002:a05:6512:3765:b0:492:d076:9f77 with SMTP id z5-20020a056512376500b00492d0769f77mr2761185lft.247.1662653149752; Thu, 08 Sep 2022 09:05:49 -0700 (PDT) Received: from [192.168.0.21] (78-11-189-27.static.ip.netia.com.pl. [78.11.189.27]) by smtp.gmail.com with ESMTPSA id k14-20020ac257ce000000b00490b5f09973sm241752lfo.92.2022.09.08.09.05.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Sep 2022 09:05:48 -0700 (PDT) Message-ID: <17d142eb-80c1-0aa5-c4fa-a8e4ccd97f08@linaro.org> Date: Thu, 8 Sep 2022 18:05:47 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 Subject: Re: [PATCH v2 05/13] dt-bindings: serial: atmel,at91-usart: convert to json-schema Content-Language: en-US To: Sergiu.Moga@microchip.com, lee@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, Nicolas.Ferre@microchip.com, alexandre.belloni@bootlin.com, Claudiu.Beznea@microchip.com, richard.genoud@gmail.com, radu_nicolae.pirea@upb.ro, gregkh@linuxfoundation.org, broonie@kernel.org, mturquette@baylibre.com, sboyd@kernel.org, jirislaby@kernel.org, admin@hifiphile.com, Kavyasree.Kotagiri@microchip.com, Tudor.Ambarus@microchip.com Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, linux-serial@vger.kernel.org, linux-clk@vger.kernel.org References: <20220906135511.144725-1-sergiu.moga@microchip.com> <20220906135511.144725-6-sergiu.moga@microchip.com> <1d3904d9-7fec-2e61-f999-61b89c4becb6@linaro.org> <753d73d0-44b9-9fba-1ed8-53691ecf2ee7@microchip.com> From: Krzysztof Kozlowski In-Reply-To: <753d73d0-44b9-9fba-1ed8-53691ecf2ee7@microchip.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220908_090552_276759_BBB6C7D9 X-CRM114-Status: GOOD ( 23.43 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 08/09/2022 17:27, Sergiu.Moga@microchip.com wrote: > On 08.09.2022 18:10, Krzysztof Kozlowski wrote: >> On 08/09/2022 17:06, Sergiu.Moga@microchip.com wrote: >>> On 08.09.2022 15:29, Krzysztof Kozlowski wrote: >> >>>>> +required: >>>>> + - compatible >>>>> + - reg >>>>> + - interrupts >>>>> + - clock-names >>>>> + - clocks >>>>> + >>>>> +allOf: >>>>> + - if: >>>>> + properties: >>>>> + $nodename: >>>>> + pattern: "^serial@[0-9a-f]+$" >>>> >>>> You should rather check value of atmel,usart-mode, because now you won't >>>> properly match device nodes called "foobar". Since usart-mode has only >>>> two possible values, this will nicely simplify you if-else. >>>> >>>> >>> >>> >>> I did think of that but the previous binding specifies that >>> atmel,usart-mode is required only for the SPI mode and it is optional >>> for the USART mode. That is why I went for the node's regex since I >>> thought it is something that both nodes would have. >> >> I think it should be explicit - you configure node either to this or >> that, so the property should be always present. > > > > No DT of ours has that property atm, since they are all on USART mode by > default. If I were to make it required. all nodes would fail so I would > have to add it to each of them. Which is a problem because...? Have in mind that bindings can be changed. ABI here won't be broken. > > > > >> The node name should not >> be responsible for it, even though we want node names to match certain >> patterns. >> > > > Does checkig for the node's pattern not make it better then? Since it > imposes an additional check? Not really, because if it is "foobar" your schema would not be applied correctly. > If it would not have a conventional > pattern, it would fail through unevaluatedProperies:false at the end, > since it would have properties that were contained inside a branch that > the validation of the node would not have gone through since it contains > a pattern that does not match the conditions of that branch. Not for properties which are for example missing... Best regards, Krzysztof _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel