drivers/audio: Fix some DEBUGASSERTs and compile failures.

This commit is contained in:
Juha Niskanen 2018-06-11 07:00:27 -06:00 committed by Gregory Nutt
parent 7e78dee752
commit 083c1ae639
4 changed files with 10 additions and 15 deletions

View File

@ -2,7 +2,7 @@
* drivers/audio/cs43l22.c
* Audio device driver for Cirrus logic CS43L22 Audio codec.
*
* Copyright (C) 2017 Gregory Nutt. All rights reserved.
* Copyright (C) 2017-2018 Gregory Nutt. All rights reserved.
* Author: Taras Drozdovskiy <t.drozdovskiy@gmail.com>
*
* Redistribution and use in source and binary forms, with or without
@ -726,12 +726,10 @@ cs43l22_configure(FAR struct audio_lowerhalf_s *dev,
FAR const struct audio_caps_s *caps)
#endif
{
#if !defined(CONFIG_AUDIO_EXCLUDE_VOLUME) || !defined(CONFIG_AUDIO_EXCLUDE_TONE)
FAR struct cs43l22_dev_s *priv = (FAR struct cs43l22_dev_s *)dev;
#endif
int ret = OK;
DEBUGASSERT(priv && caps);
DEBUGASSERT(priv != NULL && caps != NULL);
audinfo("ac_type: %d\n", caps->ac_type);
/* Process the configure operation */

View File

@ -6,7 +6,7 @@
* audio driver. It is not suitable for use in any real driver application
* in its current form.
*
* Copyright (C) 2013, 2017 Gregory Nutt. All rights reserved.
* Copyright (C) 2013, 2017-2018 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -211,7 +211,7 @@ static void i2schar_txcallback(FAR struct i2s_dev_s *dev,
static ssize_t i2schar_read(FAR struct file *filep, FAR char *buffer,
size_t buflen)
{
FAR struct inode *inode = filep->f_inode;
FAR struct inode *inode;
FAR struct i2schar_dev_s *priv;
FAR struct ap_buffer_s *apb;
size_t nbytes;
@ -284,7 +284,7 @@ errout_with_reference:
static ssize_t i2schar_write(FAR struct file *filep, FAR const char *buffer,
size_t buflen)
{
FAR struct inode *inode = filep->f_inode;
FAR struct inode *inode;
FAR struct i2schar_dev_s *priv;
FAR struct ap_buffer_s *apb;
size_t nbytes;
@ -357,7 +357,7 @@ errout_with_reference:
static int i2schar_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
{
FAR struct inode *inode = filep->f_inode;
FAR struct inode *inode;
FAR struct i2schar_dev_s *priv;
int ret = -ENOTTY;

View File

@ -49,6 +49,7 @@
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <fixedmath.h>
#include <queue.h>
#include <debug.h>
@ -397,12 +398,10 @@ static int wm8776_configure(FAR struct audio_lowerhalf_s *dev,
FAR const struct audio_caps_s *caps)
#endif
{
#if !defined(CONFIG_AUDIO_EXCLUDE_VOLUME) || !defined(CONFIG_AUDIO_EXCLUDE_TONE)
FAR struct wm8776_dev_s *priv = (FAR struct wm8776_dev_s *)dev;
#endif
int ret = OK;
DEBUGASSERT(priv && caps);
DEBUGASSERT(priv != NULL && caps != NULL);
audinfo("ac_type: %d\n", caps->ac_type);
/* Process the configure operation */

View File

@ -3,7 +3,7 @@
*
* Audio device driver for Wolfson Microelectronics WM8904 Audio codec.
*
* Copyright (C) 2014, 2016-2017 Gregory Nutt. All rights reserved.
* Copyright (C) 2014, 2016-2018 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* References:
@ -1143,12 +1143,10 @@ static int wm8904_configure(FAR struct audio_lowerhalf_s *dev,
FAR const struct audio_caps_s *caps)
#endif
{
#if !defined(CONFIG_AUDIO_EXCLUDE_VOLUME) || !defined(CONFIG_AUDIO_EXCLUDE_TONE)
FAR struct wm8904_dev_s *priv = (FAR struct wm8904_dev_s *)dev;
#endif
int ret = OK;
DEBUGASSERT(priv && caps);
DEBUGASSERT(priv != NULL && caps != NULL);
audinfo("ac_type: %d\n", caps->ac_type);
/* Process the configure operation */