Skip to content

Commit 8fd8f94

Browse files
elkablopavelmachek
authored andcommitted
leds: ns2: do not guard OF match pointer with of_match_ptr
Do not match OF match pointer with of_match_ptr, so that even if CONFIG_OF is disabled, the driver can still be bound via another method. Move definition of of_ns2_leds_match just before ns2_led_driver definition, since it is not needed sooner. Signed-off-by: Marek Behún <[email protected]> Tested-by: Simon Guinot <[email protected]> Signed-off-by: Pavel Machek <[email protected]>
1 parent 940cca1 commit 8fd8f94

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

drivers/leds/leds-ns2.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -235,12 +235,6 @@ static int ns2_led_register(struct device *dev, struct fwnode_handle *node,
235235
return ret;
236236
}
237237

238-
static const struct of_device_id of_ns2_leds_match[] = {
239-
{ .compatible = "lacie,ns2-leds", },
240-
{},
241-
};
242-
MODULE_DEVICE_TABLE(of, of_ns2_leds_match);
243-
244238
static int ns2_led_probe(struct platform_device *pdev)
245239
{
246240
struct device *dev = &pdev->dev;
@@ -268,11 +262,17 @@ static int ns2_led_probe(struct platform_device *pdev)
268262
return 0;
269263
}
270264

265+
static const struct of_device_id of_ns2_leds_match[] = {
266+
{ .compatible = "lacie,ns2-leds", },
267+
{},
268+
};
269+
MODULE_DEVICE_TABLE(of, of_ns2_leds_match);
270+
271271
static struct platform_driver ns2_led_driver = {
272272
.probe = ns2_led_probe,
273273
.driver = {
274274
.name = "leds-ns2",
275-
.of_match_table = of_match_ptr(of_ns2_leds_match),
275+
.of_match_table = of_ns2_leds_match,
276276
},
277277
};
278278

0 commit comments

Comments
 (0)