From patchwork Wed Nov 21 13:29:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 151688 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1927998ljp; Wed, 21 Nov 2018 05:29:38 -0800 (PST) X-Google-Smtp-Source: AFSGD/XbfzgarbYFNJeMx+d9UtqewlQ5+cHltJ5qQzqJ0xrBxFjUc0x5cnoeoOf1yrDeOoFu2Tep X-Received: by 2002:adf:f691:: with SMTP id v17mr5669451wrp.114.1542806978085; Wed, 21 Nov 2018 05:29:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542806978; cv=none; d=google.com; s=arc-20160816; b=hBvRhNUZZp6WkwiPsGuRRzV1K3Wcd88CtoTvtI8urLiQJ27lFZ8NCBouIsn8X7Aud4 JVh9oryOrAVlmanTx1e+2PyufkldPbKfqZu4k6PTV/l7Hp3qs7o8TEjER7COz28Z9udj tKfCDVTexmWmosK6TatId7EsuTNVuOUOLvWk70PSvoHPf5zxrcm/VvcDaZvEBSOh1Fak vwOAUis7z0ptJmlE+9m/Df6+VfRzLQsFhW/mfFyo4cZBvVmHTuvGmAqNS+fRxl1uN1NP 5UNUHbEtdGZHtho1V8MWNTEIXSuAzBCwxeTQeHr2/MQG+dIU4xvRxP4XgqO9XyLi61os goqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:date:message-id:in-reply-to:to:from :dkim-signature:delivered-to; bh=qeiS/gUuYwrKU/ksN/2Xlzk0WJM9jOaXOphsD/WFCrE=; b=btE6YFRbKFb+ZEZ2PKyId8uzYZUd44Y5NvtuRazvQyBccO2yOhErXgDa9z/LpmLG9y E+LR2k45Ezn/YgVqSNwWEdtEXIdrsOK9Ox3/aPGv+WxVehzguADBN5KaOue+lBh+KvfO ZoIyQkz+WQQDZCfJk/AI6mvfbPVUskRTsPfFe9YN8mPFDGucJM3N0J6P+kc/LcryvdaD vQcLr6HVuJDN22Sx3+k7nSMzQMmCFsIeKrESA/K13dKaD70QKakJcIuEgvCp0YZa9qNI t4oK5+fVLJH5to2Y0eFF04V3hZOmkD8I7BHARerjH1MsqO45e/+Ndjo2+x57WzM65tMG drnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=u8RWC6UN; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id c18si2566346wrn.194.2018.11.21.05.29.37; Wed, 21 Nov 2018 05:29:38 -0800 (PST) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=u8RWC6UN; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 1921A267A7D; Wed, 21 Nov 2018 14:29:37 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 27087267A61; Wed, 21 Nov 2018 14:29:35 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE autolearn=disabled version=3.4.0 Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk [172.104.155.198]) by alsa0.perex.cz (Postfix) with ESMTP id 44201267A7E for ; Wed, 21 Nov 2018 14:29:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=zfj790AVYcLWt+hF22y45V0vaGXQSQr9gWX9xzUdKa4=; b=u8RWC6UNF+8g 0S/OFMKHcDVYK5ZB/4ZC4FvPiChpZZs9paqdD5SYpP5GAn+xYrqLREUYKpcbqN+mfXN3+VySG6o1g gtQkKb6fCOBYBbLwUDD8LQzUP7Lq1Tpnsmar8VCb1r6aBldW/7XmSFPlw9jh1tYrsYoRVI/DJPcnh Tdw2g=; Received: from cpc102320-sgyl38-2-0-cust46.18-2.cable.virginm.net ([82.37.168.47] helo=debutante.sirena.org.uk) by heliosphere.sirena.org.uk with esmtpa (Exim 4.89) (envelope-from ) id 1gPSZQ-0003Ys-S9; Wed, 21 Nov 2018 13:29:32 +0000 Received: by debutante.sirena.org.uk (Postfix, from userid 1000) id 9256B11250AE; Wed, 21 Nov 2018 13:29:32 +0000 (GMT) From: Mark Brown To: Kuninori Morimoto In-Reply-To: <87tvkbp4v0.wl-kuninori.morimoto.gx@renesas.com> Message-Id: <20181121132932.9256B11250AE@debutante.sirena.org.uk> Date: Wed, 21 Nov 2018 13:29:32 +0000 (GMT) Cc: alsa-devel@alsa-project.org, Mark Brown Subject: [alsa-devel] Applied "ASoC: simple-card-utils: accept NULL parameter on asoc_simple_card_xxx()" to the asoc tree X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org The patch ASoC: simple-card-utils: accept NULL parameter on asoc_simple_card_xxx() has been applied to the asoc tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark >From f31a17105560f5f074f4d26fd5469a221f50af18 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Wed, 21 Nov 2018 02:09:16 +0000 Subject: [PATCH] ASoC: simple-card-utils: accept NULL parameter on asoc_simple_card_xxx() If simple-card-utils accept NULL pointer on asoc_simple_card_xxx(), each driver code will be more simple. Let's accept NULL pointer. Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown --- sound/soc/generic/simple-card-utils.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) -- 2.19.0.rc2 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c index 996bfe42bc8d..f3183a4718b3 100644 --- a/sound/soc/generic/simple-card-utils.c +++ b/sound/soc/generic/simple-card-utils.c @@ -153,13 +153,17 @@ EXPORT_SYMBOL_GPL(asoc_simple_card_parse_card_name); int asoc_simple_card_clk_enable(struct asoc_simple_dai *dai) { - return clk_prepare_enable(dai->clk); + if (dai) + return clk_prepare_enable(dai->clk); + + return 0; } EXPORT_SYMBOL_GPL(asoc_simple_card_clk_enable); void asoc_simple_card_clk_disable(struct asoc_simple_dai *dai) { - clk_disable_unprepare(dai->clk); + if (dai) + clk_disable_unprepare(dai->clk); } EXPORT_SYMBOL_GPL(asoc_simple_card_clk_disable); @@ -342,6 +346,9 @@ int asoc_simple_card_init_dai(struct snd_soc_dai *dai, { int ret; + if (!simple_dai) + return 0; + if (simple_dai->sysclk) { ret = snd_soc_dai_set_sysclk(dai, 0, simple_dai->sysclk, simple_dai->clk_direction);