mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 16:44:58 +02:00
pinctrl: cy8c95x0: Eliminate fragile use of I²C ID table
The I²C ID table is a subject to new entries that may potentially break the order of the existing ones. Avoid this by using string literals for the chip naming. Note, linker will deduplicate same string literals and use only a single copy, hence it won't be the change in size in data section. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
This commit is contained in:
parent
a603cf701f
commit
04fcdb3a34
|
|
@ -1369,13 +1369,13 @@ static int cy8c95x0_detect(struct i2c_client *client,
|
|||
return ret;
|
||||
switch (ret & GENMASK(7, 4)) {
|
||||
case 0x20:
|
||||
name = cy8c95x0_id[0].name;
|
||||
name = "cy8c9520";
|
||||
break;
|
||||
case 0x40:
|
||||
name = cy8c95x0_id[1].name;
|
||||
name = "cy8c9540";
|
||||
break;
|
||||
case 0x60:
|
||||
name = cy8c95x0_id[2].name;
|
||||
name = "cy8c9560";
|
||||
break;
|
||||
default:
|
||||
return -ENODEV;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user