linux-watchdog.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	platform-driver-x86@vger.kernel.org,
	Mark Gross <mgross@linux.intel.com>,
	linux-watchdog@vger.kernel.org,
	Wim Van Sebroeck <wim@linux-watchdog.org>,
	Guenter Roeck <linux@roeck-us.net>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [PATCH v1 5/5] platform/x86: intel_scu_wdt: Get rid of custom x86 model comparison
Date: Fri, 22 Jan 2021 14:32:01 +0200	[thread overview]
Message-ID: <20210122123201.40935-5-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20210122123201.40935-1-andriy.shevchenko@linux.intel.com>

Switch the platform code to use x86_id_table and accompanying API
instead of custom comparison against x86 CPU model.

This is one of the last users of custom API for that and following
changes will remove it for the good.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/platform/x86/intel_scu_wdt.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/x86/intel_scu_wdt.c b/drivers/platform/x86/intel_scu_wdt.c
index 19f7686a3c19..85ee85ca2215 100644
--- a/drivers/platform/x86/intel_scu_wdt.c
+++ b/drivers/platform/x86/intel_scu_wdt.c
@@ -11,6 +11,8 @@
 #include <linux/platform_device.h>
 #include <linux/platform_data/intel-mid_wdt.h>
 
+#include <asm/cpu_device_id.h>
+#include <asm/intel-family.h>
 #include <asm/intel-mid.h>
 #include <asm/io_apic.h>
 #include <asm/hw_irq.h>
@@ -48,12 +50,20 @@ static struct intel_mid_wdt_pdata tangier_pdata = {
 	.probe = tangier_probe,
 };
 
+static const struct x86_cpu_id intel_mid_cpu_ids[] = {
+	X86_MATCH_INTEL_FAM6_MODEL(ATOM_SILVERMONT_MID, &tangier_pdata),
+	{}
+};
+
 static int __init register_mid_wdt(void)
 {
-	if (intel_mid_identify_cpu() != INTEL_MID_CPU_CHIP_TANGIER)
+	const struct x86_cpu_id *id;
+
+	id = x86_match_cpu(intel_mid_cpu_ids);
+	if (!id)
 		return -ENODEV;
 
-	wdt_dev.dev.platform_data = &tangier_pdata;
+	wdt_dev.dev.platform_data = (const struct intel_mid_wdt_pdata *)id->driver_data;
 	return platform_device_register(&wdt_dev);
 }
 arch_initcall(register_mid_wdt);
-- 
2.29.2


  parent reply	other threads:[~2021-01-22 12:36 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-22 12:31 [PATCH v1 1/5] watchdog: intel_scu_watchdog: Remove driver for deprecated platform Andy Shevchenko
2021-01-22 12:31 ` [PATCH v1 2/5] watchdog: intel-mid_wdt: Postpone IRQ handler registration till SCU is ready Andy Shevchenko
2021-01-22 14:17   ` Guenter Roeck
2021-01-22 12:31 ` [PATCH v1 3/5] platform/x86: intel_scu_wdt: Move driver from arch/x86 Andy Shevchenko
2021-01-22 14:21   ` Guenter Roeck
2021-01-22 12:32 ` [PATCH v1 4/5] platform/x86: intel_scu_wdt: Drop SCU notification Andy Shevchenko
2021-01-22 14:21   ` Guenter Roeck
2021-01-22 12:32 ` Andy Shevchenko [this message]
2021-01-22 14:23   ` [PATCH v1 5/5] platform/x86: intel_scu_wdt: Get rid of custom x86 model comparison Guenter Roeck
2021-01-22 14:16 ` [PATCH v1 1/5] watchdog: intel_scu_watchdog: Remove driver for deprecated platform Guenter Roeck
2021-01-22 14:59 ` Hans de Goede
2021-01-22 15:22   ` Andy Shevchenko
2021-01-22 15:45     ` Andy Shevchenko
2021-01-22 21:04       ` Hans de Goede
2021-01-23  0:27         ` Guenter Roeck
2021-01-23 12:05           ` Hans de Goede
2021-01-25 11:15             ` Andy Shevchenko
2021-01-25 11:23               ` Hans de Goede
2021-01-25 13:52                 ` Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210122123201.40935-5-andriy.shevchenko@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=mgross@linux.intel.com \
    --cc=mingo@redhat.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=wim@linux-watchdog.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).