Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp256082ybd; Tue, 25 Jun 2019 20:52:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqwS1I1zfaoIccxJpbZsBYAi7S0HEMIFDtOFGUFSV/hxoxK+u/oyZ/Un3XiStR6vQtq7+Q5B X-Received: by 2002:a63:db05:: with SMTP id e5mr608929pgg.121.1561521131198; Tue, 25 Jun 2019 20:52:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561521131; cv=none; d=google.com; s=arc-20160816; b=ceQsH6wjUNRdZvapVnHMea0kVbSb40vD1P2UaloPAvV0/6Lh0uC8QPhq2YWNrGZMA+ KtzzO9rtA+NPxLRPcar/AJvSZK5NlhW6XZIeLI4AdlgBX3RgcqfzDWNfUztcOH/D3K43 z61Oz9WR7SRzyAwee25niGYS7C83XKXkf5xO9H+QUYy20K1WuqcSg1s0U9ESsFSfMOH+ jW2VKe/TpQWJ7+NfTZ2+zxoULn7DBy3jAzHjcSZauuGQiQ12lAORuC+gCb0nZrBear4C nEuOtc5ZdYR5n5DKUYYxqQjqAPJJfOO2okiTsQ1zAETiE9dDMZ/KIf6rHfyaoSBwFHjx nJCw== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=t6AXGgIxFl6HDCmlw2jWsjCYqEyPFDIAMmktjRkTkm4=; b=0GuI7XscCvn7kQAFxvxLB2YNuUhWayAFF2RxXwzKxJV2/ny3ABkn4HmM+Wl3DvGv5c cP5415vhwaJT217uXuq8CfWYdJO3fNQ/1aV3lNNstGYWqe69p6Lhy9wJzjKLK118rtsI zgwjIWlxjpDz8vcBzwhdCFKUBm06jfnEHN/4LaqpRZugK+s+0QL9FW5L4O3/5oGxsOua ycU3rTqqfAGexk5I7AO9q29FcCdt8h+WGZSNOyx9eEQ7E5/HIRncODuXKG2wxugAhk/3 nc0cWo+fA9Nb2kU9cGveNPCHdHePlQJmTLnzdVgDYFxX0f8RMEAYGA4qvBulDGnrocm3 hd7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bBC5AEeV; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u5si10888845pgp.2.2019.06.25.20.51.55; Tue, 25 Jun 2019 20:52:11 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=default header.b=bBC5AEeV; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726718AbfFZDl1 (ORCPT + 99 others); Tue, 25 Jun 2019 23:41:27 -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