Skip to contentSkip to conversation

drivers/char changes for SMBIOS and System Firmware

RFC PATCH In review Prarit Bhargava 1 participant 1 message May 31, 2011

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

RFC PATCH 7/35 drivers/char changes for SMBIOS and System Firmware

drivers/char changes for SMBIOS and System Firmware

---
 drivers/char/i8k.c               |   75 +++++++++---------
 drivers/char/ipmi/ipmi_si_intf.c |  159 +++++++++++++++++++-------------------
 drivers/char/sonypi.c            |   14 ++--
 3 files changed, 124 insertions(+), 124 deletions(-)
drivers/char/i8k.c +39 -36
index 6e40072..f198fac 100644
@@ -24,7 +24,7 @@
 #include <linux/init.h>
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
-#include <linux/dmi.h>
+#include <linux/sysfw.h>
 #include <linux/capability.h>
 #include <linux/mutex.h>
 #include <linux/hwmon.h>
@@ -73,9 +73,10 @@ static int force;
 module_param(force, bool, 0);
 MODULE_PARM_DESC(force, "Force loading without checking for supported models");
 
-static int ignore_dmi;
-module_param(ignore_dmi, bool, 0);
-MODULE_PARM_DESC(ignore_dmi, "Continue probing hardware even if DMI data does not match");
+static int ignore_smbios;
+module_param(ignore_smbios, bool, 0);
+MODULE_PARM_DESC(ignore_smbios,
+		"Continue probing hardware even if SMBIOS data does not match");
 
 static int restricted;
 module_param(restricted, bool, 0);
@@ -110,11 +111,11 @@ struct smm_regs {
 	unsigned int edi __attribute__ ((packed));
 };
 
-static inline const char *i8k_get_dmi_data(int field)
+static inline const char *i8k_get_smbios_data(int field)
 {
-	const char *dmi_data = dmi_get_system_info(field);
+	const char *smbios_data = sysfw_lookup(field);
 
-	return dmi_data && *dmi_data ? dmi_data : "?";
+	return smbios_data && *smbios_data ? smbios_data : "?";
 }
 
 /*
@@ -333,7 +334,8 @@ i8k_ioctl_unlocked(struct file *fp, unsigned int cmd, unsigned long arg)
 
 	case I8K_MACHINE_ID:
 		memset(buff, 0, 16);
-		strlcpy(buff, i8k_get_dmi_data(DMI_PRODUCT_SERIAL), sizeof(buff));
+		strlcpy(buff, i8k_get_smbios_data(SYSFW_PRODUCT_SERIAL),
+			sizeof(buff));
 		break;
 
 	case I8K_FN_STATUS:
@@ -450,7 +452,7 @@ static int i8k_proc_show(struct seq_file *seq, void *offset)
 	return seq_printf(seq, "%s %s %s %d %d %d %d %d %d %d\n",
 			  I8K_PROC_FMT,
 			  bios_version,
-			  i8k_get_dmi_data(DMI_PRODUCT_SERIAL),
+			  i8k_get_smbios_data(SYSFW_PRODUCT_SERIAL),
 			  cpu_temp,
 			  left_fan, right_fan, left_speed, right_speed,
 			  ac_power, fn_key);
@@ -607,64 +609,64 @@ static void __exit i8k_exit_hwmon(void)
 	hwmon_device_unregister(i8k_hwmon_dev);
 }
 
-static struct dmi_system_id __initdata i8k_dmi_table[] = {
+static struct sysfw_id __initdata i8k_smbios_table[] = {
 	{
 		.ident = "Dell Inspiron",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Computer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Inspiron"),
 		},
 	},
 	{
 		.ident = "Dell Latitude",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Latitude"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Computer"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Latitude"),
 		},
 	},
 	{
 		.ident = "Dell Inspiron 2",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Inspiron"),
 		},
 	},
 	{
 		.ident = "Dell Latitude 2",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Latitude"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Latitude"),
 		},
 	},
 	{	/* UK Inspiron 6400  */
 		.ident = "Dell Inspiron 3",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "MM061"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "MM061"),
 		},
 	},
 	{
 		.ident = "Dell Inspiron 3",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "MP061"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "MP061"),
 		},
 	},
 	{
 		.ident = "Dell Precision",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Precision"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Precision"),
 		},
 	},
 	{
 		.ident = "Dell Vostro",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-			DMI_MATCH(DMI_PRODUCT_NAME, "Vostro"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Vostro"),
 		},
 	},
