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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D1600C433EF for ; Tue, 19 Jul 2022 13:08:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243042AbiGSNIC (ORCPT ); Tue, 19 Jul 2022 09:08:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242990AbiGSNHX (ORCPT ); Tue, 19 Jul 2022 09:07:23 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 902F9863C0; Tue, 19 Jul 2022 05:27:36 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8E540B81B38; Tue, 19 Jul 2022 12:27:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DA9D6C341C6; Tue, 19 Jul 2022 12:27:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1658233630; bh=PGWSdhX/3zv4TJ/w6fn2AbCsBncBUGQHcN7CV7vZPls=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SjwqbJUp7O8ix6+eRTPr3chouvuHf6e1WlDV1hm67616MQ1LJ4Q+HgWGDxW4xr5JJ /I4UHzkgDWQ0usqTLftR4wBGUW4b4OZOwzWj1Jx/gIwH1edcbncQuWn1Mm0BLfQe0Y q8+qMr2ORxXCKf3XgCZKxi7rQKyqZkuvSyXC4AbU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pierre-Louis Bossart , Rander Wang , Bard Liao , Mark Brown , Sasha Levin Subject: [PATCH 5.18 188/231] ASoC: rt711: fix calibrate mutex initialization Date: Tue, 19 Jul 2022 13:54:33 +0200 Message-Id: <20220719114730.015578035@linuxfoundation.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220719114714.247441733@linuxfoundation.org> References: <20220719114714.247441733@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: Pierre-Louis Bossart [ Upstream commit 08bb5dc6ce02374169213cea772b1c297eaf32d5 ] Follow the same flow as rt711-sdca and initialize all mutexes at probe time. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20220606203752.144159-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/rt711-sdw.c | 3 +++ sound/soc/codecs/rt711.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) --- a/sound/soc/codecs/rt711-sdw.c +++ b/sound/soc/codecs/rt711-sdw.c @@ -474,6 +474,9 @@ static int rt711_sdw_remove(struct sdw_s if (rt711->first_hw_init) pm_runtime_disable(&slave->dev); + mutex_destroy(&rt711->calibrate_mutex); + mutex_destroy(&rt711->disable_irq_lock); + return 0; } --- a/sound/soc/codecs/rt711.c +++ b/sound/soc/codecs/rt711.c @@ -1206,6 +1206,7 @@ int rt711_init(struct device *dev, struc rt711->sdw_regmap = sdw_regmap; rt711->regmap = regmap; + mutex_init(&rt711->calibrate_mutex); mutex_init(&rt711->disable_irq_lock); /* @@ -1320,7 +1321,6 @@ int rt711_io_init(struct device *dev, st rt711_jack_detect_handler); INIT_DELAYED_WORK(&rt711->jack_btn_check_work, rt711_btn_check_handler); - mutex_init(&rt711->calibrate_mutex); INIT_WORK(&rt711->calibration_work, rt711_calibration_work); schedule_work(&rt711->calibration_work); }