summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nuttx/drivers/usbdev/usbdev_scsi.c16
-rw-r--r--nuttx/examples/usbstorage/usbstrg_lpc214x.c1
-rw-r--r--nuttx/include/nuttx/spi.h2
3 files changed, 8 insertions, 11 deletions
diff --git a/nuttx/drivers/usbdev/usbdev_scsi.c b/nuttx/drivers/usbdev/usbdev_scsi.c
index af535c0bc..6cc997d2f 100644
--- a/nuttx/drivers/usbdev/usbdev_scsi.c
+++ b/nuttx/drivers/usbdev/usbdev_scsi.c
@@ -1332,7 +1332,7 @@ static inline int usbstrg_cmdwrite12(FAR struct usbstrg_dev_s *priv)
static int inline usbstrg_setupcmd(FAR struct usbstrg_dev_s *priv, ubyte cdblen, ubyte flags)
{
- FAR struct usbstrg_lun_s *lun;
+ FAR struct usbstrg_lun_s *lun = NULL;
uint32 datlen;
ubyte dir = flags & USBSTRG_FLAGS_DIRMASK;
int ret = OK;
@@ -1351,17 +1351,13 @@ static int inline usbstrg_setupcmd(FAR struct usbstrg_dev_s *priv, ubyte cdblen,
lun = &priv->luntab[priv->cbwlun];
priv->lun = lun;
}
- else
- {
- priv->lun = NULL;
- /* Only a few commands may specify unsupported LUNs */
+ /* Only a few commands may specify unsupported LUNs */
- if ((flags & USBSTRG_FLAGS_LUNNOTNEEDED) == 0)
- {
- usbtrace(TRACE_CLSERROR(USBSTRG_TRACEERR_CMDBADLUN), priv->cbwlun);
- ret = -EINVAL;
- }
+ else if ((flags & USBSTRG_FLAGS_LUNNOTNEEDED) == 0)
+ {
+ usbtrace(TRACE_CLSERROR(USBSTRG_TRACEERR_CMDBADLUN), priv->cbwlun);
+ ret = -EINVAL;
}
/* Extract the direction and data transfer length */
diff --git a/nuttx/examples/usbstorage/usbstrg_lpc214x.c b/nuttx/examples/usbstorage/usbstrg_lpc214x.c
index 7aa8030d4..aea0f0ae5 100644
--- a/nuttx/examples/usbstorage/usbstrg_lpc214x.c
+++ b/nuttx/examples/usbstorage/usbstrg_lpc214x.c
@@ -41,6 +41,7 @@
#include <nuttx/config.h>
+#include <stdio.h>
#include <sys/types.h>
#include <debug.h>
#include <errno.h>
diff --git a/nuttx/include/nuttx/spi.h b/nuttx/include/nuttx/spi.h
index 3fe9131c4..896ed6e8f 100644
--- a/nuttx/include/nuttx/spi.h
+++ b/nuttx/include/nuttx/spi.h
@@ -204,7 +204,7 @@ struct spi_ops_s
struct spi_dev_s
{
- struct spi_ops_s *ops;
+ const struct spi_ops_s *ops;
};
/****************************************************************************