From patchwork Tue Sep 24 08:12:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrei Simion X-Patchwork-Id: 13810499 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D46D7CF9C6B for ; Tue, 24 Sep 2024 08:14:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:CC:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=BVKocv+DGJVlhj6KjWBOIQY1SJn0I1RWmNo3edQGa6s=; b=aDUimcihDV7VAYn+XPBjP4xYxC pobHqYIHNh6oYtxVa42L3SJcF+Q9oLewk5IPvMNj3r3zRzNb19fMrIGuZNQOuKN4lMkBqk+X5c3jj xd3yNr8jQwZSA0ZE5/iSw3upkXJEOX7ueDzpD+6vNi16eVmT6yYiZmWPGx8qC6sEmW3SN7AfW2Zl6 FdDISh4bA+wCOTUMSZ7AJr7lXYpD0cnacnDmjHShNE9DdcL0f8YMKOrD1TP9RiaS65MPp25KkRbZU CTHENrm1ext3RaT/PcIkPbBLnycoBoMHlJxUrxijIcOj9O5+gTwxt/O9/P1BY0qi/exD89n+hgNW1 SywRgrpA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1st0gw-00000001YOO-3xQM; Tue, 24 Sep 2024 08:14:38 +0000 Received: from esa.microchip.iphmx.com ([68.232.154.123]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1st0fn-00000001YGP-1xyX for linux-arm-kernel@lists.infradead.org; Tue, 24 Sep 2024 08:13:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1727165607; x=1758701607; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=GZc63eXCJHLz2doVRvuGzvZovQYn0B8xHq46bwGnFE4=; b=P+xBg1SPncgVSvyODjbrdLqAe7IO985JUQ6ycIl3dNh4lZvDCNnGdlNC JxBveqEwiGsVLrmJ5apRAymv3eJYNF9keiWuaCv2+q7t4Qpr5ie0Icixx KZ5vXmCXO9AEbkzz7kgvjYNcdLXQW1lTgHoIRPzvruk8sonBiMOIPCBXV AChGuViOZcGUwazyycyte7HtOsEVMOC3GNNmWyAHXfGBKCilDkFU+Lsvw 9FEYm5s/IVpZjm6e523syjbYbtCgm1hBTA0ncksgzRl4Ae+zMrU2UIMnI E704Rr84cfWegfyTmIy2Mmu4KkwaWJK31X5OeHLS5R1/wn04/39zwnESx A==; X-CSE-ConnectionGUID: az7ICeymT/y/jLAHNtXqzg== X-CSE-MsgGUID: qObPW9fWTl6T45AWPAfa/g== X-IronPort-AV: E=Sophos;i="6.10,253,1719903600"; d="scan'208";a="32031723" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa4.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 24 Sep 2024 01:13:22 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Tue, 24 Sep 2024 01:12:59 -0700 Received: from ROB-ULT-M76677.microchip.com (10.10.85.11) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Tue, 24 Sep 2024 01:12:57 -0700 From: Andrei Simion To: , , , , , , CC: , , , , Andrei Simion Subject: [PATCH] ASoC: atmel: mchp-pdmc: Skip ALSA restoration if substream runtime is uninitialized Date: Tue, 24 Sep 2024 11:12:38 +0300 Message-ID: <20240924081237.50046-1-andrei.simion@microchip.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240924_011327_653086_358D0B26 X-CRM114-Status: GOOD ( 10.81 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Update the driver to prevent alsa-restore.service from failing when reading data from /var/lib/alsa/asound.state at boot. Ensure that the restoration of ALSA mixer configurations is skipped if substream->runtime is NULL. Fixes: 50291652af52 ("ASoC: atmel: mchp-pdmc: add PDMC driver") Signed-off-by: Andrei Simion --- sound/soc/atmel/mchp-pdmc.c | 3 +++ 1 file changed, 3 insertions(+) base-commit: 4d0326b60bb753627437fff0f76bf1525bcda422 diff --git a/sound/soc/atmel/mchp-pdmc.c b/sound/soc/atmel/mchp-pdmc.c index 939cd44ebc8a..06dc3c48e7e8 100644 --- a/sound/soc/atmel/mchp-pdmc.c +++ b/sound/soc/atmel/mchp-pdmc.c @@ -302,6 +302,9 @@ static int mchp_pdmc_chmap_ctl_put(struct snd_kcontrol *kcontrol, if (!substream) return -ENODEV; + if (!substream->runtime) + return 0; /* just for avoiding error from alsactl restore */ + map = mchp_pdmc_chmap_get(substream, info); if (!map) return -EINVAL;