From 083c1ae639bf9aed2802f04d10ab05ffc93942a7 Mon Sep 17 00:00:00 2001 From: Juha Niskanen Date: Mon, 11 Jun 2018 07:00:27 -0600 Subject: [PATCH] drivers/audio: Fix some DEBUGASSERTs and compile failures. --- drivers/audio/cs43l22.c | 6 ++---- drivers/audio/i2schar.c | 8 ++++---- drivers/audio/wm8776.c | 5 ++--- drivers/audio/wm8904.c | 6 ++---- 4 files changed, 10 insertions(+), 15 deletions(-) diff --git a/drivers/audio/cs43l22.c b/drivers/audio/cs43l22.c index ad09df65ec..b3e27cdc54 100644 --- a/drivers/audio/cs43l22.c +++ b/drivers/audio/cs43l22.c @@ -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 * * 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 */ diff --git a/drivers/audio/i2schar.c b/drivers/audio/i2schar.c index c70b311a44..906c3bc410 100644 --- a/drivers/audio/i2schar.c +++ b/drivers/audio/i2schar.c @@ -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 * * 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; diff --git a/drivers/audio/wm8776.c b/drivers/audio/wm8776.c index de5656cc4c..518a7945a2 100644 --- a/drivers/audio/wm8776.c +++ b/drivers/audio/wm8776.c @@ -49,6 +49,7 @@ #include #include #include +#include #include #include @@ -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 */ diff --git a/drivers/audio/wm8904.c b/drivers/audio/wm8904.c index d917a8ee35..193dd62e63 100644 --- a/drivers/audio/wm8904.c +++ b/drivers/audio/wm8904.c @@ -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 * * 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 */