diff options
author | Sven Van Asbroeck <svendev@arcx.com> | 2017-12-20 11:48:56 -0500 |
---|---|---|
committer | Bartosz Golaszewski <brgl@bgdev.pl> | 2018-01-01 19:40:49 +0100 |
commit | b680f4fa74496ac01e0f77e612a16d1ea892fd2a (patch) | |
tree | 22eb7340409700266e7ac2d2f63dc61c147f9f3e /drivers/misc/bh1770glc.c | |
parent | eef6939849b04bb1ba36f35f5c864eb0a66d1d83 (diff) | |
download | linux-b680f4fa74496ac01e0f77e612a16d1ea892fd2a.tar.gz linux-b680f4fa74496ac01e0f77e612a16d1ea892fd2a.tar.bz2 linux-b680f4fa74496ac01e0f77e612a16d1ea892fd2a.zip |
eeprom: at24: convert magic numbers to structs
Fundamental properties such as capacity and page size differ among
at24-type chips. But these chips do not have an id register, so this
can't be discovered at runtime.
Traditionally, at24-type eeprom properties were determined in two ways:
- by passing a 'struct at24_platform_data' via platform_data, or
- by naming the chip type in the devicetree, which passes a 'magic
number' to probe(), which is then converted to a 'struct
at24_platform_data'.
Recently a bug was discovered because the magic number rounds down all
chip sizes to the lowest power of two. This was addressed by
a work-around commit 5478e478eee3 ("eeprom: at24: correctly set the
size for at24mac402"), with the wish that magic numbers should over
time be converted to structs.
This patch replaces the magic numbers with 'struct at24_chip_data'.
Signed-off-by: Sven Van Asbroeck <svendev@arcx.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Diffstat (limited to 'drivers/misc/bh1770glc.c')
0 files changed, 0 insertions, 0 deletions