Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp577792ybc; Fri, 22 Nov 2019 09:40:29 -0800 (PST) X-Google-Smtp-Source: APXvYqz59AAWIAnKL8gyhhtnwUXXV9/xG2yrKDHNR5cldpHa/E4R32SuMBZzQacM7FJLSE7SVdbT X-Received: by 2002:a50:b6f8:: with SMTP id f53mr2548201ede.29.1574444429524; Fri, 22 Nov 2019 09:40:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574444429; cv=none; d=google.com; s=arc-20160816; b=MVBlWjYnORpsQJqsJ+xBF/jinvFBczgNRHexaj8EKSaqMoHh9nQwvbinQNLxpRrCw0 vtnBxEZL7peknS9uypSKIJEeCOYcRDGL2dtfSIUJdG8BHhEzcypgEQarC3KKnO90Rzqo ghUFkp5dyEQ3DfqyUyzkCsfbIqn/n6CYYnhe2ptyiLG0j2I+jY14HDH3mF0uYRJ5jYr4 hafdrekMki80pacazadekbtmYvvBvY+zrkEeacIgizxZvuwRK4095iY0ZAA7vcVmslyR RGcp+zyDVE+rcZkyh7Ny6vZOmRCeu8ytxpcgH6DjBWzqXQZ/2xBgoEMv95mRaCasT98r 7Qrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=JX22xsRZgpPjPZQKPhxaV2cO/KzTEPUSDWeAJwDik00=; b=ij98ufVTsQQ50sXiiFkrQP+0csu4T9GdD6mLl3LwqCcAyXgW/6rYL175odWZgcLtnC x36P/JPuaSQJLLBHunpZLomLhIlCiydyxfMpQ/S9VVjMcz18EQpzxJQgsWBDGaP0TCJR D51k7/tQLYVJ0G9nt6SubROkJG83Y3bIFX+CdKmMvgcYxaYbsJ0xDEr4ahaC0v33cNfB 79ySCwQu8a1EIFvy1CtucvDBzh8yrB5lmYdThr0IkPIe1u684Z7I4ZJh2IbWlLTJWseO o85NdLGl8YKCsdPZNloOIkOVXQult4phzoqUjrme2iwCGWBl1PQMatFS8uo8rrgb0TyL e+Lg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id oj24si1485344ejb.177.2019.11.22.09.40.02; Fri, 22 Nov 2019 09:40:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726722AbfKVRin (ORCPT + 99 others); Fri, 22 Nov 2019 12:38:43 -0500 Received: from mga03.intel.com ([134.134.136.65]:28062 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726046AbfKVRin (ORCPT ); Fri, 22 Nov 2019 12:38:43 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Nov 2019 09:38:42 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,230,1571727600"; d="scan'208";a="238682978" Received: from sygreen1-mobl4.amr.corp.intel.com (HELO [10.252.195.68]) ([10.252.195.68]) by fmsmga002.fm.intel.com with ESMTP; 22 Nov 2019 09:38:40 -0800 Subject: Re: [alsa-devel] [PATCH v12 2/6] ASoC: amd: Refactoring of DAI from DMA driver To: Ravulapati Vishnu vardhan rao Cc: Alexander.Deucher@amd.com, djkurtz@google.com, Akshu.Agrawal@amd.com, Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Vijendar Mukunda , YueHaibing , Kuninori Morimoto , Dan Carpenter , open list , "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." References: <1574415866-29715-1-git-send-email-Vishnuvardhanrao.Ravulapati@amd.com> <1574415866-29715-3-git-send-email-Vishnuvardhanrao.Ravulapati@amd.com> From: Pierre-Louis Bossart Message-ID: <7f4ccc51-7bdd-d1c6-605a-0b432485de73@linux.intel.com> Date: Fri, 22 Nov 2019 09:33:52 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.2 MIME-Version: 1.0 In-Reply-To: <1574415866-29715-3-git-send-email-Vishnuvardhanrao.Ravulapati@amd.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > static int acp3x_audio_probe(struct platform_device *pdev) > { > - int status; > struct resource *res; > struct i2s_dev_data *adata; > unsigned int irqflags; > + int status, ret; > > if (!pdev->dev.platform_data) { > dev_err(&pdev->dev, "platform_data not retrieved\n"); > @@ -622,7 +426,7 @@ static int acp3x_audio_probe(struct platform_device *pdev) > > res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > if (!res) { > - dev_err(&pdev->dev, "IORESOURCE_IRQ FAILED\n"); > + dev_err(&pdev->dev, "IORESOURCE_MEM FAILED\n"); > return -ENODEV; > } > > @@ -632,60 +436,64 @@ static int acp3x_audio_probe(struct platform_device *pdev) > > adata->acp3x_base = devm_ioremap(&pdev->dev, res->start, > resource_size(res)); > + if (!adata->acp3x_base) > + return -ENOMEM; > > res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); > if (!res) { > dev_err(&pdev->dev, "IORESOURCE_IRQ FAILED\n"); > - return -ENODEV; > + return -ENOMEM; it's odd for a -ENOMEM code to returned for IRQs? > } > > adata->i2s_irq = res->start; > - adata->play_stream = NULL; > - adata->capture_stream = NULL; > > dev_set_drvdata(&pdev->dev, adata); > /* Initialize ACP */ > status = acp3x_init(adata->acp3x_base); > if (status) > return -ENODEV; > + > status = devm_snd_soc_register_component(&pdev->dev, > &acp3x_i2s_component, > - &acp3x_i2s_dai_driver, 1); > + NULL, 0); > if (status) { > - dev_err(&pdev->dev, "Fail to register acp i2s dai\n"); > + dev_err(&pdev->dev, "Fail to register acp i2s component\n"); > + ret = -ENODEV; > goto dev_err; > } > status = devm_request_irq(&pdev->dev, adata->i2s_irq, i2s_irq_handler, > irqflags, "ACP3x_I2S_IRQ", adata); > if (status) { > dev_err(&pdev->dev, "ACP3x I2S IRQ request failed\n"); > + ret = -ENODEV; > goto dev_err; > } > > - pm_runtime_set_autosuspend_delay(&pdev->dev, 10000); > + pm_runtime_set_autosuspend_delay(&pdev->dev, 5000); > pm_runtime_use_autosuspend(&pdev->dev); > pm_runtime_enable(&pdev->dev); > return 0; > + > dev_err: > status = acp3x_deinit(adata->acp3x_base); > if (status) > dev_err(&pdev->dev, "ACP de-init failed\n"); > else > - dev_info(&pdev->dev, "ACP de-initialized\n"); > - /*ignore device status and return driver probe error*/ > - return -ENODEV; > + dev_dbg(&pdev->dev, "ACP de-initialized\n"); > + return ret; > }