From: Andrey Panin This patch ports sonypi driver to new DMI probing API and removes is_sony_vaio_laptop global variable. Signed-off-by: Andrey Panin Signed-off-by: Andrew Morton --- 25-akpm/arch/i386/kernel/dmi_scan.c | 24 ------------------------ 25-akpm/arch/i386/kernel/i386_ksyms.c | 3 --- 25-akpm/drivers/char/sonypi.c | 18 +++++++++++++++--- 25-akpm/include/asm-i386/system.h | 1 - 4 files changed, 15 insertions(+), 31 deletions(-) diff -puN arch/i386/kernel/dmi_scan.c~267-mm1-port-sonypi-driver-to-new-dmi-probing arch/i386/kernel/dmi_scan.c --- 25/arch/i386/kernel/dmi_scan.c~267-mm1-port-sonypi-driver-to-new-dmi-probing Wed Jun 23 14:17:10 2004 +++ 25-akpm/arch/i386/kernel/dmi_scan.c Wed Jun 23 14:17:10 2004 @@ -19,7 +19,6 @@ EXPORT_SYMBOL(dmi_broken); unsigned int i8042_dmi_noloop = 0; EXPORT_SYMBOL(i8042_dmi_noloop); -int is_sony_vaio_laptop; int is_unsafe_smbus; int es7000_plat = 0; @@ -340,24 +339,6 @@ static __init int broken_apm_power(struc } /* - * Check for a Sony Vaio system - * - * On a Sony system we want to enable the use of the sonypi - * driver for Sony-specific goodies like the camera and jogdial. - * We also want to avoid using certain functions of the PnP BIOS. - */ - -static __init int sony_vaio_laptop(struct dmi_blacklist *d) -{ - if (is_sony_vaio_laptop == 0) - { - is_sony_vaio_laptop = 1; - printk(KERN_INFO "%s laptop detected.\n", d->ident); - } - return 0; -} - -/* * Several HP Proliant (and maybe other OSB4/ProFusion) systems * shouldn't use the AUX LoopBack command, or they crash or reboot. */ @@ -653,11 +634,6 @@ static __initdata struct dmi_blacklist d MATCH(DMI_BIOS_VERSION, "0AASNP05"), NO_MATCH, NO_MATCH, } }, - { sony_vaio_laptop, "Sony Vaio", { /* This is a Sony Vaio laptop */ - MATCH(DMI_SYS_VENDOR, "Sony Corporation"), - MATCH(DMI_PRODUCT_NAME, "PCG-"), - NO_MATCH, NO_MATCH, - } }, { swab_apm_power_in_minutes, "Sony VAIO", { /* Handle problems with APM on Sony Vaio PCG-N505X(DE) */ MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"), MATCH(DMI_BIOS_VERSION, "R0206H"), diff -puN arch/i386/kernel/i386_ksyms.c~267-mm1-port-sonypi-driver-to-new-dmi-probing arch/i386/kernel/i386_ksyms.c --- 25/arch/i386/kernel/i386_ksyms.c~267-mm1-port-sonypi-driver-to-new-dmi-probing Wed Jun 23 14:17:10 2004 +++ 25-akpm/arch/i386/kernel/i386_ksyms.c Wed Jun 23 14:17:10 2004 @@ -187,9 +187,6 @@ EXPORT_SYMBOL_NOVERS(memcmp); EXPORT_SYMBOL(atomic_dec_and_lock); #endif -extern int is_sony_vaio_laptop; -EXPORT_SYMBOL(is_sony_vaio_laptop); - EXPORT_SYMBOL(__PAGE_KERNEL); #ifdef CONFIG_HIGHMEM diff -puN drivers/char/sonypi.c~267-mm1-port-sonypi-driver-to-new-dmi-probing drivers/char/sonypi.c --- 25/drivers/char/sonypi.c~267-mm1-port-sonypi-driver-to-new-dmi-probing Wed Jun 23 14:17:10 2004 +++ 25-akpm/drivers/char/sonypi.c Wed Jun 23 14:17:10 2004 @@ -43,6 +43,7 @@ #include #include #include +#include #include #include @@ -820,10 +821,21 @@ static void __devexit sonypi_remove(void printk(KERN_INFO "sonypi: removed.\n"); } -static int __init sonypi_init_module(void) { - struct pci_dev *pcidev = NULL; +static struct dmi_system_id __initdata sonypi_dmi_table[] = { + { + .ident = "Sony Vaio", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), + DMI_MATCH(DMI_PRODUCT_NAME, "PCG-"), + }, + }, + { } +}; - if (is_sony_vaio_laptop) { +static int __init sonypi_init_module(void) +{ + struct pci_dev *pcidev = NULL; + if (dmi_check_system(sonypi_dmi_table)) { pcidev = pci_find_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_3, NULL); diff -puN include/asm-i386/system.h~267-mm1-port-sonypi-driver-to-new-dmi-probing include/asm-i386/system.h --- 25/include/asm-i386/system.h~267-mm1-port-sonypi-driver-to-new-dmi-probing Wed Jun 23 14:17:10 2004 +++ 25-akpm/include/asm-i386/system.h Wed Jun 23 14:17:10 2004 @@ -466,7 +466,6 @@ void disable_hlt(void); void enable_hlt(void); extern unsigned long dmi_broken; -extern int is_sony_vaio_laptop; extern int es7000_plat; #define BROKEN_ACPI_Sx 0x0001 _