From: Prarit Bhargava <prarit@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: Prarit Bhargava <prarit@redhat.com>, linux-watchdog@vger.kernel.org
Subject: [PATCH 30/34] drivers/watchdog changes for SMBIOS and System Firmware
Date: Mon, 18 Jul 2011 09:08:44 -0400 [thread overview]
Message-ID: <1310994528-26276-31-git-send-email-prarit@redhat.com> (raw)
In-Reply-To: <1310994528-26276-1-git-send-email-prarit@redhat.com>
As part of the new SMBIOS and System Firmware code:
- Replace old dmi* structures and functions with new sysfw* and smbios*
structures and functions in individual drivers
- cleanup sysfw_id lookup tables
Cc: linux-watchdog@vger.kernel.org
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
---
drivers/watchdog/hpwdt.c | 16 +++++++++-------
drivers/watchdog/ibmasr.c | 9 +++------
drivers/watchdog/sbc_fitpc2_wdt.c | 22 +++++++++++++++-------
3 files changed, 27 insertions(+), 20 deletions(-)
diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c
index 8cb2685..8849eac 100644
--- a/drivers/watchdog/hpwdt.c
+++ b/drivers/watchdog/hpwdt.c
@@ -28,7 +28,7 @@
#include <linux/uaccess.h>
#include <linux/watchdog.h>
#ifdef CONFIG_HPWDT_NMI_DECODING
-#include <linux/dmi.h>
+#include <linux/smbios.h>
#include <linux/spinlock.h>
#include <linux/nmi.h>
#include <linux/kdebug.h>
@@ -374,19 +374,19 @@ asm(".text \n\t"
".previous");
/*
- * dmi_find_cru
+ * smbios_find_cru
*
* Routine Description:
- * This function checks whether or not a SMBIOS/DMI record is
+ * This function checks whether or not a SMBIOS/SMBIOS record is
* the 64bit CRU info or not
*/
-static void __devinit dmi_find_cru(const struct dmi_header *dm, void *dummy)
+static int __devinit smbios_find_cru(const union smbios_struct *ss, void *dummy)
{
struct smbios_cru64_info *smbios_cru64_ptr;
unsigned long cru_physical_address;
- if (dm->type == SMBIOS_CRU64_INFORMATION) {
- smbios_cru64_ptr = (struct smbios_cru64_info *) dm;
+ if (ss->header.type == SMBIOS_CRU64_INFORMATION) {
+ smbios_cru64_ptr = (struct smbios_cru64_info *) &ss;
if (smbios_cru64_ptr->signature == CRU_BIOS_SIGNATURE_VALUE) {
cru_physical_address =
smbios_cru64_ptr->physical_address +
@@ -395,15 +395,17 @@ static void __devinit dmi_find_cru(const struct dmi_header *dm, void *dummy)
smbios_cru64_ptr->double_length);
set_memory_x((unsigned long)cru_rom_addr & PAGE_MASK,
smbios_cru64_ptr->double_length >> PAGE_SHIFT);
+ return SMBIOS_WALK_STOP;
}
}
+ return SMBIOS_WALK_CONTINUE;
}
static int __devinit detect_cru_service(void)
{
cru_rom_addr = NULL;
- dmi_walk(dmi_find_cru, NULL);
+ smbios_walk(smbios_find_cru, NULL);
/* if cru_rom_addr has been set then we found a CRU service */
return ((cru_rom_addr != NULL) ? 0 : -ENODEV);
diff --git a/drivers/watchdog/ibmasr.c b/drivers/watchdog/ibmasr.c
index 195e0f7..b8cc126 100644
--- a/drivers/watchdog/ibmasr.c
+++ b/drivers/watchdog/ibmasr.c
@@ -17,7 +17,7 @@
#include <linux/timer.h>
#include <linux/miscdevice.h>
#include <linux/watchdog.h>
-#include <linux/dmi.h>
+#include <linux/smbios.h>
#include <linux/io.h>
#include <linux/uaccess.h>
@@ -376,12 +376,9 @@ static int __init ibmasr_init(void)
struct ibmasr_id *id;
int rc;
- for (id = ibmasr_id_table; id->desc; id++) {
- if (dmi_find_device(DMI_DEV_TYPE_OTHER, id->desc, NULL)) {
+ for (id = ibmasr_id_table; id->desc; id++)
+ if (smbios_is_onboard_device(id->desc, 0))
asr_type = id->type;
- break;
- }
- }
if (!asr_type)
return -ENODEV;
diff --git a/drivers/watchdog/sbc_fitpc2_wdt.c b/drivers/watchdog/sbc_fitpc2_wdt.c
index d5d3994..0419e01 100644
--- a/drivers/watchdog/sbc_fitpc2_wdt.c
+++ b/drivers/watchdog/sbc_fitpc2_wdt.c
@@ -21,7 +21,7 @@
#include <linux/fs.h>
#include <linux/init.h>
#include <linux/moduleparam.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
#include <linux/io.h>
#include <linux/uaccess.h>
@@ -198,17 +198,25 @@ static struct miscdevice fitpc2_wdt_miscdev = {
.fops = &fitpc2_wdt_fops,
};
+static struct sysfw_id __initdata fitpc2_device_table[] = {
+ {
+ .ident = "SBC-FITPC2 Watchdog",
+ .matches = {
+ SYSFW_MATCH(SYSFW_BOARD_NAME, "SBC-FITPC2"),
+ },
+ },
+ {}
+};
+
static int __init fitpc2_wdt_init(void)
{
int err;
- const char *brd_name;
+ const struct sysfw_id *id;
- brd_name = dmi_get_system_info(DMI_BOARD_NAME);
-
- if (!brd_name || !strstr(brd_name, "SBC-FITPC2"))
+ id = sysfw_callback(fitpc2_device_table);
+ if (!id)
return -ENODEV;
-
- pr_info("%s found\n", brd_name);
+ pr_info("%s found\n", id->ident);
if (!request_region(COMMAND_PORT, 1, WATCHDOG_NAME)) {
pr_err("I/O address 0x%04x already in use\n", COMMAND_PORT);
--
1.6.5.2
next prev parent reply other threads:[~2011-07-18 13:13 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-18 13:08 [PATCH 00/34] System Firmware and SMBIOS Support [v3] Prarit Bhargava
2011-07-18 13:08 ` [PATCH 01/34] System Firmware Interface Prarit Bhargava
2011-07-19 0:43 ` Andi Kleen
2011-07-19 9:05 ` Alan Cox
2011-07-19 12:23 ` Prarit Bhargava
2011-07-19 13:25 ` Andi Kleen
2011-07-19 13:52 ` Prarit Bhargava
2011-07-19 13:21 ` Andi Kleen
2011-07-19 13:39 ` Prarit Bhargava
2011-07-19 13:46 ` Andi Kleen
2011-07-19 13:58 ` Prarit Bhargava
2011-07-25 19:03 ` [lm-sensors] " Jean Delvare
2011-08-10 13:26 ` Prarit Bhargava
2011-07-18 13:08 ` [PATCH 02/34] New SMBIOS driver for x86 and ia64 Prarit Bhargava
2011-07-18 13:08 ` [PATCH 03/34] arch specific changes for SMBIOS and System Firmware Prarit Bhargava
2011-07-18 13:08 ` [PATCH 04/34] drivers/acpi changes for SMBIOS and System Firmware interface Prarit Bhargava
2011-07-18 13:08 ` [PATCH 05/34] drivers/ata changes for SMBIOS and System Firmware Prarit Bhargava
2011-07-18 13:08 ` [PATCH 06/34] drivers/floppy " Prarit Bhargava
2011-07-18 13:08 ` [PATCH 07/34] drivers/char " Prarit Bhargava
2011-07-18 13:08 ` [PATCH 08/34] drivers/crypto " Prarit Bhargava
2011-07-18 13:08 ` [PATCH 09/34] drivers/gpio " Prarit Bhargava
2011-07-18 13:08 ` [PATCH 10/34] drivers/gpu " Prarit Bhargava
2011-07-18 13:08 ` [PATCH 11/34] drivers/hwmon " Prarit Bhargava
2011-07-18 13:08 ` [PATCH 12/34] drivers/i2c " Prarit Bhargava
2011-07-18 13:08 ` [PATCH 13/34] drivers/ide " Prarit Bhargava
2011-07-18 13:08 ` [PATCH 14/34] drivers/input " Prarit Bhargava
2011-07-18 13:08 ` [PATCH 15/34] drivers/leds " Prarit Bhargava
2011-07-18 13:08 ` [PATCH 16/34] drivers/media " Prarit Bhargava
2011-07-18 13:08 ` [PATCH 17/34] drivers/misc " Prarit Bhargava
2011-07-18 13:08 ` [PATCH 18/34] drivers/mtd " Prarit Bhargava
2011-07-18 13:08 ` [PATCH 19/34] drivers/net " Prarit Bhargava
2011-07-18 13:08 ` [PATCH 20/34] drivers/pci " Prarit Bhargava
2011-07-18 13:08 ` [PATCH 21/34] drivers/platform " Prarit Bhargava
2011-08-11 4:30 ` Jonathan Woithe
2011-07-18 13:08 ` [PATCH 22/34] drivers/pnp " Prarit Bhargava
2011-07-18 13:08 ` [PATCH 23/34] drivers/power " Prarit Bhargava
2011-07-18 13:08 ` [PATCH 24/34] drivers/rtc " Prarit Bhargava
2011-07-18 13:08 ` [PATCH 25/34] drivers/staging " Prarit Bhargava
2011-07-18 13:08 ` [PATCH 26/34] drivers/tty " Prarit Bhargava
2011-07-18 13:08 ` [PATCH 27/34] drivers/usb " Prarit Bhargava
2011-07-19 19:47 ` Alan Stern
2011-07-18 13:08 ` [PATCH 28/34] drivers/video " Prarit Bhargava
2011-07-18 13:08 ` [PATCH 29/34] drivers/w1 " Prarit Bhargava
2011-07-18 13:08 ` Prarit Bhargava [this message]
2011-07-18 13:08 ` [PATCH 31/34] include/linux/acpi.h " Prarit Bhargava
2011-07-18 13:08 ` [PATCH 32/34] Kernel panic " Prarit Bhargava
2011-07-18 13:08 ` [PATCH 33/34] sound/pci/hda " Prarit Bhargava
2011-07-18 13:08 ` [PATCH 34/34] Remove old DMI & SMBIOS code and make SMBIOS default on Prarit Bhargava
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=1310994528-26276-31-git-send-email-prarit@redhat.com \
--to=prarit@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-watchdog@vger.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
Powered by JetHome