Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5049040yba; Mon, 13 May 2019 04:37:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqyLLqT4IogwI3UjR7pRHUkJf3fmJRH/itrDbcJEWnVz4OIZjeUx23S2ShyC7V+bkNVcLKi0 X-Received: by 2002:a05:6a00:cc:: with SMTP id e12mr32560409pfj.207.1557747436309; Mon, 13 May 2019 04:37:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557747436; cv=none; d=google.com; s=arc-20160816; b=e61K1+UO6Zv8NEcq6nKN3mtnQoFemV1QHR52lSO5Q3svY2u+LAdTKsz+MU99ohN7Kl v/X2q8MnyBleuHM8J0DH0byiouFGSu7HIFvMWAjXamwsSTnOt1U87p1Yi0sG5sogYO3C heLburcD2+dezNOlq5lOObMTuAvH0kBreu3Gz8u7jyMgJYU+klNzMMjsLvt1GJYKcStR U+z3tWi2j42Ei57lX7hoPqFfmX4EJeBqY5kzMf3GLKdZNwjsY1/Cp+rce/+2RiYoJsHJ 2iqFd84sDSHbKJFnodvl+IzMZdNFglc1N8flpsSqtQrICOuJJvh3lYTMr3dI4Zw8KRKs Eu2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=UWmGYQkX5ziDlQEAMnWWXiWNixr8ETc6toa2bNjqovo=; b=zrhCxoRa9F30nU9i/uVBC8rEEvA9+VmHg4wnJntNkuztbvMLrJAO630SMLPLrGgYb5 NU/1+StZ9tG/RaU5AM1Wn6MneZgXcnS10uiOzYEin7uIYtgw20lL3/ShS/u2XWZGYH9G 6/58zJa8TtkFKlvTnYuX3wN7S1QtLzf3fPn1H5aJcDKlCLng95kDT43KKmLdpceOdxaZ 5Zw452tnUpLnlzf26jq9sMFEQPYz/LrbgzjQDiLePJ14V41XRmS5MdHV+2+6ekY4SmMf fUeEtIyVhn0KvE9km3BXNX+Z3JHyUnNCupLjE38MpcN0ljBFnYSIoHjwsz6oIHZY4m/8 JgyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=p9pxyutt; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g7si10196735pgi.38.2019.05.13.04.37.00; Mon, 13 May 2019 04:37:16 -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=@gmail.com header.s=20161025 header.b=p9pxyutt; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729292AbfEMLOs (ORCPT + 99 others); Mon, 13 May 2019 07:14:48 -0400 Received: from mail-ed1-f65.google.com ([209.85.208.65]:46481 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728116AbfEMLOr (ORCPT ); Mon, 13 May 2019 07:14:47 -0400 Received: by mail-ed1-f65.google.com with SMTP id f37so16977176edb.13 for ; Mon, 13 May 2019 04:14:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=UWmGYQkX5ziDlQEAMnWWXiWNixr8ETc6toa2bNjqovo=; b=p9pxyutt3nteInevAPKvPqzooCTEiAwiquO+LcBVrdiBLukNvM4nG5ZQTW8QtcyVsT jZu83ZbINTP8vZ1TSPWXxh5LjStyLFesGIRHR0+bfcipRebTmcyfmwuuq1535mJYI57o BQVkIel/2raqaE1U4wX0nqm+mfOXENzHoVhjZwIBa6g6xt0zCpSNOGuEVqYYPsX13Dpc KCwgP5qExQ7UQjKJV1L05mlKOZtObyxN6jEO1eU4V3cqqL+R2Mf19P3nkYLaz7Mq8NKd LzY9b+fdOOZ5sgFqb0W4J0L+kJbV8R09Q3kjrTXFIrCmycJoSB8gpMN17V5612EdGpaR /0GQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=UWmGYQkX5ziDlQEAMnWWXiWNixr8ETc6toa2bNjqovo=; b=cEI3YUVTOjRvBhFpGe9OivbEY28dSK8cMOBnvCY8ywX8z0p+IjoTHJwBoWb2uIbOqN 0PZe6tS46Gb4x7SykEhei/NsTObuBzhy+K4nB1lPT6ODPhkazNMnRjS46DtORPP++0pB hxA6oonxjtWaxkp4Apz8vZPmi6Xon8zUX0YDKQTYnrjom91YuoAAgLZvt2IXSqv22lkD qZWnfCHkdhJlhvWyBvtXTJMhVb2qLl8l2gdWqxDIg8zwWHWa27TfWmVMtNNZIbfpAWaG vuTHDZp/ZxTlXulUiG1hqhtNN4+LrirtwUVnCeIpKeYo4QfP9guSA+3FzGHLPL2ImKax 7kJg== X-Gm-Message-State: APjAAAWJV2EOyHRwlVOItFt6WSDbFc42xsC1cfPlSoNn83kne+lDOKj2 K1JxCxj7AxxmgeRhB5ChmNaqieK1MOcPVNnTZ8w= X-Received: by 2002:a50:9441:: with SMTP id q1mr28451354eda.101.1557746086425; Mon, 13 May 2019 04:14:46 -0700 (PDT) MIME-Version: 1.0 References: <1557741724-6859-1-git-send-email-viorel.suman@nxp.com> <1557741724-6859-3-git-send-email-viorel.suman@nxp.com> In-Reply-To: <1557741724-6859-3-git-send-email-viorel.suman@nxp.com> From: Daniel Baluta Date: Mon, 13 May 2019 14:14:35 +0300 Message-ID: Subject: Re: [alsa-devel] [PATCH V2 2/2] ASoC: ak4458: add return value for ak4458_probe To: Viorel Suman Cc: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , "S.j. Wang" , Daniel Baluta , Julia Lawall , Colin Ian King , "alsa-devel@alsa-project.org" , "linux-kernel@vger.kernel.org" , Viorel Suman , dl-linux-imx Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 13, 2019 at 1:05 PM Viorel Suman wrote: > > 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 Reviewed-by: Daniel Baluta > --- > 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 baf990a..7156215 100644 > --- a/sound/soc/codecs/ak4458.c > +++ b/sound/soc/codecs/ak4458.c > @@ -539,9 +539,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) > @@ -549,21 +550,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.7.4 > > _______________________________________________ > Alsa-devel mailing list > Alsa-devel@alsa-project.org > https://mailman.alsa-project.org/mailman/listinfo/alsa-devel