diff --git a/configs/boardctl.c b/configs/boardctl.c index d8f52d1d81..e240346e6d 100644 --- a/configs/boardctl.c +++ b/configs/boardctl.c @@ -105,7 +105,7 @@ static inline int boardctl_usbdevctrl(FAR struct boardioc_usbdev_ctrl_s *ctrl) break; default: - return -EINVAL; + ret = -EINVAL; } break; #endif @@ -123,7 +123,8 @@ static inline int boardctl_usbdevctrl(FAR struct boardioc_usbdev_ctrl_s *ctrl) case BOARDIOC_USBDEV_CONNECT: /* Connect the USB MSC device */ { DEBUGASSERT(ctrl->handle != NULL); - ??? +#warning Missing logic + ret = -ENOSYS; } break; @@ -135,7 +136,7 @@ static inline int boardctl_usbdevctrl(FAR struct boardioc_usbdev_ctrl_s *ctrl) break; default: - return -EINVAL; + ret = -EINVAL; } break; #endif @@ -169,11 +170,15 @@ static inline int boardctl_usbdevctrl(FAR struct boardioc_usbdev_ctrl_s *ctrl) break; default: - return -EINVAL; + ret = -EINVAL; } break; #endif + default: + ret = -EINVAL; + } + return ret; } #endif diff --git a/configs/fire-stm32v2/src/stm32_composite.c b/configs/fire-stm32v2/src/stm32_composite.c index 4cc8d8e229..4a171aebe4 100644 --- a/configs/fire-stm32v2/src/stm32_composite.c +++ b/configs/fire-stm32v2/src/stm32_composite.c @@ -1,7 +1,7 @@ /**************************************************************************** * configs/fire-stm32v2/src/stm32_composite.c * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Configure and register the STM32 SPI-based MMC/SD block driver. @@ -43,6 +43,8 @@ #include +#include + #include "fire-stm32v2.h" /**************************************************************************** @@ -60,14 +62,14 @@ ****************************************************************************/ /**************************************************************************** - * Name: composite_archinitialize + * Name: board_composite_initialize * * Description: - * Perform architecture specific initialization + * Perform architecture specific initialization of a composite USB device. * ****************************************************************************/ -int composite_archinitialize(void) +int board_composite_initialize(int port) { /* If system/composite is built as an NSH command, then SD slot should * already have been initialized in board_app_initialize() (see stm32_appinit.c). diff --git a/configs/mcu123-lpc214x/src/lpc2148_composite.c b/configs/mcu123-lpc214x/src/lpc2148_composite.c index 0ed3604837..995fc4234f 100644 --- a/configs/mcu123-lpc214x/src/lpc2148_composite.c +++ b/configs/mcu123-lpc214x/src/lpc2148_composite.c @@ -1,7 +1,7 @@ /**************************************************************************** * configs/mcu123-lpc214x/src/lpc2148_composite.c * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Configure and register the LPC214x MMC/SD SPI block driver. @@ -45,8 +45,9 @@ #include #include -#include +#include #include +#include #include #include "lpc214x_spi.h" @@ -71,14 +72,14 @@ ****************************************************************************/ /**************************************************************************** - * Name: composite_archinitialize + * Name: board_composite_initialize * * Description: - * Perform architecture specific initialization + * Perform architecture specific initialization of a composite USB device. * ****************************************************************************/ -int composite_archinitialize(void) +int board_composite_initialize(int port) { /* If system/composite is built as an NSH command, then SD slot should * already have been initialized in board_app_initialize() (see lpc2148_appinit.c). diff --git a/configs/olimexino-stm32/src/olimexino-stm32.h b/configs/olimexino-stm32/src/olimexino-stm32.h index ebbd656019..70e8e8db48 100644 --- a/configs/olimexino-stm32/src/olimexino-stm32.h +++ b/configs/olimexino-stm32/src/olimexino-stm32.h @@ -228,21 +228,5 @@ int stm32_can_initialize(void); int usbmsc_archinitialize(void); #endif -/**************************************************************************** - * Name: composite_archinitialize - * - * Description: - * Called from the application system/composite or the boards_nsh if the - * application is not included. - * Perform architecture specific initialization. This function must - * configure the block device to export via USB. This function must be - * provided by architecture-specific logic in order to use this add-on. - * - ****************************************************************************/ - -#if !defined(CONFIG_NSH_BUILTIN_APPS) && !defined(CONFIG_SYSTEM_COMPOSITE) -extern int composite_archinitialize(void); -#endif - #endif /* __ASSEMBLY__ */ #endif /* __CONFIGS_OLIMEXINO_STM32_SRC_OLIMEXINO_STM32_H */ diff --git a/configs/olimexino-stm32/src/stm32_appinit.c b/configs/olimexino-stm32/src/stm32_appinit.c index d7042497ef..9dd3134e55 100644 --- a/configs/olimexino-stm32/src/stm32_appinit.c +++ b/configs/olimexino-stm32/src/stm32_appinit.c @@ -1,7 +1,7 @@ /************************************************************************************ * configs/olimexino-stm32/src/stm32_appinit.c * - * Copyright (C) 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2015, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * David Sidrane * @@ -60,17 +60,6 @@ #include "stm32.h" #include "olimexino-stm32.h" -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ /**************************************************************************** * Public Functions ****************************************************************************/ @@ -95,7 +84,7 @@ int board_app_initialize(void) #ifdef CONFIG_USBDEV_COMPOSITE #if !defined(CONFIG_NSH_BUILTIN_APPS) && !defined(CONFIG_SYSTEM_COMPOSITE) - ret = composite_archinitialize(); + ret = board_composite_initialize(0); #endif #endif diff --git a/configs/olimexino-stm32/src/stm32_composite.c b/configs/olimexino-stm32/src/stm32_composite.c index a8de8fd3d8..339b8c879b 100644 --- a/configs/olimexino-stm32/src/stm32_composite.c +++ b/configs/olimexino-stm32/src/stm32_composite.c @@ -44,8 +44,9 @@ #include #include -#include +#include #include +#include #include "stm32.h" #include "olimexino-stm32.h" @@ -81,14 +82,14 @@ ****************************************************************************/ /**************************************************************************** - * Name: composite_archinitialize + * Name: board_composite_initialize * * Description: - * Perform architecture specific initialization + * Perform architecture specific initialization of a composite USB device. * ****************************************************************************/ -int composite_archinitialize(void) +int board_composite_initialize(int port) { /* If system/composite is built as an NSH command, then SD slot should * already have been initialized in board_app_initialize() (see stm32_appinit.c). diff --git a/configs/samv71-xult/src/sam_composite.c b/configs/samv71-xult/src/sam_composite.c index 347b9faf79..2e0f1dcea7 100644 --- a/configs/samv71-xult/src/sam_composite.c +++ b/configs/samv71-xult/src/sam_composite.c @@ -59,7 +59,7 @@ int board_composite_initialize(int port) { - return OK; + return OK; } #endif /* CONFIG_USBDEV_COMPOSITE */ diff --git a/configs/shenzhou/src/stm32_composite.c b/configs/shenzhou/src/stm32_composite.c index 7ef4754ba1..4b6c6250a0 100644 --- a/configs/shenzhou/src/stm32_composite.c +++ b/configs/shenzhou/src/stm32_composite.c @@ -1,7 +1,7 @@ /**************************************************************************** * configs/shenzhou/src/stm32_composite.c * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Configure and register the STM32 SPI-based MMC/SD block driver. @@ -60,14 +60,14 @@ ****************************************************************************/ /**************************************************************************** - * Name: composite_archinitialize + * Name: board_composite_initialize * * Description: - * Perform architecture specific initialization + * Perform architecture specific initialization of a composite USB device. * ****************************************************************************/ -int composite_archinitialize(void) +int board_composite_initialize(int port) { /* If system/composite is built as an NSH command, then SD slot should * already have been initialized in board_app_initialize() (see diff --git a/configs/spark/src/stm32_appinit.c b/configs/spark/src/stm32_appinit.c index 339cf3f0ac..4da06bee79 100644 --- a/configs/spark/src/stm32_appinit.c +++ b/configs/spark/src/stm32_appinit.c @@ -116,10 +116,6 @@ # undef HAVE_USBMONITOR #endif -/**************************************************************************** - * Private Data - ****************************************************************************/ - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/configs/spark/src/stm32_composite.c b/configs/spark/src/stm32_composite.c index c4a3f8fdb3..2720de1af4 100644 --- a/configs/spark/src/stm32_composite.c +++ b/configs/spark/src/stm32_composite.c @@ -1,7 +1,7 @@ /**************************************************************************** * config/spark/src/stm32_composite.c * - * Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2012-2013, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * David_s5 * @@ -46,6 +46,7 @@ #include #include +#include #ifdef CONFIG_MTD_SST25 # include @@ -120,15 +121,15 @@ ****************************************************************************/ /**************************************************************************** - * Name: do_composite_archinitialize + * Name: stm32_composite_initialize * * Description: * Perform architecture specific initialization * ****************************************************************************/ -#if !defined(CONFIG_LIB_BOARDCTL) || !defined(CONFIG_NSH_BUILTIN_APPS) -static int do_composite_archinitialize(void) +#ifndef CONFIG_NSH_BUILTIN_APPS +static int stm32_composite_initialize(void) { #ifdef HAVE_SST25 FAR struct spi_dev_s *spi; @@ -284,18 +285,18 @@ static int do_composite_archinitialize(void) ****************************************************************************/ /**************************************************************************** - * Name: board_app_initialize + * Name: board_composite_initialize * * Description: - * Perform architecture specific initialization + * Perform architecture specific initialization of a composite USB device. * ****************************************************************************/ -int composite_archinitialize(void) +int board_composite_initialize(int port) { -#if defined(CONFIG_LIB_BOARDCTL) && defined(CONFIG_NSH_BUILTIN_APPS) +#ifdef CONFIG_NSH_BUILTIN_APPS return OK; #else - return do_composite_archinitialize(); + return stm32_composite_initialize(); #endif } diff --git a/configs/stm3210e-eval/src/stm32_composite.c b/configs/stm3210e-eval/src/stm32_composite.c index 2753f9a0d6..d38a3f6a52 100644 --- a/configs/stm3210e-eval/src/stm32_composite.c +++ b/configs/stm3210e-eval/src/stm32_composite.c @@ -1,7 +1,7 @@ /**************************************************************************** * configs/stm3210e-eval/src/stm32_composite.c * - * Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2009, 2011, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Configure and register the STM32 MMC/SD SDIO block driver. @@ -47,13 +47,14 @@ #include #include +#include #include #include "stm32.h" /* There is nothing to do here if SDIO support is not selected. */ -#ifdef CONFIG_STM32_SDIO +#if defined(CONFIG_STM32_SDIO) && defined(CONFIG_USBDEV_COMPOSITE) /**************************************************************************** * Pre-processor Definitions @@ -80,14 +81,14 @@ ****************************************************************************/ /**************************************************************************** - * Name: composite_archinitialize + * Name: board_composite_initialize * * Description: - * Perform architecture specific initialization + * Perform architecture specific initialization of a composite USB device. * ****************************************************************************/ -int composite_archinitialize(void) +int board_composite_initialize(int port) { /* If system/composite is built as an NSH command, then SD slot should * already have been initialized in board_app_initialize() (see @@ -141,4 +142,4 @@ int composite_archinitialize(void) return OK; } -#endif /* CONFIG_STM32_SDIO */ +#endif /* CONFIG_STM32_SDIO && CONFIG_USBDEV_COMPOSITE */