-        { }
+	{}
 };
 
 /*
@@ -676,20 +678,21 @@ static int __init i8k_probe(void)
 	int version;
 
 	/*
-	 * Get DMI information
+	 * Get SMBIOS information
 	 */
-	if (!dmi_check_system(i8k_dmi_table)) {
-		if (!ignore_dmi && !force)
+	if (!sysfw_callback(i8k_smbios_table)) {
+		if (!ignore_smbios && !force)
 			return -ENODEV;
 
 		printk(KERN_INFO "i8k: not running on a supported Dell system.\n");
 		printk(KERN_INFO "i8k: vendor=%s, model=%s, version=%s\n",
-			i8k_get_dmi_data(DMI_SYS_VENDOR),
-			i8k_get_dmi_data(DMI_PRODUCT_NAME),
-			i8k_get_dmi_data(DMI_BIOS_VERSION));
+			i8k_get_smbios_data(SYSFW_SYS_VENDOR),
+			i8k_get_smbios_data(SYSFW_PRODUCT_NAME),
+			i8k_get_smbios_data(SYSFW_BIOS_VERSION));
 	}
 
-	strlcpy(bios_version, i8k_get_dmi_data(DMI_BIOS_VERSION), sizeof(bios_version));
+	strlcpy(bios_version, i8k_get_smbios_data(SYSFW_BIOS_VERSION),
+		sizeof(bios_version));
 
 	/*
 	 * Get SMM Dell signature
@@ -713,9 +716,9 @@ static int __init i8k_probe(void)
 		buff[2] = (version) & 0xff;
 		buff[3] = '\0';
 		/*
-		 * If DMI BIOS version is unknown use SMM BIOS version.
+		 * If SMBIOS version is unknown use SMM BIOS version.
 		 */
-		if (!dmi_get_system_info(DMI_BIOS_VERSION))
+		if (!sysfw_lookup(SYSFW_BIOS_VERSION))
 			strlcpy(bios_version, buff, sizeof(bios_version));
 
 		/*
drivers/char/ipmi/ipmi_si_intf.c +78 -81

199 lines not on this page · raw message

drivers/char/sonypi.c +7 -7
index 1ee8ce7..51b702b 100644
@@ -46,11 +46,11 @@
 #include <linux/delay.h>
 #include <linux/wait.h>
 #include <linux/acpi.h>
-#include <linux/dmi.h>
 #include <linux/err.h>
 #include <linux/kfifo.h>
 #include <linux/platform_device.h>
 #include <linux/gfp.h>
+#include <linux/sysfw.h>
 
 #include <asm/uaccess.h>
 #include <asm/io.h>
@@ -1497,19 +1497,19 @@ static struct platform_driver sonypi_driver = {
 
 static struct platform_device *sonypi_platform_device;
 
-static struct dmi_system_id __initdata sonypi_dmi_table[] = {
+static struct sysfw_id __initdata sonypi_smbios_table[] = {
 	{
 		.ident = "Sony Vaio",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "PCG-"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Sony Corporation"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "PCG-"),
 		},
 	},
 	{
 		.ident = "Sony Vaio",
 		.matches = {
-			DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
-			DMI_MATCH(DMI_PRODUCT_NAME, "VGN-"),
+			SYSFW_MATCH(SYSFW_SYS_VENDOR, "Sony Corporation"),
+			SYSFW_MATCH(SYSFW_PRODUCT_NAME, "VGN-"),
 		},
 	},
 	{ }
@@ -1523,7 +1523,7 @@ static int __init sonypi_init(void)
 		"sonypi: Sony Programmable I/O Controller Driver v%s.\n",
 		SONYPI_DRIVER_VERSION);
 
-	if (!dmi_check_system(sonypi_dmi_table))
+	if (!sysfw_callback(sonypi_smbios_table))
 		return -ENODEV;
 
 	error = platform_driver_register(&sonypi_driver);
Signature · 1 line
1.7.5.1