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

leds: Remove redundant of_match_ptr()

The driver depends on CONFIG_OF, so it is not necessary to use
of_match_ptr() here. We remove both CONFIG_OF and of_match_ptr() here.

Signed-off-by: Zhu Wang <wangzhu9@huawei.com>
Link: https://lore.kernel.org/r/20230808111108.24262-1-wangzhu9@huawei.com
Signed-off-by: Lee Jones <lee@kernel.org>

authored by

Zhu Wang and committed by
Lee Jones
3d590af8 4aa8f7e2

+7 -14
+1 -1
drivers/leds/leds-an30259a.c
··· 344 344 static struct i2c_driver an30259a_driver = { 345 345 .driver = { 346 346 .name = "leds-an30259a", 347 - .of_match_table = of_match_ptr(an30259a_match_table), 347 + .of_match_table = an30259a_match_table, 348 348 }, 349 349 .probe = an30259a_probe, 350 350 .remove = an30259a_remove,
+1 -1
drivers/leds/leds-aw2013.c
··· 420 420 static struct i2c_driver aw2013_driver = { 421 421 .driver = { 422 422 .name = "leds-aw2013", 423 - .of_match_table = of_match_ptr(aw2013_match_table), 423 + .of_match_table = aw2013_match_table, 424 424 }, 425 425 .probe = aw2013_probe, 426 426 .remove = aw2013_remove,
+2 -3
drivers/leds/leds-lp5521.c
··· 594 594 }; 595 595 MODULE_DEVICE_TABLE(i2c, lp5521_id); 596 596 597 - #ifdef CONFIG_OF 598 597 static const struct of_device_id of_lp5521_leds_match[] = { 599 598 { .compatible = "national,lp5521", }, 600 599 {}, 601 600 }; 602 601 603 602 MODULE_DEVICE_TABLE(of, of_lp5521_leds_match); 604 - #endif 603 + 605 604 static struct i2c_driver lp5521_driver = { 606 605 .driver = { 607 606 .name = "lp5521", 608 - .of_match_table = of_match_ptr(of_lp5521_leds_match), 607 + .of_match_table = of_lp5521_leds_match, 609 608 }, 610 609 .probe = lp5521_probe, 611 610 .remove = lp5521_remove,
+1 -3
drivers/leds/leds-lp5523.c
··· 972 972 973 973 MODULE_DEVICE_TABLE(i2c, lp5523_id); 974 974 975 - #ifdef CONFIG_OF 976 975 static const struct of_device_id of_lp5523_leds_match[] = { 977 976 { .compatible = "national,lp5523", }, 978 977 { .compatible = "ti,lp55231", }, ··· 979 980 }; 980 981 981 982 MODULE_DEVICE_TABLE(of, of_lp5523_leds_match); 982 - #endif 983 983 984 984 static struct i2c_driver lp5523_driver = { 985 985 .driver = { 986 986 .name = "lp5523x", 987 - .of_match_table = of_match_ptr(of_lp5523_leds_match), 987 + .of_match_table = of_lp5523_leds_match, 988 988 }, 989 989 .probe = lp5523_probe, 990 990 .remove = lp5523_remove,
+1 -3
drivers/leds/leds-lp5562.c
··· 589 589 }; 590 590 MODULE_DEVICE_TABLE(i2c, lp5562_id); 591 591 592 - #ifdef CONFIG_OF 593 592 static const struct of_device_id of_lp5562_leds_match[] = { 594 593 { .compatible = "ti,lp5562", }, 595 594 {}, 596 595 }; 597 596 598 597 MODULE_DEVICE_TABLE(of, of_lp5562_leds_match); 599 - #endif 600 598 601 599 static struct i2c_driver lp5562_driver = { 602 600 .driver = { 603 601 .name = "lp5562", 604 - .of_match_table = of_match_ptr(of_lp5562_leds_match), 602 + .of_match_table = of_lp5562_leds_match, 605 603 }, 606 604 .probe = lp5562_probe, 607 605 .remove = lp5562_remove,
+1 -3
drivers/leds/leds-lp8501.c
··· 380 380 }; 381 381 MODULE_DEVICE_TABLE(i2c, lp8501_id); 382 382 383 - #ifdef CONFIG_OF 384 383 static const struct of_device_id of_lp8501_leds_match[] = { 385 384 { .compatible = "ti,lp8501", }, 386 385 {}, 387 386 }; 388 387 389 388 MODULE_DEVICE_TABLE(of, of_lp8501_leds_match); 390 - #endif 391 389 392 390 static struct i2c_driver lp8501_driver = { 393 391 .driver = { 394 392 .name = "lp8501", 395 - .of_match_table = of_match_ptr(of_lp8501_leds_match), 393 + .of_match_table = of_lp8501_leds_match, 396 394 }, 397 395 .probe = lp8501_probe, 398 396 .remove = lp8501_remove,