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

leds: pca955x: Cleanup OF/ID table terminators

Some cleanups:
* Remove the trailing comma in the terminator entry for the OF
table making code robust against (theoretical) misrebases or other
similar things where the new entry goes _after_ the termination without
the compiler noticing.
* Drop a space from terminator entry for ID table.

While at it, move OF/ID table near to the user.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230923171921.53503-3-biju.das.jz@bp.renesas.com
Signed-off-by: Lee Jones <lee@kernel.org>

authored by

Biju Das and committed by
Lee Jones
8d3fd7ed 3b581cb5

+20 -20
+20 -20
drivers/leds/leds-pca955x.c
··· 104 104 }, 105 105 }; 106 106 107 - static const struct i2c_device_id pca955x_id[] = { 108 - { "pca9550", (kernel_ulong_t)&pca955x_chipdefs[pca9550] }, 109 - { "pca9551", (kernel_ulong_t)&pca955x_chipdefs[pca9551] }, 110 - { "pca9552", (kernel_ulong_t)&pca955x_chipdefs[pca9552] }, 111 - { "ibm-pca9552", (kernel_ulong_t)&pca955x_chipdefs[ibm_pca9552] }, 112 - { "pca9553", (kernel_ulong_t)&pca955x_chipdefs[pca9553] }, 113 - { } 114 - }; 115 - MODULE_DEVICE_TABLE(i2c, pca955x_id); 116 - 117 107 struct pca955x { 118 108 struct mutex lock; 119 109 struct pca955x_led *leds; ··· 447 457 return pdata; 448 458 } 449 459 450 - static const struct of_device_id of_pca955x_match[] = { 451 - { .compatible = "nxp,pca9550", .data = &pca955x_chipdefs[pca9550] }, 452 - { .compatible = "nxp,pca9551", .data = &pca955x_chipdefs[pca9551] }, 453 - { .compatible = "nxp,pca9552", .data = &pca955x_chipdefs[pca9552] }, 454 - { .compatible = "ibm,pca9552", .data = &pca955x_chipdefs[ibm_pca9552] }, 455 - { .compatible = "nxp,pca9553", .data = &pca955x_chipdefs[pca9553] }, 456 - {}, 457 - }; 458 - MODULE_DEVICE_TABLE(of, of_pca955x_match); 459 - 460 460 static int pca955x_probe(struct i2c_client *client) 461 461 { 462 462 struct pca955x *pca955x; ··· 629 649 630 650 return 0; 631 651 } 652 + 653 + static const struct i2c_device_id pca955x_id[] = { 654 + { "pca9550", (kernel_ulong_t)&pca955x_chipdefs[pca9550] }, 655 + { "pca9551", (kernel_ulong_t)&pca955x_chipdefs[pca9551] }, 656 + { "pca9552", (kernel_ulong_t)&pca955x_chipdefs[pca9552] }, 657 + { "ibm-pca9552", (kernel_ulong_t)&pca955x_chipdefs[ibm_pca9552] }, 658 + { "pca9553", (kernel_ulong_t)&pca955x_chipdefs[pca9553] }, 659 + {} 660 + }; 661 + MODULE_DEVICE_TABLE(i2c, pca955x_id); 662 + 663 + static const struct of_device_id of_pca955x_match[] = { 664 + { .compatible = "nxp,pca9550", .data = &pca955x_chipdefs[pca9550] }, 665 + { .compatible = "nxp,pca9551", .data = &pca955x_chipdefs[pca9551] }, 666 + { .compatible = "nxp,pca9552", .data = &pca955x_chipdefs[pca9552] }, 667 + { .compatible = "ibm,pca9552", .data = &pca955x_chipdefs[ibm_pca9552] }, 668 + { .compatible = "nxp,pca9553", .data = &pca955x_chipdefs[pca9553] }, 669 + {} 670 + }; 671 + MODULE_DEVICE_TABLE(of, of_pca955x_match); 632 672 633 673 static struct i2c_driver pca955x_driver = { 634 674 .driver = {