mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 02:00:54 +07:00
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 <kabel@kernel.org> Tested-by: Simon Guinot <simon.guinot@sequanux.org> Signed-off-by: Pavel Machek <pavel@ucw.cz>
This commit is contained in:
parent
940cca1ab5
commit
8fd8f94235
@ -235,12 +235,6 @@ static int ns2_led_register(struct device *dev, struct fwnode_handle *node,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct of_device_id of_ns2_leds_match[] = {
|
|
||||||
{ .compatible = "lacie,ns2-leds", },
|
|
||||||
{},
|
|
||||||
};
|
|
||||||
MODULE_DEVICE_TABLE(of, of_ns2_leds_match);
|
|
||||||
|
|
||||||
static int ns2_led_probe(struct platform_device *pdev)
|
static int ns2_led_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct device *dev = &pdev->dev;
|
struct device *dev = &pdev->dev;
|
||||||
@ -268,11 +262,17 @@ static int ns2_led_probe(struct platform_device *pdev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const struct of_device_id of_ns2_leds_match[] = {
|
||||||
|
{ .compatible = "lacie,ns2-leds", },
|
||||||
|
{},
|
||||||
|
};
|
||||||
|
MODULE_DEVICE_TABLE(of, of_ns2_leds_match);
|
||||||
|
|
||||||
static struct platform_driver ns2_led_driver = {
|
static struct platform_driver ns2_led_driver = {
|
||||||
.probe = ns2_led_probe,
|
.probe = ns2_led_probe,
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = "leds-ns2",
|
.name = "leds-ns2",
|
||||||
.of_match_table = of_match_ptr(of_ns2_leds_match),
|
.of_match_table = of_ns2_leds_match,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user