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=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,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 4DBA9C6369E for ; Tue, 27 Oct 2020 15:41:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EEB24223B0 for ; Tue, 27 Oct 2020 15:41:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603813300; bh=qVeD5bUwBICjYMwZrkhhw7nlsAnowLiO/g1jqBC0BV4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=GYDDUOKFM36ExvP/TNpZ1RnSl0W993eA4VEZBvqaRa8P6xuF5Gn8VoolHqaxUGc0A o3SbYdSYd1Ptwy+eawLe0AHa5+FU4iDnfCBspaL2IJtksEoAStTESjeg1h2euYwXTR uRDmKjtp0om/AcUoGwA2ZlWW8hl6YbT93bcHBfcM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1800246AbgJ0PfZ (ORCPT ); Tue, 27 Oct 2020 11:35:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:48198 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1799389AbgJ0PbO (ORCPT ); Tue, 27 Oct 2020 11:31:14 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 D41CF22264; Tue, 27 Oct 2020 15:31:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603812674; bh=qVeD5bUwBICjYMwZrkhhw7nlsAnowLiO/g1jqBC0BV4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Lofm2mYNKPffhkTEgeV/LAo+rslFOOXRUMXNn8uHsea88Pzm3UKJsnewjuzScoH32 f5EWtgGam8Y7nK90j0gN3BONztmm5EhM/YI4M3lt8MYlBck03T/l96gI3Kn6vyBZSA kIJGShLg+tnhi9euGruDuSEKxIAr+vQIGGakjLHQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Murphy , Mark Brown , Sasha Levin Subject: [PATCH 5.9 292/757] ASoC: tas2770: Fix calling reset in probe Date: Tue, 27 Oct 2020 14:49:02 +0100 Message-Id: <20201027135504.264936822@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135450.497324313@linuxfoundation.org> References: <20201027135450.497324313@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dan Murphy [ Upstream commit b0bcbe615756d5923eec4e95996e4041627e5741 ] tas2770_reset is called during i2c probe. The reset calls the snd_soc_component_write which depends on the tas2770->component being available. The component pointer is not set until codec_probe so move the reset to the codec_probe after the pointer is set. Fixes: 1a476abc723e6 ("tas2770: add tas2770 smart PA kernel driver") Signed-off-by: Dan Murphy Link: https://lore.kernel.org/r/20200918190548.12598-1-dmurphy@ti.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/tas2770.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/tas2770.c b/sound/soc/codecs/tas2770.c index c098518343959..03d7ad1885b81 100644 --- a/sound/soc/codecs/tas2770.c +++ b/sound/soc/codecs/tas2770.c @@ -575,6 +575,8 @@ static int tas2770_codec_probe(struct snd_soc_component *component) tas2770->component = component; + tas2770_reset(tas2770); + return 0; } @@ -771,8 +773,6 @@ static int tas2770_i2c_probe(struct i2c_client *client, tas2770->channel_size = 0; tas2770->slot_width = 0; - tas2770_reset(tas2770); - result = tas2770_register_codec(tas2770); if (result) dev_err(tas2770->dev, "Register codec failed.\n"); -- 2.25.1