]> git.baikalelectronics.ru Git - kernel.git/commitdiff
led: max77650: add of_match table
authorBartosz Golaszewski <bgolaszewski@baylibre.com>
Tue, 10 Dec 2019 10:08:32 +0000 (11:08 +0100)
committerPavel Machek <pavel@ucw.cz>
Wed, 22 Jan 2020 20:07:28 +0000 (21:07 +0100)
We need the of_match table if we want to use the compatible string in
the pmic's child node and get the led driver loaded automatically.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
drivers/leds/leds-max77650.c

index 4c2d0b3c6dadcc1492d2d25d5dc3a9f8d4480bde..a0d4b725c917801c31ba0f1beee5a5a366c944af 100644 (file)
@@ -135,9 +135,16 @@ err_node_put:
        return rv;
 }
 
+static const struct of_device_id max77650_led_of_match[] = {
+       { .compatible = "maxim,max77650-led" },
+       { }
+};
+MODULE_DEVICE_TABLE(of, max77650_led_of_match);
+
 static struct platform_driver max77650_led_driver = {
        .driver = {
                .name = "max77650-led",
+               .of_match_table = max77650_led_of_match,
        },
        .probe = max77650_led_probe,
 };