Skip to content

Commit 6a357c5

Browse files
sudeep-hollaksacilotto
authored andcommitted
drivers: soc: atmel: Avoid calling at91_soc_init on non AT91 SoCs
BugLink: https://bugs.launchpad.net/bugs/1916056 commit caab13b upstream. Since at91_soc_init is called unconditionally from atmel_soc_device_init, we get the following warning on all non AT91 SoCs: " AT91: Could not find identification node" Fix the same by filtering with allowed AT91 SoC list. Cc: Nicolas Ferre <[email protected]> Cc: Alexandre Belloni <[email protected]> Cc: Ludovic Desroches <[email protected]> Cc: [email protected] #4.12+ Signed-off-by: Sudeep Holla <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Kamal Mostafa <[email protected]> Signed-off-by: Stefan Bader <[email protected]>
1 parent 668fd82 commit 6a357c5

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

drivers/soc/atmel/soc.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,20 @@ struct soc_device * __init at91_soc_init(const struct at91_soc *socs)
264264
return soc_dev;
265265
}
266266

267+
static const struct of_device_id at91_soc_allowed_list[] __initconst = {
268+
{ .compatible = "atmel,at91rm9200", },
269+
{ .compatible = "atmel,at91sam9", },
270+
{ .compatible = "atmel,sama5", },
271+
{ .compatible = "atmel,samv7", }
272+
};
273+
267274
static int __init atmel_soc_device_init(void)
268275
{
276+
struct device_node *np = of_find_node_by_path("/");
277+
278+
if (!of_match_node(at91_soc_allowed_list, np))
279+
return 0;
280+
269281
at91_soc_init(socs);
270282

271283
return 0;

0 commit comments

Comments
 (0)