Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7150012ybi; Mon, 8 Jul 2019 15:39:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqx3TO3sE4KIJXYsDnIgTx/bhVMnT2XvC09jJ9Obf2avI+V4FdeyY45tlaR1YfXyL1lCYHwC X-Received: by 2002:a17:902:830c:: with SMTP id bd12mr28330427plb.237.1562625540248; Mon, 08 Jul 2019 15:39:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562625540; cv=none; d=google.com; s=arc-20160816; b=0/qLwxuxdKZm6P+QY3AauvBtVpIXxCx/kB1yoK+O9jIjId26l/qWT/sFuACVeeNd5P mSpZ/g0eLVqnWpAbb/fqTzf9CdWtQwmSumtGD0trMbtOmRNGN5hVyJEvSHX/xQI46mdo zkL7UwCEiQmxEs/6gxV8PipSBIKSu4sBoZhJLekq3SwNlHFXZE4UpHdvNZQxVg0gqEu2 GYK58cePRiIVTDZsEkIthYRTFTTIWKHWmmBSE9+aSKrn40HsoT4RZ73d5jBs1+/jwpV1 6ZTpv/PCHARVUYjglex0WOYN20aGnCna8OvvTCDh8nItx+GRbqw5qoF3fsA9j/P51i9O RdyA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=dEwNtt5f/B0uQ7DvvoNkTapJgCs1m5mVht5sRi2Q/sc=; b=tTXpPamQbsDqlVuKxoWHneKA56q0We8xxNVJcLzx8p0rUUoWjdjudpwpG99sbwvDYz O/gp2sKD8YzQL3fMb+9KbSsOsCWtSO8z5hBYj2RK28KXSBkgEy0HFOP8QSc+oz1/Ecez jSW1GvloBvg6sFgIIfgwe/5GOQaU5Dx4bl35rHj8yBJbwH+CLaWajhkKmwEu7oGetEUO xWh34YHHS4k+AZbzNq8iWurFXN3q2sXVJiseR2bp/JDezwKWmJ0k6/aQ8qBBe4CXHfu1 ovNbiBYcgcuMMKPZkBJfsgKxzRb3A3uQrzeNC92FKVxy2cbYbHc8xX9uxkKNM9SWHa/5 jE6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=G8tzQh5O; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id az12si16263571plb.5.2019.07.08.15.38.45; Mon, 08 Jul 2019 15:39:00 -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=G8tzQh5O; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389246AbfGHP2O (ORCPT + 99 others); Mon, 8 Jul 2019 11:28:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:56672 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730098AbfGHP2M (ORCPT ); Mon, 8 Jul 2019 11:28:12 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 35359216F4; Mon, 8 Jul 2019 15:28:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562599691; bh=eoMCDfK9f3NWMu6z1T5aINWr+ZuhRVivufvmgFHOXT0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=G8tzQh5OokOdtZJepjmx7BhxuXPqhRQ4GxS/x7uqe24IO8pdzM00ln+J1dw7LsN85 b1U29PfHxCelrcKJd7Ns7HVS5/KvnVvuzSd0NnkTx8KlmMq3ZWwVNjp1mNdw0qzffY UZTNRUtyqBiZrlyAvDtjg37Kg7HFYkwYVvcg6MXY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shengjiu Wang , Viorel Suman , Mark Brown , Sasha Levin Subject: [PATCH 4.19 09/90] ASoC: ak4458: add return value for ak4458_probe Date: Mon, 8 Jul 2019 17:12:36 +0200 Message-Id: <20190708150523.045910122@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190708150521.829733162@linuxfoundation.org> References: <20190708150521.829733162@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ 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 299ada4dfaa0..58b6ca1de993 100644 --- a/sound/soc/codecs/ak4458.c +++ b/sound/soc/codecs/ak4458.c @@ -492,9 +492,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) @@ -502,21 +503,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