From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5CD8DC48BD3 for ; Wed, 26 Jun 2019 03:41:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 30AAB2147A for ; Wed, 26 Jun 2019 03:41:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561520489; bh=Lu7uDFtiuRev8qFmJoBxVGwqx6CD6SYxWfAJXfHMVA8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=BF47YhhHw1TdIFi2ohZSqrLlR3cJRxf2ZS3lJq3M2ODPu0+GU8TM3eCN6wbBX9KHY NaRa6IkwUacUbpyE2z/Qt7czGh/upQ3DJ7Xim7/hLMJjERgf685hADHBMjZaPpJ8aF CuDUjslasx21EUpzB341Q0/XqAZZBFhZ+epcf1XM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726723AbfFZDl2 (ORCPT ); Tue, 25 Jun 2019 23:41:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:51706 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726077AbfFZDl0 (ORCPT ); Tue, 25 Jun 2019 23:41:26 -0400 Received: from sasha-vm.mshome.net (mobile-107-77-172-74.mobile.att.net [107.77.172.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A5BF720659; Wed, 26 Jun 2019 03:41:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561520485; bh=Lu7uDFtiuRev8qFmJoBxVGwqx6CD6SYxWfAJXfHMVA8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bBC5AEeVJGWdaUQ0UHxDAHI9rsmvL3XaqAZepJVsMRCMJKaHCXnyNMhnga648+3Km vWUxoLZfFJken1LfM9XK0eWkqadRdsyjUE0N7SSjWstn3PBF1ULFSazluLF36vaBcL gIY3E+U2Qq9rSTyuffMCHQMEJw3kA7Tm+MSgx8Zw= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Viorel Suman , Shengjiu Wang , Mark Brown , Sasha Levin Subject: [PATCH AUTOSEL 5.1 03/51] ASoC: ak4458: add return value for ak4458_probe Date: Tue, 25 Jun 2019 23:40:19 -0400 Message-Id: <20190626034117.23247-3-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190626034117.23247-1-sashal@kernel.org> References: <20190626034117.23247-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Viorel Suman [ Upstream commit a8dee20d792432740509237943700fbcfc230bad ] AK4458 is probed successfully even if AK4458 is not present - this is caused by probe function returning no error on i2c access failure. Return an error on probe if i2c access has failed. Signed-off-by: Shengjiu Wang Signed-off-by: Viorel Suman Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/ak4458.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/sound/soc/codecs/ak4458.c b/sound/soc/codecs/ak4458.c index eab7c76cfcd9..4c5c3ec92609 100644 --- a/sound/soc/codecs/ak4458.c +++ b/sound/soc/codecs/ak4458.c @@ -536,9 +536,10 @@ static void ak4458_power_on(struct ak4458_priv *ak4458) } } -static void ak4458_init(struct snd_soc_component *component) +static int ak4458_init(struct snd_soc_component *component) { struct ak4458_priv *ak4458 = snd_soc_component_get_drvdata(component); + int ret; /* External Mute ON */ if (ak4458->mute_gpiod) @@ -546,21 +547,21 @@ static void ak4458_init(struct snd_soc_component *component) ak4458_power_on(ak4458); - snd_soc_component_update_bits(component, AK4458_00_CONTROL1, + ret = snd_soc_component_update_bits(component, AK4458_00_CONTROL1, 0x80, 0x80); /* ACKS bit = 1; 10000000 */ + if (ret < 0) + return ret; - ak4458_rstn_control(component, 1); + return ak4458_rstn_control(component, 1); } static int ak4458_probe(struct snd_soc_component *component) { struct ak4458_priv *ak4458 = snd_soc_component_get_drvdata(component); - ak4458_init(component); - ak4458->fs = 48000; - return 0; + return ak4458_init(component); } static void ak4458_remove(struct snd_soc_component *component) -- 2.20.1