linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] MFD: intel_pmt: Fix nuisance messages and handling of disabled capabilities
@ 2021-01-28 17:28 David E. Box
  2021-02-02 14:22 ` Hans de Goede
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: David E. Box @ 2021-01-28 17:28 UTC (permalink / raw)
  To: lee.jones, hdegoede; +Cc: David E. Box, linux-kernel

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 <david.e.box@linux.intel.com>
---
 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


^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2021-03-18 11:03 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-28 17:28 [PATCH] MFD: intel_pmt: Fix nuisance messages and handling of disabled capabilities David E. Box
2021-02-02 14:22 ` Hans de Goede
2021-02-24 20:10 ` [PATCH V2 1/2] " David E. Box
2021-02-24 20:22   ` Hans de Goede
2021-02-24 23:01     ` David E. Box
2021-03-09 18:12   ` [GIT PULL] Immutable branch between MFD and Platform/X86 due for the v5.13 merge window Lee Jones
2021-03-09 18:59     ` Hans de Goede
2021-03-09 19:17       ` Lee Jones
2021-03-09 20:06         ` Lee Jones
2021-03-10 10:57     ` [GIT PULL v2] " Lee Jones
2021-03-18 11:02       ` Hans de Goede
2021-02-24 20:10 ` [PATCH 2/2 V2] MFD: intel_pmt: Add support for DG1 David E. Box
2021-03-09 16:45   ` Lee Jones
2021-03-09 17:27     ` David E. Box
2021-03-09 18:13       ` Lee Jones
2021-03-09 19:52         ` [PATCH V3 1/2] MFD: intel_pmt: Fix nuisance messages and handling of disabled capabilities David E. Box
2021-03-09 19:52         ` [PATCH V3 2/2] MFD: intel_pmt: Add support for DG1 David E. Box

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).