Adds in WC SPI mutex init module.
It's a bit of a hack, but it moves the spi initialization code into a
common location that is not exclusively used by either the ath_flash
driver or the lm95071 driver (pending).
Change-Id: I4dea00f1a42db6ac2824b01f466749dc2ecb98d5
diff --git a/arch/mips/atheros/misc.c b/arch/mips/atheros/misc.c
index 2bceb24..0f883a6 100755
--- a/arch/mips/atheros/misc.c
+++ b/arch/mips/atheros/misc.c
@@ -739,6 +739,14 @@
ath_spi_wait_done();
}
+static int __init _ath_spi_init(void)
+{
+ ath_spi_init();
+ printk(KERN_NOTICE "ath_spi module initialized\n");
+ return 0;
+}
+
+subsys_initcall(_ath_spi_init);
EXPORT_SYMBOL(ath_spi_flash_read_page);
EXPORT_SYMBOL(ath_spi_flash_write_page);
EXPORT_SYMBOL(ath_spi_flash_sector_erase);
diff --git a/drivers/mtd/devices/ath_flash.c b/drivers/mtd/devices/ath_flash.c
index 90fb0f3..420e472e 100755
--- a/drivers/mtd/devices/ath_flash.c
+++ b/drivers/mtd/devices/ath_flash.c
@@ -324,12 +324,6 @@
struct mtd_partition *mtd_parts;
uint8_t index;
- /*
- * TODO(awdavies) This needs to be moved to a common module outside of
- * ath_flash.c
- */
- ath_spi_init();
-
#if !(defined(CONFIG_MACH_AR934x) || defined(CONFIG_MACH_QCA955x) || defined(CONFIG_MACH_QCA953x) || defined(CONFIG_MACH_QCA956x))
#if defined(ATH_SST_FLASH)
ath_reg_wr_nf(ATH_SPI_CLOCK, 0x3);