lkml.org 
[lkml]   [2017]   [Nov]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] ASoC: amd: added error checks in dma driver
On Tue, Nov 28, 2017 at 10:13:44AM +0530, Vijendar Mukunda wrote:

> - acp_init(audio_drv_data->acp_mmio, audio_drv_data->asic_type);
> + status = acp_init(audio_drv_data->acp_mmio, audio_drv_data->asic_type);
> + if (status) {
> + dev_err(&pdev->dev, "ACP Init failed\n");
> + return status;
> + }
>

Better to print the error code to help people see what went wrong.

> static int acp_audio_remove(struct platform_device *pdev)
> {
> + int status;
> struct audio_drv_data *adata = dev_get_drvdata(&pdev->dev);
>
> - acp_deinit(adata->acp_mmio);
> + status = acp_deinit(adata->acp_mmio);
> + if (status) {
> + dev_err(&pdev->dev, "ACP Deinit failed\n");
> + return status;
> + }
> snd_soc_unregister_platform(&pdev->dev);

Remove operations can't meaningfully fail, better to just log the error
and carry on.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2017-11-28 12:52    [W:0.051 / U:0.752 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site