devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: <Andrei.Simion@microchip.com>
To: <conor@kernel.org>
Cc: <brgl@bgdev.pl>, <robh@kernel.org>, <krzk+dt@kernel.org>,
	<conor+dt@kernel.org>, <Nicolas.Ferre@microchip.com>,
	<alexandre.belloni@bootlin.com>, <claudiu.beznea@tuxon.dev>,
	<arnd@arndb.de>, <gregkh@linuxfoundation.org>,
	<linux-i2c@vger.kernel.org>, <devicetree@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 3/3] dt-bindings: eeprom: at24: Add at24,mac02e4 and at24,mac02e6
Date: Thu, 20 Jun 2024 10:45:58 +0000	[thread overview]
Message-ID: <0d57b14b-48d1-4629-92f4-74934c6ecdeb@microchip.com> (raw)
In-Reply-To: <20240619-thee-herald-82725e1526e2@spud>

On 19.06.2024 20:53, Conor Dooley wrote:
>> Update regex check and add pattern to match both EEPROMs.
>>
>> Signed-off-by: Andrei Simion <andrei.simion@microchip.com>
>> ---
>>  Documentation/devicetree/bindings/eeprom/at24.yaml | 10 +++++++---
>>  1 file changed, 7 insertions(+), 3 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/eeprom/at24.yaml b/Documentation/devicetree/bindings/eeprom/at24.yaml
>> index 3c36cd0510de..46daa662f6e7 100644
>> --- a/Documentation/devicetree/bindings/eeprom/at24.yaml
>> +++ b/Documentation/devicetree/bindings/eeprom/at24.yaml
>> @@ -18,7 +18,7 @@ select:
>>    properties:
>>      compatible:
>>        contains:
>> -        pattern: "^atmel,(24(c|cs|mac)[0-9]+|spd)$"
>> +        pattern: "^atmel,(24(c|cs|mac)[0-9]+[a-z0-9]*|spd)$"

> Could we relax the pattern instead to make this bloat less? Would it be
> problematic to just allow "^atmel,(24(c|cs|mac)[a-z0-9]+|spd)$"?

I) "^atmel,(24(c|cs|mac)[a-z0-9]+|spd)$" :
The first pattern does not specify where the digits must occur within the alphanumeric sequence that follows 24c, 24cs, or 24mac. It allows the sequence to be all letters, all digits, or any mix thereof.

II) "^atmel,(24(c|cs|mac)[0-9]+[a-z0-9]*|spd)$" :
The second pattern specifically requires that at least one digit appears immediately after 24c, 24cs, or 24mac, and only after this digit can letters appear.

As hypothetical example :
atmel,24cabc would match the first pattern but not the second because there are no digits immediately following 24c.
atmel,24c123 would match both patterns because there are digits immediately following 24c, and the first pattern doesn't care about the position of the digits within the alphanumeric sequence.

In case of at24,mac02e4 and at24,mac02e6 match both patterns.

Let me know your thoughts.

I agree to change the pattern as you suggest.

BR,
Andrei


  reply	other threads:[~2024-06-20 10:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-19  7:22 [PATCH 0/3] Read MAC address through NVMEM for sama7g5ek Andrei Simion
2024-06-19  7:22 ` [PATCH 1/3] eeprom: at24: avoid adjusting offset for 24AA025E{48, 64} Andrei Simion
2024-06-19  7:22 ` [PATCH 2/3] ARM: dts: at91: at91-sama7g5ek: add EEPROMs Andrei Simion
2024-06-20  6:28   ` kernel test robot
2024-06-19  7:22 ` [PATCH 3/3] dt-bindings: eeprom: at24: Add at24,mac02e4 and at24,mac02e6 Andrei Simion
2024-06-19 17:53   ` Conor Dooley
2024-06-20 10:45     ` Andrei.Simion [this message]
2024-06-20 11:10       ` Conor Dooley

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=0d57b14b-48d1-4629-92f4-74934c6ecdeb@microchip.com \
    --to=andrei.simion@microchip.com \
    --cc=Nicolas.Ferre@microchip.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=arnd@arndb.de \
    --cc=brgl@bgdev.pl \
    --cc=claudiu.beznea@tuxon.dev \
    --cc=conor+dt@kernel.org \
    --cc=conor@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    /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 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).