drivers: soc: atmel: add null entry at the end of at91_soc_allowed_list[]
authorClaudiu Beznea <claudiu.beznea@microchip.com>
Fri, 22 Jan 2021 12:21:34 +0000 (14:21 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Feb 2021 22:22:21 +0000 (23:22 +0100)
commit 680896556805d3ad3fa47f6002b87b3041a45ac2 upstream.

of_match_node() calls __of_match_node() which loops though the entries of
matches array. It stops when condition:
(matches->name[0] || matches->type[0] || matches->compatible[0]) is
false. Thus, add a null entry at the end of at91_soc_allowed_list[]
array.

Fixes: caab13b49604 ("drivers: soc: atmel: Avoid calling at91_soc_init on non AT91 SoCs")
Cc: stable@vger.kernel.org #4.12+
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/soc/atmel/soc.c

index 39aaaf2860998e61fa164c11fb65bf48dcfafa6f..c5e713dd10169db59f4530e91ec22da2c3d33477 100644 (file)
@@ -250,7 +250,8 @@ static const struct of_device_id at91_soc_allowed_list[] __initconst = {
        { .compatible = "atmel,at91rm9200", },
        { .compatible = "atmel,at91sam9", },
        { .compatible = "atmel,sama5", },
-       { .compatible = "atmel,samv7", }
+       { .compatible = "atmel,samv7", },
+       { }
 };
 
 static int __init atmel_soc_device_init(void)