Skip to contentSkip to conversation

memory: tegra: include linux/spinlock.h

PATCH In review Arnd Bergmann 2 participants 2 messages May 25, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 memory: tegra: include linux/spinlock.h

The newly added code in this file causes a build error unless we include linux/spinlock.h, at least in some configurations:

In file included from drivers/memory/tegra/mc.h:15,

                 from drivers/memory/tegra/tegra20.c:11:

include/soc/tegra/mc.h:159:2: error: unknown type name 'spinlock_t'
spinlock_t lock;
^~~~~~~~~~
drivers/memory/tegra/tegra20.c: In function 'terga20_mc_hotreset_assert':
drivers/memory/tegra/tegra20.c:207:2: error: implicit declaration of function 'spin_lock_irqsave'; did you mean 'arch_local_irq_save'? [-Werror=implicit-function-declaration]
spin_lock_irqsave(&mc->lock, flags);
^~~~~~~~~~~~~~~~~

Fixes cb557757e1aa ("memory: tegra: Add Tegra20 memory controller hot resets")
---
 drivers/memory/tegra/tegra20.c | 1 +
 1 file changed, 1 insertion(+)
drivers/memory/tegra/tegra20.c +1 -0
index 7119e532471c..8853e21b773f 100644
@@ -6,6 +6,7 @@
  * published by the Free Software Foundation.
  */
 
+#include <linux/spinlock.h>
 #include <dt-bindings/memory/tegra20-mc.h>
 
 #include "mc.h"
Signature · 1 line
2.9.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 24 lines · Arnd Bergmann

The newly added code in this file causes a build error unless we include linux/spinlock.h, at least in some configurations:

In file included from drivers/memory/tegra/mc.h:15,

                 from drivers/memory/tegra/tegra20.c:11:

include/soc/tegra/mc.h:159:2: error: unknown type name 'spinlock_t'
spinlock_t lock;
^~~~~~~~~~
drivers/memory/tegra/tegra20.c: In function 'terga20_mc_hotreset_assert':
drivers/memory/tegra/tegra20.c:207:2: error: implicit declaration of function 'spin_lock_irqsave'; did you mean 'arch_local_irq_save'? [-Werror=implicit-function-declaration]
spin_lock_irqsave(&mc->lock, flags);
^~~~~~~~~~~~~~~~~

Fixes cb557757e1aa ("memory: tegra: Add Tegra20 memory controller hot resets")
---
 drivers/memory/tegra/tegra20.c | 1 +
 1 file changed, 1 insertion(+)
drivers/memory/tegra/tegra20.c +0 -0
index 7119e532471c..8853e21b773f 100644

drivers/memory/tegra/tegra20.c line 12

Quoted 7 lines
drivers/memory/tegra/tegra20.c +1 -0
@@ -6,6 +6,7 @@
  * published by the Free Software Foundation.
  */
 
+#include <linux/spinlock.h>
 #include <dt-bindings/memory/tegra20-mc.h>
 
 #include "mc.h"

Yes, the spinlock header was getting included indirectly.