Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753543AbdLHNKo (ORCPT ); Fri, 8 Dec 2017 08:10:44 -0500 Received: from mail-ot0-f194.google.com ([74.125.82.194]:41024 "EHLO mail-ot0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752895AbdLHNKm (ORCPT ); Fri, 8 Dec 2017 08:10:42 -0500 X-Google-Smtp-Source: AGs4zMYniK36dFp2NiwgpxBpb/HDe8cqovRv26mfz8+8Ww4bjWYaH+6Unsdu3vxGHfBlmmOKnARj7Qf8piANfcFZskQ= MIME-Version: 1.0 In-Reply-To: References: <20171206101219.14011-1-brgl@bgdev.pl> <20171207225045.tm3rnyjaylx46nxy@rob-hp-laptop> From: Bartosz Golaszewski Date: Fri, 8 Dec 2017 14:10:40 +0100 Message-ID: Subject: Re: [PATCH] dt-bindings: at24/eeprom: add an undocumented compatible string To: Javier Martinez Canillas Cc: Rob Herring , Mark Rutland , Wolfram Sang , Divagar Mohandass , David Lechner , "devicetree@vger.kernel.org" , Linux Kernel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3327 Lines: 89 2017-12-08 1:03 GMT+01:00 Javier Martinez Canillas : > Hello Rob and Bartosz, > > On Thu, Dec 7, 2017 at 11:50 PM, Rob Herring wrote: >> On Wed, Dec 06, 2017 at 11:12:19AM +0100, Bartosz Golaszewski wrote: >>> The "atmel,sdp" compatible is reported by checkpatch as undocumented. >>> >>> Add it to the device tree bindings document for at24. >>> >>> Signed-off-by: Bartosz Golaszewski >>> --- >>> Documentation/devicetree/bindings/eeprom/eeprom.txt | 2 ++ >>> 1 file changed, 2 insertions(+) >> >> Reviewed-by: Rob Herring > > My understanding is that DT bindings not necessarily have to list all > the possible compatible strings but can also document a set > comprehension of the possible values. If that's the case, then I > disagree with this patch and I think that this is caused by a > checkpatch limitation. > > In the case of the Atmel EEPROM DT binding, it was quite lax at > describing the possible compatible strings. It just used to say: > > - compatible : should be ",", like these: > > Followed by a list of _possible_ compatible strings. So these were > just examples, it was by no means a comprehensive list. > I couldn't find any info on that policy, but I would prefer as the maintainer that this change and that we list all the compatibles in the bindings explicitly. > And then it used to say: > > If there is no specific driver for , a generic driver > based on is selected. Possible types are: > "24c00", "24c01", "24c02", "24c04", "24c08", "24c16", "24c32", > "24c64", "24c128", "24c256", "24c512", "24c1024", "spd" > > Which basically said that it was valid to only match using the device > model but not the vendor part of the compatible string. This is > obviously incorrect and only worked due a implementation detail in the > I2C core. > Indeed. > After some discussions, the DT binding was changed to say the following: > > If there is no specific driver for , a generic device > with and manufacturer "atmel" should be used. Possible types > are: > "24c00", "24c01", "24c02", "24c04", "24c08", "24c16", "24c32", > "24c64", "24c128", "24c256", "24c512", "24c1024", "spd" > This basically says the same as the first part of the list of compatibles above. > And the driver changed accordingly to honor these. Old DTBs just using > "24c08" or "microchip,24c08" should still work, but the correct thing > to do now is to use "atmel,24c08". > Maybe we could start converting all the incorrect compatibles? I only found 19 occurrences in the tree. > The "spd" is in the list mentioned above, so the "atmel,spd" > isn't documented as the $SUBJECT commit message says. In any case, > what could be done is to instead reword the DT binding to list all the > valid "atmel," combinations. > Yes, I believe this is correct. I'd like to just list all the accepted compatibles and possibly mention the fact that old, incorrect compatible strings still work, but will not be accepted anymore in the tree. > I didn't do that in my patch since it originally said "Possibles types > are", not "all the possible types are" so it wasn't clear to me if > there were other undocumented that were still valid. > I'll send a new patch. Thanks, Bartosz