Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp2265944pxm; Fri, 4 Mar 2022 12:41:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJxVHrAG3QfouB9jqMJSBb9752ktZQlgRL4SU/n8+GMXadUDM76sBGHRZuTg98g6LeMB+0v8 X-Received: by 2002:a17:90b:1e03:b0:1bf:2b74:e716 with SMTP id pg3-20020a17090b1e0300b001bf2b74e716mr413847pjb.189.1646426460039; Fri, 04 Mar 2022 12:41:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646426460; cv=none; d=google.com; s=arc-20160816; b=X9gncivEidHewtug85yYEV/xKDWdn+3bRshOe23Rs0+AloJlhQvkyHGmhitWtCA69l sUXCC5yKiQ+0xGceqd7sT2mA2R3vw6yirpffgha+bIZgTruqzdy+AOrIJycQVUl2EYGg DdsbU2cTYa+W07s+WFB9DqpxGDhZDKFGD1bgCUPGmFVBKk0yMOYw+Ze6QYED4nc3AYMe OCmTib3E66tKulVyDd47p+Q3mwVmwIbZOf7nAelEcc0ciJxybFJYuKa215po/tiLK48d HpsRx9LiEcoPM/JaINTMZ6y3m7gF0e/rfazOacLEIhYDfZa+4r0pyCLy6RMzYLTaebcN f/qQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=+sbwwquhd7VRn41M22O5HovK5bwG/uixEIwR4XVZkuM=; b=BcEAxUDDVHbSeFIAVqeGYcsfliIuSzF+TFe4jbrFx4sYwS7DXrkVW1GOL/5h6Te9Ra mUwOPfwnGEupPLLiiw+bzsI99I3BX6EXZh7gfSL2nt+2lG6MyBTN1N4jH9FEkh2uST5I uPEs6PYqJFPvYHUNailOHmUx1ILAYRp8cwi4RDkKjG9WXW7LR6J8XNQIiLRZ30svv2E2 fR1bAE4yJr2hrD1t+mvMfQRI47ybOBN6KWU7W+uJdiHVAgEg8YH0tsAULKTEpa0QUJmH xUIo6mfCh9fcAvYZMdrfpImZCiw1kPxTGxjCU1QDifnda2k3XrkRxyRixFI/RsLFzCLS Ya3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@microchip.com header.s=mchp header.b=H78fID3R; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id nk4-20020a17090b194400b001bf1cb96d0bsi425029pjb.122.2022.03.04.12.40.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Mar 2022 12:41:00 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=fail header.i=@microchip.com header.s=mchp header.b=H78fID3R; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1F4952A4EE0; Fri, 4 Mar 2022 11:40:58 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241603AbiCDSTM (ORCPT + 99 others); Fri, 4 Mar 2022 13:19:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241597AbiCDSTJ (ORCPT ); Fri, 4 Mar 2022 13:19:09 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FF128091F; Fri, 4 Mar 2022 10:18:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1646417900; x=1677953900; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=KXlre7vJPtWd2GewZg7v5Vo0cSdmJiieiW46LwNAOnA=; b=H78fID3RIK6tpZYgfdIgLn2uuYI06ekWR0megGdTB4GdsjvXZA5FsM0u nOknlCq6IFDHoQqleOWM0TiIh2I00wigjUaB/gvcpyX6av8FPwWuojGpT bAjY40IqXFzlDy0NuhRd5E3Wwoe3dFHaMIx9UznyxcgWqb2usbVRNh9HS n5GWGIPWsp2ct6zt13g9pGqlY7Whlljj0QPqZHfj9mVQSctFxyrA8tfJD zH3Ff+3Fmr0XbvQlRd6h6AmfXoziPbhOzMpm+526cel1o7OtlAdChp7yG VUxIO5PUhnOkbaNcTIHpFCTn2W9JBpRzJrVHMRWxsDajDmonA4fS1RvnH A==; X-IronPort-AV: E=Sophos;i="5.90,155,1643698800"; d="scan'208";a="155300391" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 04 Mar 2022 11:18:20 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Fri, 4 Mar 2022 11:18:19 -0700 Received: from rob-ult-m19940.amer.actel.com (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2375.17 via Frontend Transport; Fri, 4 Mar 2022 11:18:16 -0700 From: Codrin Ciubotariu To: , , , CC: , , , , , , "Codrin Ciubotariu" Subject: [PATCH 1/6] ASoC: dmaengine: do not use a NULL prepare_slave_config() callback Date: Fri, 4 Mar 2022 20:17:51 +0200 Message-ID: <20220304181756.1894561-2-codrin.ciubotariu@microchip.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220304181756.1894561-1-codrin.ciubotariu@microchip.com> References: <20220304181756.1894561-1-codrin.ciubotariu@microchip.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Even if struct snd_dmaengine_pcm_config is used, prepare_slave_config() callback might not be set. Check if this callback is set before using it. Fixes: fa654e085300 ("ASoC: dmaengine-pcm: Provide default config") Signed-off-by: Codrin Ciubotariu --- sound/soc/soc-generic-dmaengine-pcm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/soc-generic-dmaengine-pcm.c b/sound/soc/soc-generic-dmaengine-pcm.c index 285441d6aeed..2ab2ddc1294d 100644 --- a/sound/soc/soc-generic-dmaengine-pcm.c +++ b/sound/soc/soc-generic-dmaengine-pcm.c @@ -86,10 +86,10 @@ static int dmaengine_pcm_hw_params(struct snd_soc_component *component, memset(&slave_config, 0, sizeof(slave_config)); - if (!pcm->config) - prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config; - else + if (pcm->config && pcm->config->prepare_slave_config) prepare_slave_config = pcm->config->prepare_slave_config; + else + prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config; if (prepare_slave_config) { int ret = prepare_slave_config(substream, params, &slave_config); -- 2.32.0