Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions audioreach-driver/q6apm_audio_pkt.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,11 @@ static int q6apm_send_audio_cmd_sync(struct device *dev, gpr_device_t *gdev,
rc = wait_event_timeout(*cmd_wait, (result->opcode == hdr->opcode), wait_time * HZ);

if (!rc) {
dev_err(dev, "CMD timeout for [%x] opcode\n", hdr->opcode);
dev_err(&g_apm->adev->dev, "CMD timeout for [%x] opcode\n", hdr->opcode);
rc = -ETIMEDOUT;
} else if (result->status > 0) {
dev_err(dev, "DSP returned error[%x] %x\n", hdr->opcode, result->status);
dev_err(&g_apm->adev->dev, "DSP returned error[%x] %x\n", hdr->opcode,
result->status);
rc = -EINVAL;
} else {
/* DSP successfully finished the command */
Expand Down Expand Up @@ -280,11 +281,14 @@ static int audio_pkt_open(struct inode *inode, struct file *file)
*/
static int audio_pkt_release(struct inode *inode, struct file *file)
{
struct q6apm_audio_pkt *audpkt_dev = cdev_to_audpkt_dev(inode->i_cdev);
struct q6apm_audio_pkt *audpkt_dev = file->private_data;
struct device *dev = audpkt_dev->dev;
struct sk_buff *skb;
unsigned long flags;

if (!audpkt_dev || !audpkt_dev->dev)
return -EINVAL;

spin_lock_irqsave(&audpkt_dev->queue_lock, flags);

/* Discard all SKBs */
Expand Down Expand Up @@ -684,6 +688,7 @@ static void q6apm_audio_pkt_remove(gpr_device_t *adev)
unregister_chrdev_region(apm->audio_pkt_major, MINOR_NUMBER_COUNT);

dev_set_drvdata(dev, NULL);
g_apm = NULL;
}

#ifdef CONFIG_OF
Expand Down
Loading