Root/target/linux/ar71xx/patches-3.3/503-MIPS-ath79-add-flash-acquire-release.patch

1--- a/arch/mips/ath79/common.c
2+++ b/arch/mips/ath79/common.c
3@@ -22,6 +22,7 @@
4 #include "common.h"
5 
6 static DEFINE_SPINLOCK(ath79_device_reset_lock);
7+static DEFINE_MUTEX(ath79_flash_mutex);
8 
9 u32 ath79_cpu_freq;
10 EXPORT_SYMBOL_GPL(ath79_cpu_freq);
11@@ -107,3 +108,16 @@ void ath79_device_reset_clear(u32 mask)
12     spin_unlock_irqrestore(&ath79_device_reset_lock, flags);
13 }
14 EXPORT_SYMBOL_GPL(ath79_device_reset_clear);
15+
16+void ath79_flash_acquire(void)
17+{
18+ mutex_lock(&ath79_flash_mutex);
19+}
20+EXPORT_SYMBOL_GPL(ath79_flash_acquire);
21+
22+void ath79_flash_release(void)
23+{
24+ mutex_unlock(&ath79_flash_mutex);
25+}
26+EXPORT_SYMBOL_GPL(ath79_flash_release);
27+
28--- a/arch/mips/include/asm/mach-ath79/ath79.h
29+++ b/arch/mips/include/asm/mach-ath79/ath79.h
30@@ -126,4 +126,7 @@ static inline u32 ath79_reset_rr(unsigne
31 void ath79_device_reset_set(u32 mask);
32 void ath79_device_reset_clear(u32 mask);
33 
34+void ath79_flash_acquire(void);
35+void ath79_flash_release(void);
36+
37 #endif /* __ASM_MACH_ATH79_H */
38

Archive Download this file



interactive