Skip to content

Commit

Permalink
leds: Remove redundant of_match_ptr()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
PeterZhu789 authored and lag-linaro committed Aug 17, 2023
1 parent 4aa8f7e commit 3d590af
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 14 deletions.
2 changes: 1 addition & 1 deletion drivers/leds/leds-an30259a.c
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ MODULE_DEVICE_TABLE(i2c, an30259a_id);
static struct i2c_driver an30259a_driver = {
.driver = {
.name = "leds-an30259a",
.of_match_table = of_match_ptr(an30259a_match_table),
.of_match_table = an30259a_match_table,
},
.probe = an30259a_probe,
.remove = an30259a_remove,
Expand Down
2 changes: 1 addition & 1 deletion drivers/leds/leds-aw2013.c
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ MODULE_DEVICE_TABLE(of, aw2013_match_table);
static struct i2c_driver aw2013_driver = {
.driver = {
.name = "leds-aw2013",
.of_match_table = of_match_ptr(aw2013_match_table),
.of_match_table = aw2013_match_table,
},
.probe = aw2013_probe,
.remove = aw2013_remove,
Expand Down
5 changes: 2 additions & 3 deletions drivers/leds/leds-lp5521.c
Original file line number Diff line number Diff line change
Expand Up @@ -594,18 +594,17 @@ static const struct i2c_device_id lp5521_id[] = {
};
MODULE_DEVICE_TABLE(i2c, lp5521_id);

#ifdef CONFIG_OF
static const struct of_device_id of_lp5521_leds_match[] = {
{ .compatible = "national,lp5521", },
{},
};

MODULE_DEVICE_TABLE(of, of_lp5521_leds_match);
#endif

static struct i2c_driver lp5521_driver = {
.driver = {
.name = "lp5521",
.of_match_table = of_match_ptr(of_lp5521_leds_match),
.of_match_table = of_lp5521_leds_match,
},
.probe = lp5521_probe,
.remove = lp5521_remove,
Expand Down
4 changes: 1 addition & 3 deletions drivers/leds/leds-lp5523.c
Original file line number Diff line number Diff line change
Expand Up @@ -972,20 +972,18 @@ static const struct i2c_device_id lp5523_id[] = {

MODULE_DEVICE_TABLE(i2c, lp5523_id);

#ifdef CONFIG_OF
static const struct of_device_id of_lp5523_leds_match[] = {
{ .compatible = "national,lp5523", },
{ .compatible = "ti,lp55231", },
{},
};

MODULE_DEVICE_TABLE(of, of_lp5523_leds_match);
#endif

static struct i2c_driver lp5523_driver = {
.driver = {
.name = "lp5523x",
.of_match_table = of_match_ptr(of_lp5523_leds_match),
.of_match_table = of_lp5523_leds_match,
},
.probe = lp5523_probe,
.remove = lp5523_remove,
Expand Down
4 changes: 1 addition & 3 deletions drivers/leds/leds-lp5562.c
Original file line number Diff line number Diff line change
Expand Up @@ -589,19 +589,17 @@ static const struct i2c_device_id lp5562_id[] = {
};
MODULE_DEVICE_TABLE(i2c, lp5562_id);

#ifdef CONFIG_OF
static const struct of_device_id of_lp5562_leds_match[] = {
{ .compatible = "ti,lp5562", },
{},
};

MODULE_DEVICE_TABLE(of, of_lp5562_leds_match);
#endif

static struct i2c_driver lp5562_driver = {
.driver = {
.name = "lp5562",
.of_match_table = of_match_ptr(of_lp5562_leds_match),
.of_match_table = of_lp5562_leds_match,
},
.probe = lp5562_probe,
.remove = lp5562_remove,
Expand Down
4 changes: 1 addition & 3 deletions drivers/leds/leds-lp8501.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,19 +380,17 @@ static const struct i2c_device_id lp8501_id[] = {
};
MODULE_DEVICE_TABLE(i2c, lp8501_id);

#ifdef CONFIG_OF
static const struct of_device_id of_lp8501_leds_match[] = {
{ .compatible = "ti,lp8501", },
{},
};

MODULE_DEVICE_TABLE(of, of_lp8501_leds_match);
#endif

static struct i2c_driver lp8501_driver = {
.driver = {
.name = "lp8501",
.of_match_table = of_match_ptr(of_lp8501_leds_match),
.of_match_table = of_lp8501_leds_match,
},
.probe = lp8501_probe,
.remove = lp8501_remove,
Expand Down

0 comments on commit 3d590af

Please sign in to comment.