1 --- a/arch/mips/ath79/common.c
2 +++ b/arch/mips/ath79/common.c
6 static DEFINE_SPINLOCK(ath79_device_reset_lock);
7 +static DEFINE_MUTEX(ath79_flash_mutex);
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);
14 EXPORT_SYMBOL_GPL(ath79_device_reset_clear);
16 +void ath79_flash_acquire(void)
18 + mutex_lock(&ath79_flash_mutex);
20 +EXPORT_SYMBOL_GPL(ath79_flash_acquire);
22 +void ath79_flash_release(void)
24 + mutex_unlock(&ath79_flash_mutex);
26 +EXPORT_SYMBOL_GPL(ath79_flash_release);
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);
34 +void ath79_flash_acquire(void);
35 +void ath79_flash_release(void);
37 #endif /* __ASM_MACH_ATH79_H */