Skip to content

Commit

Permalink
drivers/audio: Fix some DEBUGASSERTs and compile failures.
Browse files Browse the repository at this point in the history
  • Loading branch information
juniskane authored and gregory-nutt committed Jun 11, 2018
1 parent 7e78dee commit 083c1ae
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 15 deletions.
6 changes: 2 additions & 4 deletions drivers/audio/cs43l22.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 */
Expand Down
8 changes: 4 additions & 4 deletions drivers/audio/i2schar.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -284,7 +284,7 @@ static ssize_t i2schar_read(FAR struct file *filep, FAR char *buffer,
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;
Expand Down Expand Up @@ -357,7 +357,7 @@ static ssize_t i2schar_write(FAR struct file *filep, FAR const char *buffer,

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;

Expand Down
5 changes: 2 additions & 3 deletions drivers/audio/wm8776.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <fixedmath.h>
#include <queue.h>
#include <debug.h>

Expand Down Expand Up @@ -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 */
Expand Down
6 changes: 2 additions & 4 deletions drivers/audio/wm8904.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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 */
Expand Down

0 comments on commit 083c1ae

Please sign in to comment.