Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1176193pxb; Thu, 28 Jan 2021 09:41:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJzY9Y3g4f922zdUvFG0aywl9EWUOomxK5NaaFdSwx8houlLuqdbl5jYCKGNZ6lzXKYp2k6P X-Received: by 2002:aa7:c643:: with SMTP id z3mr778169edr.330.1611855702371; Thu, 28 Jan 2021 09:41:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611855702; cv=none; d=google.com; s=arc-20160816; b=j+y+ZNI1ulyVb8EBfwG1as0q1Nrvtyg5ZGaluo8eRGjyNhulYvP//gLgBNzzG/WBBe TgNQhbSX8sPLQq5H8ZZRqs6xoNKtl3Su2A3zDtcrxhr2IYbNXI7LMBPelLhDvo6l/2MB eRacNBvXAhEjWDX809Bq2TSnd9T/14kwTREcle2OR3V4C7Ux098AuMiBLSPcWnFmaWPv RBVLjrelFvb3SUmy9gR6TveW1QpH4T9+DU6LUlf2jwOBfH9mcIfOm1Qn97yQsKEmKfJS /XMYij1r6yzPeaiVZ53PFWP/txOjMZ6790cMWKeeJYpyS3Go96Oyx9SmxmkoppQMe6Kj 6Xhg== 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 :message-id:date:subject:cc:to:from:ironport-sdr:ironport-sdr; bh=bZdKMqYLuximQ24EbV8vqxBGGII+nXwqCoPBtDAxiXA=; b=YC/vQ0y9FFJZU2RjPIDVzEyamZ+9s6621AwSQSWdYtx1t5XC1cDvhspt7knEcol2Cu 3PpeY9Mm4Ue89WUnO03CzNAjulVkK/pb64O5ncHDNbV5hAGtHpAcJBNOl0VpzPD7jpZK m/dXkNDhAUUaA9rfW62CRL+t6Z/atLP1yOgu1o7s2Mf1z4XgGRdl0E8NJCWw7a8QVGuj 01JKHmThtXIPiJ9RFx+SLiGSOd1UWewdt50bTWPJ7tDGUNbhLrwsXepD31+/5JNKiTa3 kqgUuUj/zsAtiaHJWNGzxvX2dxUDdugR8d1oCsJhWJMaCOVQyZQ3+eCDzpwKABWNCDgb q6Uw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bm24si3518044edb.590.2021.01.28.09.41.17; Thu, 28 Jan 2021 09:41:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233238AbhA1Rhl (ORCPT + 99 others); Thu, 28 Jan 2021 12:37:41 -0500 Received: from mga17.intel.com ([192.55.52.151]:63532 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233074AbhA1Rdj (ORCPT ); Thu, 28 Jan 2021 12:33:39 -0500 IronPort-SDR: Q4zsTg/xg44IoCj0/eLcLvnVJx4IiqjmB7toazXySFdvVKRHxwinKjjFyzWEkW+HZyUd563ekb ycfE4ffIx6fA== X-IronPort-AV: E=McAfee;i="6000,8403,9878"; a="160048712" X-IronPort-AV: E=Sophos;i="5.79,383,1602572400"; d="scan'208";a="160048712" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jan 2021 09:30:12 -0800 IronPort-SDR: LCEsI5E5q1CgdGYlGyNz65s5dbrwIYLnhEQhrERIu+mcVZlZE6itgG0hPHeK84Oq6Qi2TfXecS vJNRyFYL126Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.79,383,1602572400"; d="scan'208";a="505389607" Received: from linux.intel.com ([10.54.29.200]) by orsmga004.jf.intel.com with ESMTP; 28 Jan 2021 09:30:12 -0800 Received: from debox1-desk2.jf.intel.com (debox1-desk2.jf.intel.com [10.54.75.16]) by linux.intel.com (Postfix) with ESMTP id E4EB1580565; Thu, 28 Jan 2021 09:30:11 -0800 (PST) From: "David E. Box" To: lee.jones@linaro.org, hdegoede@redhat.com Cc: "David E. Box" , linux-kernel@vger.kernel.org Subject: [PATCH] MFD: intel_pmt: Fix nuisance messages and handling of disabled capabilities Date: Thu, 28 Jan 2021 09:28:46 -0800 Message-Id: <20210128172846.99352-1-david.e.box@linux.intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some products will be available that have PMT capabilities that are not supported. Remove the warnings in this instance to avoid nuisance messages and confusion. Also return an error code for capabilities that are disabled by quirk to prevent them from keeping the driver loaded if only disabled capabilities are found. Fixes: 4f8217d5b0ca ("mfd: Intel Platform Monitoring Technology support") Signed-off-by: David E. Box --- drivers/mfd/intel_pmt.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/mfd/intel_pmt.c b/drivers/mfd/intel_pmt.c index 744b230cdcca..65da2b17a204 100644 --- a/drivers/mfd/intel_pmt.c +++ b/drivers/mfd/intel_pmt.c @@ -79,19 +79,18 @@ static int pmt_add_dev(struct pci_dev *pdev, struct intel_dvsec_header *header, case DVSEC_INTEL_ID_WATCHER: if (quirks & PMT_QUIRK_NO_WATCHER) { dev_info(dev, "Watcher not supported\n"); - return 0; + return -EINVAL; } name = "pmt_watcher"; break; case DVSEC_INTEL_ID_CRASHLOG: if (quirks & PMT_QUIRK_NO_CRASHLOG) { dev_info(dev, "Crashlog not supported\n"); - return 0; + return -EINVAL; } name = "pmt_crashlog"; break; default: - dev_err(dev, "Unrecognized PMT capability: %d\n", id); return -EINVAL; } @@ -174,12 +173,8 @@ static int pmt_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) header.offset = INTEL_DVSEC_TABLE_OFFSET(table); ret = pmt_add_dev(pdev, &header, quirks); - if (ret) { - dev_warn(&pdev->dev, - "Failed to add device for DVSEC id %d\n", - header.id); + if (ret) continue; - } found_devices = true; } while (true); -- 2.25.1