Thread (1 message) 1 message, 1 author, 2017-12-08

Re: [PATCH v1 1/2] eeprom: at24: convert magic numbers to structs.

From: Bartosz Golaszewski <hidden>
Date: 2017-12-08 15:32:40
Also in: linux-i2c, lkml

2017-12-08 16:25 GMT+01:00 Sven Van Asbroeck [off-list ref]:
Bartosz wrote:
quoted
Just make it accept two parameters: the string and the data object
name. For example:
AT24_OF_DEVICE_ID("atmel,24c01", 24c01);
quoted
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
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help