/*
* Common platform init routine for all SPI NOR devices.
*/
-static int __init rbspi_platform_setup(void)
+static __init const struct rb_info *rbspi_platform_setup(void)
{
const struct rb_info *info;
char buf[RBSPI_MACH_BUFLEN] = "MikroTik ";
info = rb_init_info((void *)(KSEG1ADDR(AR71XX_SPI_BASE)), 0x20000);
if (!info)
- return -ENODEV;
+ return NULL;
if (info->board_name) {
str = "RouterBOARD ";
/* fix partitions based on flash parsing */
rbspi_init_partitions(info);
- return 0;
+ return info;
}
/*
{
u32 flags = RBSPI_HAS_WLAN0;
- if (rbspi_platform_setup())
+ if (!rbspi_platform_setup())
return;
rbspi_peripherals_setup(flags);
{
u32 flags = RBSPI_HAS_WLAN0;
- if (rbspi_platform_setup())
+ if (!rbspi_platform_setup())
return;
rbspi_peripherals_setup(flags);
u32 flags = RBSPI_HAS_WAN4 | RBSPI_HAS_USB |
RBSPI_HAS_SSR | RBSPI_HAS_POE;
- if (rbspi_platform_setup())
+ if (!rbspi_platform_setup())
return;
/* differentiate the hAP from the hAP ac lite */
{
u32 flags = RBSPI_HAS_WAN4 | RBSPI_HAS_SSR;
- if (rbspi_platform_setup())
+ if (!rbspi_platform_setup())
return;
/* differentiate the hEX lite from the hEX PoE lite */
{
u32 flags = RBSPI_HAS_USB | RBSPI_HAS_POE | RBSPI_HAS_PCI;
- if (rbspi_platform_setup())
+ if (!rbspi_platform_setup())
return;
rbspi_peripherals_setup(flags);
{
u32 flags = RBSPI_HAS_WLAN1 | RBSPI_HAS_MDIO1;
- if (rbspi_platform_setup())
+ if (!rbspi_platform_setup())
return;
rbspi_peripherals_setup(flags);
{
u32 flags = RBSPI_HAS_WLAN0;
- if (rbspi_platform_setup())
+ if (!rbspi_platform_setup())
return;
rbspi_peripherals_setup(flags);
{
u32 flags = RBSPI_HAS_WLAN0;
- if (rbspi_platform_setup())
+ if (!rbspi_platform_setup())
return;
rbspi_peripherals_setup(flags);
u32 flags = RBSPI_HAS_USB | RBSPI_HAS_WLAN0 |
RBSPI_HAS_SSR | RBSPI_HAS_POE;
- if (rbspi_platform_setup())
+ if (!rbspi_platform_setup())
return;
rbspi_spi_cs_gpios[1] = RBMAP_GPIO_SSR_CS;
{
u32 flags = RBSPI_HAS_PCI;
- if (rbspi_platform_setup())
+ if (!rbspi_platform_setup())
return;
rbspi_peripherals_setup(flags);