Received: by 10.223.176.46 with SMTP id f43csp749807wra; Fri, 19 Jan 2018 01:06:30 -0800 (PST) X-Google-Smtp-Source: ACJfBov98H7Jn/w/4KwHoEEWKnNSeD/L7HStQxEo4bZKR7mHwLc00XRKKmi4lSClrUys5JG8i1ex X-Received: by 10.98.17.21 with SMTP id z21mr21821225pfi.86.1516352790709; Fri, 19 Jan 2018 01:06:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516352790; cv=none; d=google.com; s=arc-20160816; b=DzDnYTx7Dedau074prLkrlX0MqdRxFnOMptEoUGOlFMdK793+XKyEWO3Tf2DLZQOS/ XFYCXhkK8xyRgsBt9jo/Okv0GCWMrWJlzoS7WZYaNyk19Psq/o85kaphlQ1WHib6M8rq 7BW7/lAIkFFdI6SSx5LyhDPQa2l1pFFiz97As6hHXnNUbpzU+MlgodJZ7AWXln0F3S9C //o3TYGiFy99CDPnC+oWJeEZEw2PLhC1cURsPWpssqnL+B3WrE6IQ1/4IH8vFNBUXBcd vi1GhH/tyW6FAZCIeKZXAt52I7KSMCG8Bg5AUyFsD4nrOFboKystXwE7E5qnz6sWkai2 IZ4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=wRg2zVsZRsFl7WsR2sB+0a9dKZttLOXBseJS2Pe7J/M=; b=rxULCBbk9H9X3wTxODe3w7Dd9B2X8oDp8YR6afDXyEroZ5SMvs2hFh2rwQ3VYNiczp tjQC/hqq1CYMDc0SLrUo8AlTRkTGxZWujO/MqlBnK6glYjzW7cxD1HojmqgZKRpydLfV HJMDYJDPrQDqdiRrxFzjMjTyIuUOkf8wcXnYiej5D1eVmbwNu4DOjkVLkjuuC+lbVY8H DyI3Xo0cXGktyr9IZ2VjFcuRVvh/itIwZM7LtUShh9MsJY2Q/T9+Lbmv1uhhfEhaQvz1 x3T5M5eU8F7xcLZze1ie+HTcsfgS59CAlWZfiYjg7l2SdnaQ2EytOLBowUoOiVwfwbXe gI0g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a64si8796139pfc.349.2018.01.19.01.06.17; Fri, 19 Jan 2018 01:06:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755238AbeASJF2 (ORCPT + 99 others); Fri, 19 Jan 2018 04:05:28 -0500 Received: from mga06.intel.com ([134.134.136.31]:52689 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755464AbeASJDw (ORCPT ); Fri, 19 Jan 2018 04:03:52 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Jan 2018 01:03:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,381,1511856000"; d="scan'208";a="197007724" Received: from raj-desk2.iind.intel.com ([10.223.107.30]) by fmsmga006.fm.intel.com with ESMTP; 19 Jan 2018 01:03:49 -0800 From: Rajneesh Bhardwaj To: platform-driver-x86@vger.kernel.org Cc: dvhart@infradead.org, andy@infradead.org, linux-kernel@vger.kernel.org, vishwanath.somayaji@intel.com, srinivas.pandruvada@linux.intel.com, Rajneesh Bhardwaj Subject: [Patch v1 1/8] platform/x86: intel_pmc_core: Refactor debugfs entries Date: Fri, 19 Jan 2018 14:28:20 +0530 Message-Id: <1516352307-20123-2-git-send-email-rajneesh.bhardwaj@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516352307-20123-1-git-send-email-rajneesh.bhardwaj@intel.com> References: <1516352307-20123-1-git-send-email-rajneesh.bhardwaj@intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When on a platform if we can't show MPHY and PLL status, don't even bother to create a debugfs entry as it will fail anyway. In fact unless OEM builds a special BIOS for test, it will fail on every production system. This will help to add future platform support where we can't support these entries. Suggested-by: Andriy Shevchenko Signed-off-by: Srinivas Pandruvada Signed-off-by: Rajneesh Bhardwaj --- drivers/platform/x86/intel_pmc_core.c | 44 +++++++++++++---------------------- 1 file changed, 16 insertions(+), 28 deletions(-) diff --git a/drivers/platform/x86/intel_pmc_core.c b/drivers/platform/x86/intel_pmc_core.c index cf8b3b34a979..43cee8877ee3 100644 --- a/drivers/platform/x86/intel_pmc_core.c +++ b/drivers/platform/x86/intel_pmc_core.c @@ -407,43 +407,31 @@ static void pmc_core_dbgfs_unregister(struct pmc_dev *pmcdev) static int pmc_core_dbgfs_register(struct pmc_dev *pmcdev) { - struct dentry *dir, *file; - dir = debugfs_create_dir("pmc_core", NULL); - if (!dir) - return -ENOMEM; + pmcdev->dbgfs_dir = debugfs_create_dir("pmc_core", NULL); - pmcdev->dbgfs_dir = dir; - file = debugfs_create_file("slp_s0_residency_usec", 0444, - dir, pmcdev, &pmc_core_dev_state); - if (!file) - goto err; + if (!pmcdev->dbgfs_dir) + return -ENOMEM; - file = debugfs_create_file("pch_ip_power_gating_status", 0444, - dir, pmcdev, &pmc_core_ppfear_ops); - if (!file) - goto err; + debugfs_create_file("slp_s0_residency_usec", 0444, pmcdev->dbgfs_dir, + pmcdev, &pmc_core_dev_state); - file = debugfs_create_file("mphy_core_lanes_power_gating_status", 0444, - dir, pmcdev, &pmc_core_mphy_pg_ops); - if (!file) - goto err; + debugfs_create_file("pch_ip_power_gating_status", 0444, + pmcdev->dbgfs_dir, pmcdev, &pmc_core_ppfear_ops); - file = debugfs_create_file("pll_status", 0444, dir, pmcdev, - &pmc_core_pll_ops); - if (!file) - goto err; + debugfs_create_file("ltr_ignore", 0644, pmcdev->dbgfs_dir, pmcdev, + &pmc_core_ltr_ignore_ops); - file = debugfs_create_file("ltr_ignore", 0644, dir, pmcdev, - &pmc_core_ltr_ignore_ops); + if (pmcdev->map->pll_sts) + debugfs_create_file("pll_status", 0444, pmcdev->dbgfs_dir, + pmcdev, &pmc_core_pll_ops); - if (!file) - goto err; + if (pmcdev->map->mphy_sts) + debugfs_create_file("mphy_core_lanes_power_gating_status", + 0444, pmcdev->dbgfs_dir, pmcdev, + &pmc_core_mphy_pg_ops); return 0; -err: - pmc_core_dbgfs_unregister(pmcdev); - return -ENODEV; } #else static inline int pmc_core_dbgfs_register(struct pmc_dev *pmcdev) -- 2.7.4