Skip to content

Commit 8d3fd7e

Browse files
bijudaslag-linaro
authored andcommitted
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 <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lee Jones <[email protected]>
1 parent 3b581cb commit 8d3fd7e

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

drivers/leds/leds-pca955x.c

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -104,16 +104,6 @@ static const struct pca955x_chipdef pca955x_chipdefs[] = {
104104
},
105105
};
106106

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-
117107
struct pca955x {
118108
struct mutex lock;
119109
struct pca955x_led *leds;
@@ -457,16 +447,6 @@ pca955x_get_pdata(struct i2c_client *client, const struct pca955x_chipdef *chip)
457447
return pdata;
458448
}
459449

460-
static const struct of_device_id of_pca955x_match[] = {
461-
{ .compatible = "nxp,pca9550", .data = &pca955x_chipdefs[pca9550] },
462-
{ .compatible = "nxp,pca9551", .data = &pca955x_chipdefs[pca9551] },
463-
{ .compatible = "nxp,pca9552", .data = &pca955x_chipdefs[pca9552] },
464-
{ .compatible = "ibm,pca9552", .data = &pca955x_chipdefs[ibm_pca9552] },
465-
{ .compatible = "nxp,pca9553", .data = &pca955x_chipdefs[pca9553] },
466-
{},
467-
};
468-
MODULE_DEVICE_TABLE(of, of_pca955x_match);
469-
470450
static int pca955x_probe(struct i2c_client *client)
471451
{
472452
struct pca955x *pca955x;
@@ -650,6 +630,26 @@ static int pca955x_probe(struct i2c_client *client)
650630
return 0;
651631
}
652632

633+
static const struct i2c_device_id pca955x_id[] = {
634+
{ "pca9550", (kernel_ulong_t)&pca955x_chipdefs[pca9550] },
635+
{ "pca9551", (kernel_ulong_t)&pca955x_chipdefs[pca9551] },
636+
{ "pca9552", (kernel_ulong_t)&pca955x_chipdefs[pca9552] },
637+
{ "ibm-pca9552", (kernel_ulong_t)&pca955x_chipdefs[ibm_pca9552] },
638+
{ "pca9553", (kernel_ulong_t)&pca955x_chipdefs[pca9553] },
639+
{}
640+
};
641+
MODULE_DEVICE_TABLE(i2c, pca955x_id);
642+
643+
static const struct of_device_id of_pca955x_match[] = {
644+
{ .compatible = "nxp,pca9550", .data = &pca955x_chipdefs[pca9550] },
645+
{ .compatible = "nxp,pca9551", .data = &pca955x_chipdefs[pca9551] },
646+
{ .compatible = "nxp,pca9552", .data = &pca955x_chipdefs[pca9552] },
647+
{ .compatible = "ibm,pca9552", .data = &pca955x_chipdefs[ibm_pca9552] },
648+
{ .compatible = "nxp,pca9553", .data = &pca955x_chipdefs[pca9553] },
649+
{}
650+
};
651+
MODULE_DEVICE_TABLE(of, of_pca955x_match);
652+
653653
static struct i2c_driver pca955x_driver = {
654654
.driver = {
655655
.name = "leds-pca955x",

0 commit comments

Comments
 (0)