From patchwork Mon Oct 10 11:12:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9369347 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4A21D607D2 for ; Mon, 10 Oct 2016 11:14:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3B4A0295D3 for ; Mon, 10 Oct 2016 11:14:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2F8D1295EA; Mon, 10 Oct 2016 11:14:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1C0F5295D3 for ; Mon, 10 Oct 2016 11:14:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751503AbcJJLOK (ORCPT ); Mon, 10 Oct 2016 07:14:10 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:62468 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751423AbcJJLOJ (ORCPT ); Mon, 10 Oct 2016 07:14:09 -0400 Received: from wuerfel.lan. ([78.43.20.153]) by mrelayeu.kundenserver.de (mreue001) with ESMTPA (Nemesis) id 0MNyjT-1bm7Te0Fad-007RqS; Mon, 10 Oct 2016 13:13:37 +0200 From: Arnd Bergmann To: Darren Hart Cc: Greg Kroah-Hartman , Andy Shevchenko , Rajneesh Bhardwaj , Darren Hart , Nicolai Stange , Arnd Bergmann , Vishwanath Somayaji , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] intel_pmc_core: avoid boot time warning for !CONFIG_DEBUGFS_FS Date: Mon, 10 Oct 2016 13:12:58 +0200 Message-Id: <20161010111313.119658-2-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20161010111313.119658-1-arnd@arndb.de> References: <20161010111313.119658-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K0:Opb8FXeH1o4bQc95vYomiGHMAX7v89aYNzAe421kXKsLykbNyl/ oBMczH4BysoEZk+LRCykcjgl4I7YyfhZebjE0D+daNdHDV7ZsaQGZNBHmNOMalLStP/Hvia XAxvaUJ88Z4iZP0QNjG11Q3KAZsz47Q7QOczM6LjfL/c/as+7/wI2k3IBSDnPMqJ4td9dq1 2ePjj1E9X6ARGTUdOu7gA== X-UI-Out-Filterresults: notjunk:1; V01:K0:vtiGckOYNDQ=:ag5wL3aguHn5dk8oKjlARx cDasNH7kjrCDdEUMBLDJTMSjvbS7ZHLAphPSg7BCd8pDGKcoPAbcyMMjnnWfis+uMUERZPpSr mtANXOst2uqWirMAev06bSasGfX3bcxZVHAwuf1nEF5GczTrvcAE/GbTKFAO0dfy7pF2qNGUF xJ3U1+V6iEkUZWOv5OzxsTzDBr9my7hpq8VPcBLjY7yaLClPJmyD97tooK6cDE3wehWUVOsX7 kRBrd/KPWdE4i1j4QkX4Q1nQsllZB6kkjmTZLNtLtUKK7Rzagmlv4VgWInnytZ76riZozEUOG sE3RO4NafYsm6G1quWao7XBFblDClXz8qSBTmBbnxCu0k8ItVwm6NRDABbPy82nIqb2lq5Peq VFZbRyHQ7Mn8tvMD+TEFX+jA5zHUL0g9aQUhm8kZqGRhY3fB5O8HR3VpinZexvmcWqM892B/y 4mCPdBytyZOCO1d1DOptPTtCMUvn4C+k97AqybPXEJs63aZRfOmOW1BYLqMq8nqiNGhcW9fav J3W7PQ3iTMO9FGYoA9tq6DUe7/FBfjYvgrTLr+WmzddK1d5WiVf+7TAbGMAWtEZOu5HndRtJl dc4X52ZH/cPQB/8GXkZQNrtr3upq+IG2k3d0/K92t0TCTv0lIGNb+oVBY1yLmOirC4NxRzx0K +YWDcUgNSzRZSObVHNdp4g+QNOEZTGuHhkBq+Jdew/e9lwFDTGfYRrFEpV7sIzUNfHlHDX4Et FFG3rSi1k6JxGMDF Sender: platform-driver-x86-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP While looking at a patch that introduced a compile-time warning "‘pmc_core_dev_state_get’ defined but not used" (I sent a patch for debugfs to fix it), I noticed that the same patch caused it in intel_pmc_core also introduced a bogus run-time warning: "PMC Core: debugfs register failed". The problem is the IS_ERR_OR_NULL() check that as usual gets things wrong: when CONFIG_DEBUGFS_FS is disabled, debugfs_create_dir() fails with an error code, and we don't need to warn about it, unlike the case in which it returns NULL. This reverts the driver to the previous state of not warning about CONFIG_DEBUGFS_FS being disabled. I chose not to restore the driver to making a runtime error in debugfs fatal in pmc_core_probe(). Fixes: df2294fb6428 ("intel_pmc_core: Convert to DEFINE_DEBUGFS_ATTRIBUTE") Signed-off-by: Arnd Bergmann --- drivers/platform/x86/intel_pmc_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/x86/intel_pmc_core.c b/drivers/platform/x86/intel_pmc_core.c index 520b58a04daa..e8b1b836ca2d 100644 --- a/drivers/platform/x86/intel_pmc_core.c +++ b/drivers/platform/x86/intel_pmc_core.c @@ -100,7 +100,7 @@ static int pmc_core_dbgfs_register(struct pmc_dev *pmcdev) struct dentry *dir, *file; dir = debugfs_create_dir("pmc_core", NULL); - if (IS_ERR_OR_NULL(dir)) + if (!dir) return -ENOMEM; pmcdev->dbgfs_dir = dir;