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 X-Spam-Level: X-Spam-Status: No, score=-9.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham 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 4D3B8C43613 for ; Fri, 21 Jun 2019 11:34:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 237622084E for ; Fri, 21 Jun 2019 11:34:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561116843; bh=0tTpqxUxMW9zh5apcdOFeOYincPtzsVpaaXi+T/tGuU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=fUkptw2JVXHUai6JEtIJCxokmBOWPh66q6hM9eLXVy29XBwyTnBlBZ5O8oN60swGM Zk5fciGd2keKl3DfpCfAs1Rwfrm0xDRXPR1/yCOG8TgcoWbUKaKFQW1hOIkymYW1ak 1K2J/h/JBuJY9pntAKsjCr/uxq5aWsGaxHuryRTs= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726309AbfFULeC (ORCPT ); Fri, 21 Jun 2019 07:34:02 -0400 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:48412 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726232AbfFULeC (ORCPT ); Fri, 21 Jun 2019 07:34:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=vAum9r+cTFtt1A+kfiwJThOZ57jM6FC+5+se9oFWUHA=; b=dkErER1zL53TinPJkkfNLEDdDU lsUv6BSdLuZfDjrOC2lKumqE2G6/LIPE1rzoPOTsmq8TI+KSpKizYTt2TNE8skZA/JacvZ+fXubIR 6VH6YPPmw0XZx2y2pRBAv0suWAHJJqNBB18M7yff3XVNxZyBSEx6MyDf0bbSmsjlsWSw=; Received: from [2001:470:1f1d:6b5:7e7a:91ff:fede:4a45] (helo=finisterre.sirena.org.uk) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1heHnq-0002PX-U9; Fri, 21 Jun 2019 11:33:58 +0000 Received: by finisterre.sirena.org.uk (Postfix, from userid 1000) id 495EF440041; Fri, 21 Jun 2019 12:33:57 +0100 (BST) From: Mark Brown To: Liam Girdwood Cc: alsa-devel@alsa-project.org, Mark Brown , stable@vger.kernel.org Subject: [PATCH 2/2] ASoC: dapm: Adapt for debugfs API change Date: Fri, 21 Jun 2019 12:33:57 +0100 Message-Id: <20190621113357.8264-2-broonie@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190621113357.8264-1-broonie@kernel.org> References: <20190621113357.8264-1-broonie@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org Back in ff9fb72bc07705c (debugfs: return error values, not NULL) the debugfs APIs were changed to return error pointers rather than NULL pointers on error, breaking the error checking in ASoC. Update the code to use IS_ERR() and log the codes that are returned as part of the error messages. Fixes: ff9fb72bc07705c (debugfs: return error values, not NULL) Signed-off-by: Mark Brown Cc: stable@vger.kernel.org --- sound/soc/soc-dapm.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 6b44b4a78b8e..f013b24c050a 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -2156,23 +2156,25 @@ void snd_soc_dapm_debugfs_init(struct snd_soc_dapm_context *dapm, { struct dentry *d; - if (!parent) + if (!parent || IS_ERR(parent)) return; dapm->debugfs_dapm = debugfs_create_dir("dapm", parent); - if (!dapm->debugfs_dapm) { + if (IS_ERR(dapm->debugfs_dapm)) { dev_warn(dapm->dev, - "ASoC: Failed to create DAPM debugfs directory\n"); + "ASoC: Failed to create DAPM debugfs directory %ld\n", + PTR_ERR(dapm->debugfs_dapm)); return; } d = debugfs_create_file("bias_level", 0444, dapm->debugfs_dapm, dapm, &dapm_bias_fops); - if (!d) + if (IS_ERR(d)) dev_warn(dapm->dev, - "ASoC: Failed to create bias level debugfs file\n"); + "ASoC: Failed to create bias level debugfs file: %ld\n", + PTR_ERR(d)); } static void dapm_debugfs_add_widget(struct snd_soc_dapm_widget *w) @@ -2186,10 +2188,10 @@ static void dapm_debugfs_add_widget(struct snd_soc_dapm_widget *w) d = debugfs_create_file(w->name, 0444, dapm->debugfs_dapm, w, &dapm_widget_power_fops); - if (!d) + if (IS_ERR(d)) dev_warn(w->dapm->dev, - "ASoC: Failed to create %s debugfs file\n", - w->name); + "ASoC: Failed to create %s debugfs file: %ld\n", + w->name, PTR_ERR(d)); } static void dapm_debugfs_cleanup(struct snd_soc_dapm_context *dapm) -- 2.20.1