[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CAMRc=Mc1tJO6EhNQ=SiA3uUPL6u3x-1otiCX4ohwZ5mX=g5qGQ@mail.gmail.com>
Date: Fri, 8 Dec 2017 16:32:33 +0100
From: Bartosz Golaszewski <brgl@...ev.pl>
To: Sven Van Asbroeck <thesven73@...il.com>
Cc: Sven Van Asbroeck <svendev@...x.com>,
Wolfram Sang <wsa@...-dreams.de>, nsekhar@...com,
Sakari Ailus <sakari.ailus@...ux.intel.com>,
Javier Martinez Canillas <javier@...hile0.org>,
Divagar Mohandass <divagar.mohandass@...el.com>,
devicetree@...r.kernel.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-i2c <linux-i2c@...r.kernel.org>
Subject: Re: [PATCH v1 1/2] eeprom: at24: convert magic numbers to structs.
2017-12-08 16:25 GMT+01:00 Sven Van Asbroeck <thesven73@...il.com>:
> Bartosz wrote:
>>
>> Just make it accept two parameters: the string and the data object
>> name. For example:
>>
>>
> AT24_OF_DEVICE_ID("atmel,24c01", 24c01);
>>
>
> I don't want to do too much bikeshedding,
> but one last comment.
>
> Is it a good idea to have duplicated information?
> Do you think the risk of a typo mismatch is acceptable? E.g.
> AT24_OF_DEVICE_ID("atmel,24c01", 24c0
> 2
> );
> At least the original syntax is not susceptible to this problem,
> but of course as you say, it hides the of_ compatible string:
> AT24_OF_DEVICE_ID(atmel, 24c01);
> /* hides 'atmel,24c01' */
>
> Pros and cons. Pick one.
Nah, there aren't like two thousand compatible chips so that a mistake
would go unnoticed.
Bartosz
Powered by blists - more mailing lists