From patchwork Tue Oct 27 13:49:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 312569 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, 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 629C1C8300B for ; Tue, 27 Oct 2020 15:43:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2BA2422202 for ; Tue, 27 Oct 2020 15:43:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603813410; bh=qVeD5bUwBICjYMwZrkhhw7nlsAnowLiO/g1jqBC0BV4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Ft/G74ReIfVz2BJc+uiuO0Pb1Hqfu6MOlMtWrsp83Hd+NE/WzApscPnBTizOQBRKW Yo3Ntf8SkxZBXnZHRJZ820kiVoVe+CtzVcBZHamFz/9DPeyyw0/MtengeBMMNJEY8x 18Cep7rMCX7Y6CdoAYELaGwPD34vvfi6BbueCSU8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1799393AbgJ0PbP (ORCPT ); Tue, 27 Oct 2020 11:31:15 -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 Precedence: bulk List-ID: X-Mailing-List: stable@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");