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.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 81AB5C606C1 for ; Mon, 8 Jul 2019 15:40:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 50C8821537 for ; Mon, 8 Jul 2019 15:40:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562600411; bh=eoMCDfK9f3NWMu6z1T5aINWr+ZuhRVivufvmgFHOXT0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=s+fRcihT6mCuHN7C4itNnn3Ypx1YJ2ZcWTdcoIITxUDfnX6zcMG4Lgi7OAq4A9QBo +gx6iB//At98aD1v/QclC5ThrunRnA07GczwjiPA10OUxekMxPqh6GTXEBi1ypyMAS 7RGSqUZ/bJjPL9t7XtQa/mhZQCj/1A3axt1LlUYw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389238AbfGHP2M (ORCPT ); Mon, 8 Jul 2019 11:28:12 -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: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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