Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

leds: lp5521: Properly setup of_device_id table

Don't mix of_device_id entry in i2c_device_id table.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bryan Wu <cooloney@gmail.com>

authored by

Axel Lin and committed by
Bryan Wu
b548a34b e015050c

+9 -1
+9 -1
drivers/leds/leds-lp5521.c
··· 490 490 491 491 static const struct i2c_device_id lp5521_id[] = { 492 492 { "lp5521", 0 }, /* Three channel chip */ 493 - { "national,lp5521", 0 }, /* OF compatible */ 494 493 { } 495 494 }; 496 495 MODULE_DEVICE_TABLE(i2c, lp5521_id); 497 496 497 + #ifdef CONFIG_OF 498 + static const struct of_device_id of_lp5521_leds_match[] = { 499 + { .compatible = "national,lp5521", }, 500 + {}, 501 + }; 502 + 503 + MODULE_DEVICE_TABLE(of, of_lp5521_leds_match); 504 + #endif 498 505 static struct i2c_driver lp5521_driver = { 499 506 .driver = { 500 507 .name = "lp5521", 508 + .of_match_table = of_match_ptr(of_lp5521_leds_match), 501 509 }, 502 510 .probe = lp5521_probe, 503 511 .remove = lp5521_remove,