aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/acpi/asus_acpi.c2
-rw-r--r--drivers/acpi/numa.c2
-rw-r--r--drivers/acpi/osl.c118
-rw-r--r--drivers/acpi/tables/tbinstal.c8
-rw-r--r--drivers/acpi/thermal.c13
-rw-r--r--drivers/acpi/toshiba_acpi.c2
-rw-r--r--drivers/acpi/utilities/utcopy.c120
-rw-r--r--drivers/acpi/utilities/uteval.c28
-rw-r--r--drivers/acpi/utilities/utobject.c42
-rw-r--r--drivers/acpi/utilities/utxface.c4
-rw-r--r--drivers/ata/Kconfig1
-rw-r--r--drivers/ata/libata-core.c1
-rw-r--r--drivers/atm/firestream.c15
-rw-r--r--drivers/auxdisplay/Kconfig4
-rw-r--r--drivers/auxdisplay/cfag12864bfb.c8
-rw-r--r--drivers/char/drm/drm_drawable.c41
-rw-r--r--drivers/char/drm/drm_pciids.h7
-rw-r--r--drivers/char/drm/i915_irq.c2
-rw-r--r--drivers/char/n_tty.c1
-rw-r--r--drivers/char/tty_io.c3
-rw-r--r--drivers/char/watchdog/Kconfig7
-rw-r--r--drivers/char/watchdog/Makefile1
-rw-r--r--drivers/char/watchdog/ixp2000_wdt.c2
-rw-r--r--drivers/char/watchdog/ks8695_wdt.c308
-rw-r--r--drivers/firewire/fw-card.c5
-rw-r--r--drivers/firewire/fw-cdev.c17
-rw-r--r--drivers/firewire/fw-device.h1
-rw-r--r--drivers/firewire/fw-ohci.c187
-rw-r--r--drivers/firewire/fw-sbp2.c53
-rw-r--r--drivers/i2c/busses/i2c-pxa.c23
-rw-r--r--drivers/ieee1394/nodemgr.c7
-rw-r--r--drivers/ieee1394/nodemgr.h1
-rw-r--r--drivers/ieee1394/sbp2.c31
-rw-r--r--drivers/input/evdev.c2
-rw-r--r--drivers/input/joydev.c2
-rw-r--r--drivers/input/joystick/db9.c2
-rw-r--r--drivers/input/mouse/Kconfig2
-rw-r--r--drivers/input/mousedev.c2
-rw-r--r--drivers/input/serio/sa1111ps2.c4
-rw-r--r--drivers/input/tsdev.c2
-rw-r--r--drivers/isdn/Kconfig9
-rw-r--r--drivers/isdn/hardware/eicon/diva_didd.c2
-rw-r--r--drivers/isdn/hardware/eicon/divasfunc.c2
-rw-r--r--drivers/isdn/i4l/isdn_tty.c3
-rw-r--r--drivers/kvm/vmx.c2
-rw-r--r--drivers/macintosh/Kconfig2
-rw-r--r--drivers/mfd/ucb1x00-ts.c7
-rw-r--r--drivers/misc/thinkpad_acpi.c17
-rw-r--r--drivers/misc/thinkpad_acpi.h6
-rw-r--r--drivers/misc/tifm_7xx1.c2
-rw-r--r--drivers/mtd/devices/pmc551.c2
-rw-r--r--drivers/mtd/nand/autcpu12.c2
-rw-r--r--drivers/mtd/nand/ppchameleonevb.c6
-rw-r--r--drivers/net/8139cp.c17
-rw-r--r--drivers/net/Kconfig1
-rw-r--r--drivers/net/acenic.c21
-rw-r--r--drivers/net/acenic.h1
-rw-r--r--drivers/net/amd8111e.c13
-rw-r--r--drivers/net/amd8111e.h2
-rw-r--r--drivers/net/atl1/atl1_main.c33
-rw-r--r--drivers/net/bnx2.c14
-rw-r--r--drivers/net/cassini.c2
-rw-r--r--drivers/net/chelsio/cxgb2.c10
-rw-r--r--drivers/net/cxgb3/cxgb3_main.c6
-rw-r--r--drivers/net/defxx.c1
-rw-r--r--drivers/net/e1000/e1000_main.c20
-rw-r--r--drivers/net/ehea/ehea.h2
-rw-r--r--drivers/net/ehea/ehea_main.c2
-rw-r--r--drivers/net/fec_8xx/fec_main.c2
-rw-r--r--drivers/net/forcedeth.c8
-rw-r--r--drivers/net/gianfar.c16
-rw-r--r--drivers/net/hp100.c2
-rw-r--r--drivers/net/myri10ge/myri10ge.c1
-rw-r--r--drivers/net/netxen/netxen_nic_main.c2
-rw-r--r--drivers/net/ns83820.c12
-rwxr-xr-xdrivers/net/qla3xxx.c2
-rw-r--r--drivers/net/r8169.c11
-rw-r--r--drivers/net/s2io.c12
-rw-r--r--drivers/net/skfp/smt.c2
-rw-r--r--drivers/net/sky2.c37
-rw-r--r--drivers/net/sky2.h24
-rw-r--r--drivers/net/smc91x.h5
-rw-r--r--drivers/net/spider_net.c40
-rw-r--r--drivers/net/tg3.c21
-rw-r--r--drivers/net/typhoon.c11
-rw-r--r--drivers/net/wireless/hostap/hostap_80211_tx.c13
-rw-r--r--drivers/net/wireless/prism54/islpci_eth.c5
-rw-r--r--drivers/pci/msi.c12
-rw-r--r--drivers/pci/quirks.c20
-rw-r--r--drivers/pci/search.c3
-rw-r--r--drivers/pcmcia/at91_cf.c13
-rw-r--r--drivers/rtc/rtc-cmos.c13
-rw-r--r--drivers/s390/block/dasd_eer.c16
-rw-r--r--drivers/s390/char/raw3270.c10
-rw-r--r--drivers/s390/cio/device.c49
-rw-r--r--drivers/s390/cio/device_fsm.c6
-rw-r--r--drivers/sbus/char/flash.c1
-rw-r--r--drivers/scsi/NCR5380.c2
-rw-r--r--drivers/scsi/aic7xxx/aic79xx_core.c2
-rw-r--r--drivers/serial/amba-pl010.c3
-rw-r--r--drivers/serial/amba-pl011.c3
-rw-r--r--drivers/serial/serial_ks8695.c2
-rw-r--r--drivers/spi/atmel_spi.c8
-rw-r--r--drivers/spi/spi.c2
-rw-r--r--drivers/spi/spi_imx.c3
-rw-r--r--drivers/video/Kconfig6
-rw-r--r--drivers/video/arkfb.c3
-rw-r--r--drivers/video/console/fbcon.h1
-rw-r--r--drivers/video/neofb.c30
-rw-r--r--drivers/video/pm3fb.c2
-rw-r--r--drivers/video/skeletonfb.c31
-rw-r--r--drivers/video/vt8623fb.c3
112 files changed, 1110 insertions, 648 deletions
diff --git a/drivers/acpi/asus_acpi.c b/drivers/acpi/asus_acpi.c
index b770deab968c..6d7d4157e049 100644
--- a/drivers/acpi/asus_acpi.c
+++ b/drivers/acpi/asus_acpi.c
@@ -1357,7 +1357,7 @@ static struct backlight_ops asus_backlight_data = {
1357 .update_status = set_brightness_status, 1357 .update_status = set_brightness_status,
1358}; 1358};
1359 1359
1360static void __exit asus_acpi_exit(void) 1360static void asus_acpi_exit(void)
1361{ 1361{
1362 if (asus_backlight_device) 1362 if (asus_backlight_device)
1363 backlight_device_unregister(asus_backlight_device); 1363 backlight_device_unregister(asus_backlight_device);
diff --git a/drivers/acpi/numa.c b/drivers/acpi/numa.c
index a2efae8a4c4e..0c9f15c54e8c 100644
--- a/drivers/acpi/numa.c
+++ b/drivers/acpi/numa.c
@@ -59,7 +59,7 @@ int node_to_pxm(int node)
59 return node_to_pxm_map[node]; 59 return node_to_pxm_map[node];
60} 60}
61 61
62int __cpuinit acpi_map_pxm_to_node(int pxm) 62int acpi_map_pxm_to_node(int pxm)
63{ 63{
64 int node = pxm_to_node_map[pxm]; 64 int node = pxm_to_node_map[pxm];
65 65
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index b998340e23d4..58ceb18ec997 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -33,6 +33,7 @@
33#include <linux/interrupt.h> 33#include <linux/interrupt.h>
34#include <linux/kmod.h> 34#include <linux/kmod.h>
35#include <linux/delay.h> 35#include <linux/delay.h>
36#include <linux/dmi.h>
36#include <linux/workqueue.h> 37#include <linux/workqueue.h>
37#include <linux/nmi.h> 38#include <linux/nmi.h>
38#include <linux/acpi.h> 39#include <linux/acpi.h>
@@ -73,6 +74,21 @@ static void *acpi_irq_context;
73static struct workqueue_struct *kacpid_wq; 74static struct workqueue_struct *kacpid_wq;
74static struct workqueue_struct *kacpi_notify_wq; 75static struct workqueue_struct *kacpi_notify_wq;
75 76
77#define OSI_STRING_LENGTH_MAX 64 /* arbitrary */
78static char osi_additional_string[OSI_STRING_LENGTH_MAX];
79
80#define OSI_LINUX_ENABLED
81#ifdef OSI_LINUX_ENABLED
82int osi_linux = 1; /* enable _OSI(Linux) by default */
83#else
84int osi_linux; /* disable _OSI(Linux) by default */
85#endif
86
87
88#ifdef CONFIG_DMI
89static struct __initdata dmi_system_id acpi_osl_dmi_table[];
90#endif
91
76static void __init acpi_request_region (struct acpi_generic_address *addr, 92static void __init acpi_request_region (struct acpi_generic_address *addr,
77 unsigned int length, char *desc) 93 unsigned int length, char *desc)
78{ 94{
@@ -121,8 +137,9 @@ static int __init acpi_reserve_resources(void)
121} 137}
122device_initcall(acpi_reserve_resources); 138device_initcall(acpi_reserve_resources);
123 139
124acpi_status acpi_os_initialize(void) 140acpi_status __init acpi_os_initialize(void)
125{ 141{
142 dmi_check_system(acpi_osl_dmi_table);
126 return AE_OK; 143 return AE_OK;
127} 144}
128 145
@@ -960,20 +977,38 @@ static int __init acpi_os_name_setup(char *str)
960 977
961__setup("acpi_os_name=", acpi_os_name_setup); 978__setup("acpi_os_name=", acpi_os_name_setup);
962 979
980static void enable_osi_linux(int enable) {
981
982 if (osi_linux != enable)
983 printk(KERN_INFO PREFIX "%sabled _OSI(Linux)\n",
984 enable ? "En": "Dis");
985
986 osi_linux = enable;
987 return;
988}
989
963/* 990/*
964 * _OSI control 991 * Modify the list of "OS Interfaces" reported to BIOS via _OSI
992 *
965 * empty string disables _OSI 993 * empty string disables _OSI
966 * TBD additional string adds to _OSI 994 * string starting with '!' disables that string
995 * otherwise string is added to list, augmenting built-in strings
967 */ 996 */
968static int __init acpi_osi_setup(char *str) 997static int __init acpi_osi_setup(char *str)
969{ 998{
970 if (str == NULL || *str == '\0') { 999 if (str == NULL || *str == '\0') {
971 printk(KERN_INFO PREFIX "_OSI method disabled\n"); 1000 printk(KERN_INFO PREFIX "_OSI method disabled\n");
972 acpi_gbl_create_osi_method = FALSE; 1001 acpi_gbl_create_osi_method = FALSE;
973 } else { 1002 } else if (*str == '!') {
974 /* TBD */ 1003 if (acpi_osi_invalidate(++str) == AE_OK)
975 printk(KERN_ERR PREFIX "_OSI additional string ignored -- %s\n", 1004 printk(KERN_INFO PREFIX "Deleted _OSI(%s)\n", str);
976 str); 1005 } else if (!strcmp("!Linux", str)) {
1006 enable_osi_linux(0);
1007 } else if (!strcmp("Linux", str)) {
1008 enable_osi_linux(1);
1009 } else if (*osi_additional_string == '\0') {
1010 strncpy(osi_additional_string, str, OSI_STRING_LENGTH_MAX);
1011 printk(KERN_INFO PREFIX "Added _OSI(%s)\n", str);
977 } 1012 }
978 1013
979 return 1; 1014 return 1;
@@ -1143,11 +1178,28 @@ acpi_status acpi_os_release_object(acpi_cache_t * cache, void *object)
1143acpi_status 1178acpi_status
1144acpi_os_validate_interface (char *interface) 1179acpi_os_validate_interface (char *interface)
1145{ 1180{
1146 1181 if (!strncmp(osi_additional_string, interface, OSI_STRING_LENGTH_MAX))
1147 return AE_SUPPORT; 1182 return AE_OK;
1183 if (!strcmp("Linux", interface)) {
1184 printk(KERN_WARNING PREFIX
1185 "System BIOS is requesting _OSI(Linux)\n");
1186#ifdef OSI_LINUX_ENABLED
1187 printk(KERN_WARNING PREFIX
1188 "Please test with \"acpi_osi=!Linux\"\n"
1189 "Please send dmidecode "
1190 "to linux-acpi@vger.kernel.org\n");
1191#else
1192 printk(KERN_WARNING PREFIX
1193 "If \"acpi_osi=Linux\" works better,\n"
1194 "Please send dmidecode "
1195 "to linux-acpi@vger.kernel.org\n");
1196#endif
1197 if(osi_linux)
1198 return AE_OK;
1199 }
1200 return AE_SUPPORT;
1148} 1201}
1149 1202
1150
1151/****************************************************************************** 1203/******************************************************************************
1152 * 1204 *
1153 * FUNCTION: acpi_os_validate_address 1205 * FUNCTION: acpi_os_validate_address
@@ -1174,5 +1226,51 @@ acpi_os_validate_address (
1174 return AE_OK; 1226 return AE_OK;
1175} 1227}
1176 1228
1229#ifdef CONFIG_DMI
1230#ifdef OSI_LINUX_ENABLED
1231static int dmi_osi_not_linux(struct dmi_system_id *d)
1232{
1233 printk(KERN_NOTICE "%s detected: requires not _OSI(Linux)\n", d->ident);
1234 enable_osi_linux(0);
1235 return 0;
1236}
1237#else
1238static int dmi_osi_linux(struct dmi_system_id *d)
1239{
1240 printk(KERN_NOTICE "%s detected: requires _OSI(Linux)\n", d->ident);
1241 enable_osi_linux(1);
1242 return 0;
1243}
1244#endif
1245
1246static struct dmi_system_id acpi_osl_dmi_table[] __initdata = {
1247#ifdef OSI_LINUX_ENABLED
1248 /*
1249 * Boxes that need NOT _OSI(Linux)
1250 */
1251 {
1252 .callback = dmi_osi_not_linux,
1253 .ident = "Toshiba Satellite P100",
1254 .matches = {
1255 DMI_MATCH(DMI_BOARD_VENDOR, "TOSHIBA"),
1256 DMI_MATCH(DMI_BOARD_NAME, "Satellite P100"),
1257 },
1258 },
1259#else
1260 /*
1261 * Boxes that need _OSI(Linux)
1262 */
1263 {
1264 .callback = dmi_osi_linux,
1265 .ident = "Intel Napa CRB",
1266 .matches = {
1267 DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"),
1268 DMI_MATCH(DMI_BOARD_NAME, "MPAD-MSAE Customer Reference Boards"),
1269 },
1270 },
1271#endif
1272 {}
1273};
1274#endif /* CONFIG_DMI */
1177 1275
1178#endif 1276#endif
diff --git a/drivers/acpi/tables/tbinstal.c b/drivers/acpi/tables/tbinstal.c
index 0e7b121a99ce..3bc0c67a9283 100644
--- a/drivers/acpi/tables/tbinstal.c
+++ b/drivers/acpi/tables/tbinstal.c
@@ -123,14 +123,14 @@ acpi_tb_add_table(struct acpi_table_desc *table_desc,
123 } 123 }
124 } 124 }
125 125
126 /* The table must be either an SSDT or a PSDT */ 126 /* The table must be either an SSDT or a PSDT or an OEMx */
127 127
128 if ((!ACPI_COMPARE_NAME(table_desc->pointer->signature, ACPI_SIG_PSDT)) 128 if ((!ACPI_COMPARE_NAME(table_desc->pointer->signature, ACPI_SIG_PSDT))
129 && 129 &&
130 (!ACPI_COMPARE_NAME(table_desc->pointer->signature, ACPI_SIG_SSDT))) 130 (!ACPI_COMPARE_NAME(table_desc->pointer->signature, ACPI_SIG_SSDT))
131 { 131 && (strncmp(table_desc->pointer->signature, "OEM", 3))) {
132 ACPI_ERROR((AE_INFO, 132 ACPI_ERROR((AE_INFO,
133 "Table has invalid signature [%4.4s], must be SSDT or PSDT", 133 "Table has invalid signature [%4.4s], must be SSDT, PSDT or OEMx",
134 table_desc->pointer->signature)); 134 table_desc->pointer->signature));
135 return_ACPI_STATUS(AE_BAD_SIGNATURE); 135 return_ACPI_STATUS(AE_BAD_SIGNATURE);
136 } 136 }
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index 1ada017d01ef..194ecfe8b360 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -827,6 +827,7 @@ static int acpi_thermal_temp_open_fs(struct inode *inode, struct file *file)
827static int acpi_thermal_trip_seq_show(struct seq_file *seq, void *offset) 827static int acpi_thermal_trip_seq_show(struct seq_file *seq, void *offset)
828{ 828{
829 struct acpi_thermal *tz = seq->private; 829 struct acpi_thermal *tz = seq->private;
830 struct acpi_device *device;
830 int i = 0; 831 int i = 0;
831 int j = 0; 832 int j = 0;
832 833
@@ -849,9 +850,8 @@ static int acpi_thermal_trip_seq_show(struct seq_file *seq, void *offset)
849 tz->trips.passive.tc1, tz->trips.passive.tc2, 850 tz->trips.passive.tc1, tz->trips.passive.tc2,
850 tz->trips.passive.tsp); 851 tz->trips.passive.tsp);
851 for (j = 0; j < tz->trips.passive.devices.count; j++) { 852 for (j = 0; j < tz->trips.passive.devices.count; j++) {
852 853 acpi_bus_get_device(tz->trips.passive.devices.handles[j], &device);
853 seq_printf(seq, "0x%p ", 854 seq_printf(seq, "%4.4s ", acpi_device_bid(device));
854 tz->trips.passive.devices.handles[j]);
855 } 855 }
856 seq_puts(seq, "\n"); 856 seq_puts(seq, "\n");
857 } 857 }
@@ -862,9 +862,10 @@ static int acpi_thermal_trip_seq_show(struct seq_file *seq, void *offset)
862 seq_printf(seq, "active[%d]: %ld C: devices=", 862 seq_printf(seq, "active[%d]: %ld C: devices=",
863 i, 863 i,
864 KELVIN_TO_CELSIUS(tz->trips.active[i].temperature)); 864 KELVIN_TO_CELSIUS(tz->trips.active[i].temperature));
865 for (j = 0; j < tz->trips.active[i].devices.count; j++) 865 for (j = 0; j < tz->trips.active[i].devices.count; j++){
866 seq_printf(seq, "0x%p ", 866 acpi_bus_get_device(tz->trips.active[i].devices.handles[j], &device);
867 tz->trips.active[i].devices.handles[j]); 867 seq_printf(seq, "%4.4s ", acpi_device_bid(device));
868 }
868 seq_puts(seq, "\n"); 869 seq_puts(seq, "\n");
869 } 870 }
870 871
diff --git a/drivers/acpi/toshiba_acpi.c b/drivers/acpi/toshiba_acpi.c
index 3906d47b9783..1cfbecb0ac10 100644
--- a/drivers/acpi/toshiba_acpi.c
+++ b/drivers/acpi/toshiba_acpi.c
@@ -538,7 +538,7 @@ static struct backlight_ops toshiba_backlight_data = {
538 .update_status = set_lcd_status, 538 .update_status = set_lcd_status,
539}; 539};
540 540
541static void __exit toshiba_acpi_exit(void) 541static void toshiba_acpi_exit(void)
542{ 542{
543 if (toshiba_backlight_device) 543 if (toshiba_backlight_device)
544 backlight_device_unregister(toshiba_backlight_device); 544 backlight_device_unregister(toshiba_backlight_device);
diff --git a/drivers/acpi/utilities/utcopy.c b/drivers/acpi/utilities/utcopy.c
index 4c1e00874dff..879eaa10d3ae 100644
--- a/drivers/acpi/utilities/utcopy.c
+++ b/drivers/acpi/utilities/utcopy.c
@@ -68,6 +68,10 @@ acpi_ut_copy_esimple_to_isimple(union acpi_object *user_obj,
68 union acpi_operand_object **return_obj); 68 union acpi_operand_object **return_obj);
69 69
70static acpi_status 70static acpi_status
71acpi_ut_copy_epackage_to_ipackage(union acpi_object *external_object,
72 union acpi_operand_object **internal_object);
73
74static acpi_status
71acpi_ut_copy_simple_object(union acpi_operand_object *source_desc, 75acpi_ut_copy_simple_object(union acpi_operand_object *source_desc,
72 union acpi_operand_object *dest_desc); 76 union acpi_operand_object *dest_desc);
73 77
@@ -518,77 +522,73 @@ acpi_ut_copy_esimple_to_isimple(union acpi_object *external_object,
518 return_ACPI_STATUS(AE_NO_MEMORY); 522 return_ACPI_STATUS(AE_NO_MEMORY);
519} 523}
520 524
521#ifdef ACPI_FUTURE_IMPLEMENTATION
522/* Code to convert packages that are parameters to control methods */
523
524/******************************************************************************* 525/*******************************************************************************
525 * 526 *
526 * FUNCTION: acpi_ut_copy_epackage_to_ipackage 527 * FUNCTION: acpi_ut_copy_epackage_to_ipackage
527 * 528 *
528 * PARAMETERS: *internal_object - Pointer to the object we are returning 529 * PARAMETERS: external_object - The external object to be converted
529 * *Buffer - Where the object is returned 530 * internal_object - Where the internal object is returned
530 * *space_used - Where the length of the object is returned
531 * 531 *
532 * RETURN: Status 532 * RETURN: Status
533 * 533 *
534 * DESCRIPTION: This function is called to place a package object in a user 534 * DESCRIPTION: Copy an external package object to an internal package.
535 * buffer. A package object by definition contains other objects. 535 * Handles nested packages.
536 *
537 * The buffer is assumed to have sufficient space for the object.
538 * The caller must have verified the buffer length needed using the
539 * acpi_ut_get_object_size function before calling this function.
540 * 536 *
541 ******************************************************************************/ 537 ******************************************************************************/
542 538
543static acpi_status 539static acpi_status
544acpi_ut_copy_epackage_to_ipackage(union acpi_operand_object *internal_object, 540acpi_ut_copy_epackage_to_ipackage(union acpi_object *external_object,
545 u8 * buffer, u32 * space_used) 541 union acpi_operand_object **internal_object)
546{ 542{
547 u8 *free_space; 543 acpi_status status = AE_OK;
548 union acpi_object *external_object; 544 union acpi_operand_object *package_object;
549 u32 length = 0; 545 union acpi_operand_object **package_elements;
550 u32 this_index; 546 acpi_native_uint i;
551 u32 object_space = 0;
552 union acpi_operand_object *this_internal_obj;
553 union acpi_object *this_external_obj;
554 547
555 ACPI_FUNCTION_TRACE(ut_copy_epackage_to_ipackage); 548 ACPI_FUNCTION_TRACE(ut_copy_epackage_to_ipackage);
556 549
557 /* 550 /* Create the package object */
558 * First package at head of the buffer
559 */
560 external_object = (union acpi_object *)buffer;
561 551
562 /* 552 package_object =
563 * Free space begins right after the first package 553 acpi_ut_create_package_object(external_object->package.count);
564 */ 554 if (!package_object) {
565 free_space = buffer + sizeof(union acpi_object); 555 return_ACPI_STATUS(AE_NO_MEMORY);
556 }
566 557
567 external_object->type = ACPI_GET_OBJECT_TYPE(internal_object); 558 package_elements = package_object->package.elements;
568 external_object->package.count = internal_object->package.count;
569 external_object->package.elements = (union acpi_object *)free_space;
570 559
571 /* 560 /*
572 * Build an array of ACPI_OBJECTS in the buffer 561 * Recursive implementation. Probably ok, since nested external packages
573 * and move the free space past it 562 * as parameters should be very rare.
574 */ 563 */
575 free_space += 564 for (i = 0; i < external_object->package.count; i++) {
576 external_object->package.count * sizeof(union acpi_object); 565 status =
566 acpi_ut_copy_eobject_to_iobject(&external_object->package.
567 elements[i],
568 &package_elements[i]);
569 if (ACPI_FAILURE(status)) {
577 570
578 /* Call walk_package */ 571 /* Truncate package and delete it */
579 572
580} 573 package_object->package.count = i;
574 package_elements[i] = NULL;
575 acpi_ut_remove_reference(package_object);
576 return_ACPI_STATUS(status);
577 }
578 }
581 579
582#endif /* Future implementation */ 580 *internal_object = package_object;
581 return_ACPI_STATUS(status);
582}
583 583
584/******************************************************************************* 584/*******************************************************************************
585 * 585 *
586 * FUNCTION: acpi_ut_copy_eobject_to_iobject 586 * FUNCTION: acpi_ut_copy_eobject_to_iobject
587 * 587 *
588 * PARAMETERS: *internal_object - The external object to be converted 588 * PARAMETERS: external_object - The external object to be converted
589 * *buffer_ptr - Where the internal object is returned 589 * internal_object - Where the internal object is returned
590 * 590 *
591 * RETURN: Status - the status of the call 591 * RETURN: Status - the status of the call
592 * 592 *
593 * DESCRIPTION: Converts an external object to an internal object. 593 * DESCRIPTION: Converts an external object to an internal object.
594 * 594 *
@@ -603,16 +603,10 @@ acpi_ut_copy_eobject_to_iobject(union acpi_object *external_object,
603 ACPI_FUNCTION_TRACE(ut_copy_eobject_to_iobject); 603 ACPI_FUNCTION_TRACE(ut_copy_eobject_to_iobject);
604 604
605 if (external_object->type == ACPI_TYPE_PACKAGE) { 605 if (external_object->type == ACPI_TYPE_PACKAGE) {
606 /* 606 status =
607 * Packages as external input to control methods are not supported, 607 acpi_ut_copy_epackage_to_ipackage(external_object,
608 */ 608 internal_object);
609 ACPI_ERROR((AE_INFO, 609 } else {
610 "Packages as parameters not implemented!"));
611
612 return_ACPI_STATUS(AE_NOT_IMPLEMENTED);
613 }
614
615 else {
616 /* 610 /*
617 * Build a simple object (no nested objects) 611 * Build a simple object (no nested objects)
618 */ 612 */
@@ -803,33 +797,19 @@ acpi_ut_copy_ielement_to_ielement(u8 object_type,
803 * Create and build the package object 797 * Create and build the package object
804 */ 798 */
805 target_object = 799 target_object =
806 acpi_ut_create_internal_object(ACPI_TYPE_PACKAGE); 800 acpi_ut_create_package_object(source_object->package.count);
807 if (!target_object) { 801 if (!target_object) {
808 return (AE_NO_MEMORY); 802 return (AE_NO_MEMORY);
809 } 803 }
810 804
811 target_object->package.count = source_object->package.count;
812 target_object->common.flags = source_object->common.flags; 805 target_object->common.flags = source_object->common.flags;
813 806
814 /* 807 /* Pass the new package object back to the package walk routine */
815 * Create the object array
816 */
817 target_object->package.elements =
818 ACPI_ALLOCATE_ZEROED(((acpi_size) source_object->package.
819 count + 1) * sizeof(void *));
820 if (!target_object->package.elements) {
821 status = AE_NO_MEMORY;
822 goto error_exit;
823 }
824 808
825 /*
826 * Pass the new package object back to the package walk routine
827 */
828 state->pkg.this_target_obj = target_object; 809 state->pkg.this_target_obj = target_object;
829 810
830 /* 811 /* Store the object pointer in the parent package object */
831 * Store the object pointer in the parent package object 812
832 */
833 *this_target_ptr = target_object; 813 *this_target_ptr = target_object;
834 break; 814 break;
835 815
diff --git a/drivers/acpi/utilities/uteval.c b/drivers/acpi/utilities/uteval.c
index 13d5879cd98b..8ec6f8e48138 100644
--- a/drivers/acpi/utilities/uteval.c
+++ b/drivers/acpi/utilities/uteval.c
@@ -59,10 +59,9 @@ acpi_ut_translate_one_cid(union acpi_operand_object *obj_desc,
59/* 59/*
60 * Strings supported by the _OSI predefined (internal) method. 60 * Strings supported by the _OSI predefined (internal) method.
61 */ 61 */
62static const char *acpi_interfaces_supported[] = { 62static char *acpi_interfaces_supported[] = {
63 /* Operating System Vendor Strings */ 63 /* Operating System Vendor Strings */
64 64
65 "Linux",
66 "Windows 2000", 65 "Windows 2000",
67 "Windows 2001", 66 "Windows 2001",
68 "Windows 2001 SP0", 67 "Windows 2001 SP0",
@@ -158,6 +157,31 @@ acpi_status acpi_ut_osi_implementation(struct acpi_walk_state *walk_state)
158 157
159/******************************************************************************* 158/*******************************************************************************
160 * 159 *
160 * FUNCTION: acpi_osi_invalidate
161 *
162 * PARAMETERS: interface_string
163 *
164 * RETURN: Status
165 *
166 * DESCRIPTION: invalidate string in pre-defiend _OSI string list
167 *
168 ******************************************************************************/
169
170acpi_status acpi_osi_invalidate(char *interface)
171{
172 int i;
173
174 for (i = 0; i < ACPI_ARRAY_LENGTH(acpi_interfaces_supported); i++) {
175 if (!ACPI_STRCMP(interface, acpi_interfaces_supported[i])) {
176 *acpi_interfaces_supported[i] = '\0';
177 return AE_OK;
178 }
179 }
180 return AE_NOT_FOUND;
181}
182
183/*******************************************************************************
184 *
161 * FUNCTION: acpi_ut_evaluate_object 185 * FUNCTION: acpi_ut_evaluate_object
162 * 186 *
163 * PARAMETERS: prefix_node - Starting node 187 * PARAMETERS: prefix_node - Starting node
diff --git a/drivers/acpi/utilities/utobject.c b/drivers/acpi/utilities/utobject.c
index 4696124759e1..db0b9bac7945 100644
--- a/drivers/acpi/utilities/utobject.c
+++ b/drivers/acpi/utilities/utobject.c
@@ -146,6 +146,48 @@ union acpi_operand_object *acpi_ut_create_internal_object_dbg(char *module_name,
146 146
147/******************************************************************************* 147/*******************************************************************************
148 * 148 *
149 * FUNCTION: acpi_ut_create_package_object
150 *
151 * PARAMETERS: Count - Number of package elements
152 *
153 * RETURN: Pointer to a new Package object, null on failure
154 *
155 * DESCRIPTION: Create a fully initialized package object
156 *
157 ******************************************************************************/
158
159union acpi_operand_object *acpi_ut_create_package_object(u32 count)
160{
161 union acpi_operand_object *package_desc;
162 union acpi_operand_object **package_elements;
163
164 ACPI_FUNCTION_TRACE_U32(ut_create_package_object, count);
165
166 /* Create a new Package object */
167
168 package_desc = acpi_ut_create_internal_object(ACPI_TYPE_PACKAGE);
169 if (!package_desc) {
170 return_PTR(NULL);
171 }
172
173 /*
174 * Create the element array. Count+1 allows the array to be null
175 * terminated.
176 */
177 package_elements = ACPI_ALLOCATE_ZEROED((acpi_size)
178 (count + 1) * sizeof(void *));
179 if (!package_elements) {
180 ACPI_FREE(package_desc);
181 return_PTR(NULL);
182 }
183
184 package_desc->package.count = count;
185 package_desc->package.elements = package_elements;
186 return_PTR(package_desc);
187}
188
189/*******************************************************************************
190 *
149 * FUNCTION: acpi_ut_create_buffer_object 191 * FUNCTION: acpi_ut_create_buffer_object
150 * 192 *
151 * PARAMETERS: buffer_size - Size of buffer to be created 193 * PARAMETERS: buffer_size - Size of buffer to be created
diff --git a/drivers/acpi/utilities/utxface.c b/drivers/acpi/utilities/utxface.c
index e9a57806cd34..2d496918b3cd 100644
--- a/drivers/acpi/utilities/utxface.c
+++ b/drivers/acpi/utilities/utxface.c
@@ -61,7 +61,7 @@ ACPI_MODULE_NAME("utxface")
61 * called, so any early initialization belongs here. 61 * called, so any early initialization belongs here.
62 * 62 *
63 ******************************************************************************/ 63 ******************************************************************************/
64acpi_status acpi_initialize_subsystem(void) 64acpi_status __init acpi_initialize_subsystem(void)
65{ 65{
66 acpi_status status; 66 acpi_status status;
67 67
@@ -108,8 +108,6 @@ acpi_status acpi_initialize_subsystem(void)
108 return_ACPI_STATUS(status); 108 return_ACPI_STATUS(status);
109} 109}
110 110
111ACPI_EXPORT_SYMBOL(acpi_initialize_subsystem)
112
113/******************************************************************************* 111/*******************************************************************************
114 * 112 *
115 * FUNCTION: acpi_enable_subsystem 113 * FUNCTION: acpi_enable_subsystem
diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index b4a8d6030e48..7d893a60f994 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -8,6 +8,7 @@ menuconfig ATA
8 depends on BLOCK 8 depends on BLOCK
9 depends on !(M32R || M68K) || BROKEN 9 depends on !(M32R || M68K) || BROKEN
10 depends on !SUN4 || BROKEN 10 depends on !SUN4 || BROKEN
11 depends on !(SPARC64 && !PCI)
11 select SCSI 12 select SCSI
12 ---help--- 13 ---help---
13 If you want to use a ATA hard disk, ATA tape drive, ATA CD-ROM or 14 If you want to use a ATA hard disk, ATA tape drive, ATA CD-ROM or
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 3ca9c610c110..af625147df62 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -3783,6 +3783,7 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
3783 { "FUJITSU MHT2060BH", NULL, ATA_HORKAGE_NONCQ }, 3783 { "FUJITSU MHT2060BH", NULL, ATA_HORKAGE_NONCQ },
3784 /* NCQ is broken */ 3784 /* NCQ is broken */
3785 { "Maxtor 6L250S0", "BANC1G10", ATA_HORKAGE_NONCQ }, 3785 { "Maxtor 6L250S0", "BANC1G10", ATA_HORKAGE_NONCQ },
3786 { "Maxtor 6B200M0", "BANC1B10", ATA_HORKAGE_NONCQ },
3786 /* NCQ hard hangs device under heavier load, needs hard power cycle */ 3787 /* NCQ hard hangs device under heavier load, needs hard power cycle */
3787 { "Maxtor 6B250S0", "BANC1B70", ATA_HORKAGE_NONCQ }, 3788 { "Maxtor 6B250S0", "BANC1B70", ATA_HORKAGE_NONCQ },
3788 /* Blacklist entries taken from Silicon Image 3124/3132 3789 /* Blacklist entries taken from Silicon Image 3124/3132
diff --git a/drivers/atm/firestream.c b/drivers/atm/firestream.c
index 9c67df5ccfa4..7f6d02ce1b5f 100644
--- a/drivers/atm/firestream.c
+++ b/drivers/atm/firestream.c
@@ -1475,6 +1475,7 @@ static void top_off_fp (struct fs_dev *dev, struct freepool *fp,
1475 struct FS_BPENTRY *qe, *ne; 1475 struct FS_BPENTRY *qe, *ne;
1476 struct sk_buff *skb; 1476 struct sk_buff *skb;
1477 int n = 0; 1477 int n = 0;
1478 u32 qe_tmp;
1478 1479
1479 fs_dprintk (FS_DEBUG_QUEUE, "Topping off queue at %x (%d-%d/%d)\n", 1480 fs_dprintk (FS_DEBUG_QUEUE, "Topping off queue at %x (%d-%d/%d)\n",
1480 fp->offset, read_fs (dev, FP_CNT (fp->offset)), fp->n, 1481 fp->offset, read_fs (dev, FP_CNT (fp->offset)), fp->n,
@@ -1502,10 +1503,16 @@ static void top_off_fp (struct fs_dev *dev, struct freepool *fp,
1502 ne->skb = skb; 1503 ne->skb = skb;
1503 ne->fp = fp; 1504 ne->fp = fp;
1504 1505
1505 qe = (struct FS_BPENTRY *) (read_fs (dev, FP_EA(fp->offset))); 1506 /*
1506 fs_dprintk (FS_DEBUG_QUEUE, "link at %p\n", qe); 1507 * FIXME: following code encodes and decodes
1507 if (qe) { 1508 * machine pointers (could be 64-bit) into a
1508 qe = bus_to_virt ((long) qe); 1509 * 32-bit register.
1510 */
1511
1512 qe_tmp = read_fs (dev, FP_EA(fp->offset));
1513 fs_dprintk (FS_DEBUG_QUEUE, "link at %x\n", qe_tmp);
1514 if (qe_tmp) {
1515 qe = bus_to_virt ((long) qe_tmp);
1509 qe->next = virt_to_bus(ne); 1516 qe->next = virt_to_bus(ne);
1510 qe->flags &= ~FP_FLAGS_EPI; 1517 qe->flags &= ~FP_FLAGS_EPI;
1511 } else 1518 } else
diff --git a/drivers/auxdisplay/Kconfig b/drivers/auxdisplay/Kconfig
index 2e18a63ead36..ea4fe3e48f33 100644
--- a/drivers/auxdisplay/Kconfig
+++ b/drivers/auxdisplay/Kconfig
@@ -68,6 +68,10 @@ config CFAG12864B
68 depends on X86 68 depends on X86
69 depends on FB 69 depends on FB
70 depends on KS0108 70 depends on KS0108
71 select FB_SYS_FILLRECT
72 select FB_SYS_COPYAREA
73 select FB_SYS_IMAGEBLIT
74 select FB_SYS_FOPS
71 default n 75 default n
72 ---help--- 76 ---help---
73 If you have a Crystalfontz 128x64 2-color LCD, cfag12864b Series, 77 If you have a Crystalfontz 128x64 2-color LCD, cfag12864b Series,
diff --git a/drivers/auxdisplay/cfag12864bfb.c b/drivers/auxdisplay/cfag12864bfb.c
index 66fafbb1d087..307c190699e0 100644
--- a/drivers/auxdisplay/cfag12864bfb.c
+++ b/drivers/auxdisplay/cfag12864bfb.c
@@ -73,9 +73,11 @@ static int cfag12864bfb_mmap(struct fb_info *info, struct vm_area_struct *vma)
73 73
74static struct fb_ops cfag12864bfb_ops = { 74static struct fb_ops cfag12864bfb_ops = {
75 .owner = THIS_MODULE, 75 .owner = THIS_MODULE,
76 .fb_fillrect = cfb_fillrect, 76 .fb_read = fb_sys_read,
77 .fb_copyarea = cfb_copyarea, 77 .fb_write = fb_sys_write,
78 .fb_imageblit = cfb_imageblit, 78 .fb_fillrect = sys_fillrect,
79 .fb_copyarea = sys_copyarea,
80 .fb_imageblit = sys_imageblit,
79 .fb_mmap = cfag12864bfb_mmap, 81 .fb_mmap = cfag12864bfb_mmap,
80}; 82};
81 83
diff --git a/drivers/char/drm/drm_drawable.c b/drivers/char/drm/drm_drawable.c
index de37d5f74563..b33313be2547 100644
--- a/drivers/char/drm/drm_drawable.c
+++ b/drivers/char/drm/drm_drawable.c
@@ -172,38 +172,49 @@ int drm_rmdraw(DRM_IOCTL_ARGS)
172 172
173 bitfield_length = idx + 1; 173 bitfield_length = idx + 1;
174 174
175 if (idx != id / (8 * sizeof(*bitfield))) 175 bitfield = NULL;
176 bitfield = drm_alloc(bitfield_length *
177 sizeof(*bitfield), DRM_MEM_BUFS);
178 176
179 if (!bitfield && bitfield_length) { 177 if (bitfield_length) {
180 bitfield = dev->drw_bitfield; 178 if (bitfield_length != dev->drw_bitfield_length)
181 bitfield_length = dev->drw_bitfield_length; 179 bitfield = drm_alloc(bitfield_length *
180 sizeof(*bitfield),
181 DRM_MEM_BUFS);
182
183 if (!bitfield) {
184 bitfield = dev->drw_bitfield;
185 bitfield_length = dev->drw_bitfield_length;
186 }
182 } 187 }
183 } 188 }
184 189
185 if (bitfield != dev->drw_bitfield) { 190 if (bitfield != dev->drw_bitfield) {
186 info_length = 8 * sizeof(*bitfield) * bitfield_length; 191 info_length = 8 * sizeof(*bitfield) * bitfield_length;
187 192
188 info = drm_alloc(info_length * sizeof(*info), DRM_MEM_BUFS); 193 if (info_length) {
194 info = drm_alloc(info_length * sizeof(*info),
195 DRM_MEM_BUFS);
189 196
190 if (!info && info_length) { 197 if (!info) {
191 info = dev->drw_info; 198 info = dev->drw_info;
192 info_length = dev->drw_info_length; 199 info_length = dev->drw_info_length;
193 } 200 }
201 } else
202 info = NULL;
194 203
195 spin_lock_irqsave(&dev->drw_lock, irqflags); 204 spin_lock_irqsave(&dev->drw_lock, irqflags);
196 205
197 memcpy(bitfield, dev->drw_bitfield, bitfield_length * 206 if (bitfield)
198 sizeof(*bitfield)); 207 memcpy(bitfield, dev->drw_bitfield, bitfield_length *
208 sizeof(*bitfield));
199 drm_free(dev->drw_bitfield, sizeof(*bitfield) * 209 drm_free(dev->drw_bitfield, sizeof(*bitfield) *
200 dev->drw_bitfield_length, DRM_MEM_BUFS); 210 dev->drw_bitfield_length, DRM_MEM_BUFS);
201 dev->drw_bitfield = bitfield; 211 dev->drw_bitfield = bitfield;
202 dev->drw_bitfield_length = bitfield_length; 212 dev->drw_bitfield_length = bitfield_length;
203 213
204 if (info != dev->drw_info) { 214 if (info != dev->drw_info) {
205 memcpy(info, dev->drw_info, info_length * 215 if (info)
206 sizeof(*info)); 216 memcpy(info, dev->drw_info, info_length *
217 sizeof(*info));
207 drm_free(dev->drw_info, sizeof(*info) * 218 drm_free(dev->drw_info, sizeof(*info) *
208 dev->drw_info_length, DRM_MEM_BUFS); 219 dev->drw_info_length, DRM_MEM_BUFS);
209 dev->drw_info = info; 220 dev->drw_info = info;
diff --git a/drivers/char/drm/drm_pciids.h b/drivers/char/drm/drm_pciids.h
index 31cdde83713b..177ccc07f968 100644
--- a/drivers/char/drm/drm_pciids.h
+++ b/drivers/char/drm/drm_pciids.h
@@ -102,13 +102,20 @@
102 {0x1002, 0x5653, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ 102 {0x1002, 0x5653, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
103 {0x1002, 0x5834, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS300|RADEON_IS_IGP}, \ 103 {0x1002, 0x5834, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS300|RADEON_IS_IGP}, \
104 {0x1002, 0x5835, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS300|RADEON_IS_IGP|RADEON_IS_MOBILITY}, \ 104 {0x1002, 0x5835, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS300|RADEON_IS_IGP|RADEON_IS_MOBILITY}, \
105 {0x1002, 0x5954, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS400|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_IS_IGPGART}, \
105 {0x1002, 0x5955, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS400|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_IS_IGPGART}, \ 106 {0x1002, 0x5955, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS400|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_IS_IGPGART}, \
107 {0x1002, 0x5974, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS400|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_IS_IGPGART}, \
108 {0x1002, 0x5975, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS400|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_IS_IGPGART}, \
106 {0x1002, 0x5960, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \ 109 {0x1002, 0x5960, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \
107 {0x1002, 0x5961, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \ 110 {0x1002, 0x5961, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \
108 {0x1002, 0x5962, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \ 111 {0x1002, 0x5962, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \
109 {0x1002, 0x5964, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \ 112 {0x1002, 0x5964, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \
110 {0x1002, 0x5965, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \ 113 {0x1002, 0x5965, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV280}, \
111 {0x1002, 0x5969, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV100}, \ 114 {0x1002, 0x5969, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV100}, \
115 {0x1002, 0x5a41, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS400|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_IS_IGPGART}, \
116 {0x1002, 0x5a42, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS400|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_IS_IGPGART}, \
117 {0x1002, 0x5a61, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS400|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_IS_IGPGART}, \
118 {0x1002, 0x5a62, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS400|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_IS_IGPGART}, \
112 {0x1002, 0x5b60, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_NEW_MEMMAP}, \ 119 {0x1002, 0x5b60, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_NEW_MEMMAP}, \
113 {0x1002, 0x5b62, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_NEW_MEMMAP}, \ 120 {0x1002, 0x5b62, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_NEW_MEMMAP}, \
114 {0x1002, 0x5b63, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_NEW_MEMMAP}, \ 121 {0x1002, 0x5b63, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_NEW_MEMMAP}, \
diff --git a/drivers/char/drm/i915_irq.c b/drivers/char/drm/i915_irq.c
index 78c1ae28f17c..b92062a239f1 100644
--- a/drivers/char/drm/i915_irq.c
+++ b/drivers/char/drm/i915_irq.c
@@ -582,7 +582,7 @@ void i915_driver_irq_postinstall(drm_device_t * dev)
582{ 582{
583 drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; 583 drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
584 584
585 dev_priv->swaps_lock = SPIN_LOCK_UNLOCKED; 585 spin_lock_init(&dev_priv->swaps_lock);
586 INIT_LIST_HEAD(&dev_priv->vbl_swaps.head); 586 INIT_LIST_HEAD(&dev_priv->vbl_swaps.head);
587 dev_priv->swaps_pending = 0; 587 dev_priv->swaps_pending = 0;
588 588
diff --git a/drivers/char/n_tty.c b/drivers/char/n_tty.c
index b3d4ccc33a47..154f42203b05 100644
--- a/drivers/char/n_tty.c
+++ b/drivers/char/n_tty.c
@@ -1191,6 +1191,7 @@ static int job_control(struct tty_struct *tty, struct file *file)
1191 is_current_pgrp_orphaned()) 1191 is_current_pgrp_orphaned())
1192 return -EIO; 1192 return -EIO;
1193 kill_pgrp(task_pgrp(current), SIGTTIN, 1); 1193 kill_pgrp(task_pgrp(current), SIGTTIN, 1);
1194 set_thread_flag(TIF_SIGPENDING);
1194 return -ERESTARTSYS; 1195 return -ERESTARTSYS;
1195 } 1196 }
1196 } 1197 }
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index 75d2a46e106f..3752edc30c36 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -1148,7 +1148,8 @@ int tty_check_change(struct tty_struct * tty)
1148 return 0; 1148 return 0;
1149 if (is_current_pgrp_orphaned()) 1149 if (is_current_pgrp_orphaned())
1150 return -EIO; 1150 return -EIO;
1151 (void) kill_pgrp(task_pgrp(current), SIGTTOU, 1); 1151 kill_pgrp(task_pgrp(current), SIGTTOU, 1);
1152 set_thread_flag(TIF_SIGPENDING);
1152 return -ERESTARTSYS; 1153 return -ERESTARTSYS;
1153} 1154}
1154 1155
diff --git a/drivers/char/watchdog/Kconfig b/drivers/char/watchdog/Kconfig
index 1cad32c62ed3..53f5538c0c05 100644
--- a/drivers/char/watchdog/Kconfig
+++ b/drivers/char/watchdog/Kconfig
@@ -115,6 +115,13 @@ config IXP4XX_WATCHDOG
115 115
116 Say N if you are unsure. 116 Say N if you are unsure.
117 117
118config KS8695_WATCHDOG
119 tristate "KS8695 watchdog"
120 depends on ARCH_KS8695
121 help
122 Watchdog timer embedded into KS8695 processor. This will reboot your
123 system when the timeout is reached.
124
118config S3C2410_WATCHDOG 125config S3C2410_WATCHDOG
119 tristate "S3C2410 Watchdog" 126 tristate "S3C2410 Watchdog"
120 depends on ARCH_S3C2410 127 depends on ARCH_S3C2410
diff --git a/drivers/char/watchdog/Makefile b/drivers/char/watchdog/Makefile
index 8bfc00cc7c2b..d90f649038c2 100644
--- a/drivers/char/watchdog/Makefile
+++ b/drivers/char/watchdog/Makefile
@@ -29,6 +29,7 @@ obj-$(CONFIG_21285_WATCHDOG) += wdt285.o
29obj-$(CONFIG_977_WATCHDOG) += wdt977.o 29obj-$(CONFIG_977_WATCHDOG) += wdt977.o
30obj-$(CONFIG_IXP2000_WATCHDOG) += ixp2000_wdt.o 30obj-$(CONFIG_IXP2000_WATCHDOG) += ixp2000_wdt.o
31obj-$(CONFIG_IXP4XX_WATCHDOG) += ixp4xx_wdt.o 31obj-$(CONFIG_IXP4XX_WATCHDOG) += ixp4xx_wdt.o
32obj-$(CONFIG_KS8695_WATCHDOG) += ks8695_wdt.o
32obj-$(CONFIG_S3C2410_WATCHDOG) += s3c2410_wdt.o 33obj-$(CONFIG_S3C2410_WATCHDOG) += s3c2410_wdt.o
33obj-$(CONFIG_SA1100_WATCHDOG) += sa1100_wdt.o 34obj-$(CONFIG_SA1100_WATCHDOG) += sa1100_wdt.o
34obj-$(CONFIG_MPCORE_WATCHDOG) += mpcore_wdt.o 35obj-$(CONFIG_MPCORE_WATCHDOG) += mpcore_wdt.o
diff --git a/drivers/char/watchdog/ixp2000_wdt.c b/drivers/char/watchdog/ixp2000_wdt.c
index fd955dbd588c..dc7548dcaf35 100644
--- a/drivers/char/watchdog/ixp2000_wdt.c
+++ b/drivers/char/watchdog/ixp2000_wdt.c
@@ -205,7 +205,7 @@ static void __exit ixp2000_wdt_exit(void)
205module_init(ixp2000_wdt_init); 205module_init(ixp2000_wdt_init);
206module_exit(ixp2000_wdt_exit); 206module_exit(ixp2000_wdt_exit);
207 207
208MODULE_AUTHOR("Deepak Saxena <dsaxena@plexity.net">); 208MODULE_AUTHOR("Deepak Saxena <dsaxena@plexity.net>");
209MODULE_DESCRIPTION("IXP2000 Network Processor Watchdog"); 209MODULE_DESCRIPTION("IXP2000 Network Processor Watchdog");
210 210
211module_param(heartbeat, int, 0); 211module_param(heartbeat, int, 0);
diff --git a/drivers/char/watchdog/ks8695_wdt.c b/drivers/char/watchdog/ks8695_wdt.c
new file mode 100644
index 000000000000..7150fb945eaf
--- /dev/null
+++ b/drivers/char/watchdog/ks8695_wdt.c
@@ -0,0 +1,308 @@
1/*
2 * Watchdog driver for Kendin/Micrel KS8695.
3 *
4 * (C) 2007 Andrew Victor
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#include <linux/errno.h>
12#include <linux/fs.h>
13#include <linux/init.h>
14#include <linux/kernel.h>
15#include <linux/miscdevice.h>
16#include <linux/module.h>
17#include <linux/moduleparam.h>
18#include <linux/platform_device.h>
19#include <linux/types.h>
20#include <linux/watchdog.h>
21#include <asm/bitops.h>
22#include <asm/io.h>
23#include <asm/uaccess.h>
24#include <asm/arch/regs-timer.h>
25
26
27#define WDT_DEFAULT_TIME 5 /* seconds */
28#define WDT_MAX_TIME 171 /* seconds */
29
30static int wdt_time = WDT_DEFAULT_TIME;
31static int nowayout = WATCHDOG_NOWAYOUT;
32
33module_param(wdt_time, int, 0);
34MODULE_PARM_DESC(wdt_time, "Watchdog time in seconds. (default="__MODULE_STRING(WDT_DEFAULT_TIME) ")");
35
36#ifdef CONFIG_WATCHDOG_NOWAYOUT
37module_param(nowayout, int, 0);
38MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
39#endif
40
41
42static unsigned long ks8695wdt_busy;
43
44/* ......................................................................... */
45
46/*
47 * Disable the watchdog.
48 */
49static void inline ks8695_wdt_stop(void)
50{
51 unsigned long tmcon;
52
53 /* disable timer0 */
54 tmcon = __raw_readl(KS8695_TMR_VA + KS8695_TMCON);
55 __raw_writel(tmcon & ~TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON);
56}
57
58/*
59 * Enable and reset the watchdog.
60 */
61static void inline ks8695_wdt_start(void)
62{
63 unsigned long tmcon;
64 unsigned long tval = wdt_time * CLOCK_TICK_RATE;
65
66 /* disable timer0 */
67 tmcon = __raw_readl(KS8695_TMR_VA + KS8695_TMCON);
68 __raw_writel(tmcon & ~TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON);
69
70 /* program timer0 */
71 __raw_writel(tval | T0TC_WATCHDOG, KS8695_TMR_VA + KS8695_T0TC);
72
73 /* re-enable timer0 */
74 tmcon = __raw_readl(KS8695_TMR_VA + KS8695_TMCON);
75 __raw_writel(tmcon | TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON);
76}
77
78/*
79 * Reload the watchdog timer. (ie, pat the watchdog)
80 */
81static void inline ks8695_wdt_reload(void)
82{
83 unsigned long tmcon;
84
85 /* disable, then re-enable timer0 */
86 tmcon = __raw_readl(KS8695_TMR_VA + KS8695_TMCON);
87 __raw_writel(tmcon & ~TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON);
88 __raw_writel(tmcon | TMCON_T0EN, KS8695_TMR_VA + KS8695_TMCON);
89}
90
91/*
92 * Change the watchdog time interval.
93 */
94static int ks8695_wdt_settimeout(int new_time)
95{
96 /*
97 * All counting occurs at SLOW_CLOCK / 128 = 0.256 Hz
98 *
99 * Since WDV is a 16-bit counter, the maximum period is
100 * 65536 / 0.256 = 256 seconds.
101 */
102 if ((new_time <= 0) || (new_time > WDT_MAX_TIME))
103 return -EINVAL;
104
105 /* Set new watchdog time. It will be used when ks8695_wdt_start() is called. */
106 wdt_time = new_time;
107 return 0;
108}
109
110/* ......................................................................... */
111
112/*
113 * Watchdog device is opened, and watchdog starts running.
114 */
115static int ks8695_wdt_open(struct inode *inode, struct file *file)
116{
117 if (test_and_set_bit(0, &ks8695wdt_busy))
118 return -EBUSY;
119
120 ks8695_wdt_start();
121 return nonseekable_open(inode, file);
122}
123
124/*
125 * Close the watchdog device.
126 * If CONFIG_WATCHDOG_NOWAYOUT is NOT defined then the watchdog is also
127 * disabled.
128 */
129static int ks8695_wdt_close(struct inode *inode, struct file *file)
130{
131 if (!nowayout)
132 ks8695_wdt_stop(); /* Disable the watchdog when file is closed */
133
134 clear_bit(0, &ks8695wdt_busy);
135 return 0;
136}
137
138static struct watchdog_info ks8695_wdt_info = {
139 .identity = "ks8695 watchdog",
140 .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING,
141};
142
143/*
144 * Handle commands from user-space.
145 */
146static int ks8695_wdt_ioctl(struct inode *inode, struct file *file,
147 unsigned int cmd, unsigned long arg)
148{
149 void __user *argp = (void __user *)arg;
150 int __user *p = argp;
151 int new_value;
152
153 switch(cmd) {
154 case WDIOC_KEEPALIVE:
155 ks8695_wdt_reload(); /* pat the watchdog */
156 return 0;
157
158 case WDIOC_GETSUPPORT:
159 return copy_to_user(argp, &ks8695_wdt_info, sizeof(ks8695_wdt_info)) ? -EFAULT : 0;
160
161 case WDIOC_SETTIMEOUT:
162 if (get_user(new_value, p))
163 return -EFAULT;
164
165 if (ks8695_wdt_settimeout(new_value))
166 return -EINVAL;
167
168 /* Enable new time value */
169 ks8695_wdt_start();
170
171 /* Return current value */
172 return put_user(wdt_time, p);
173
174 case WDIOC_GETTIMEOUT:
175 return put_user(wdt_time, p);
176
177 case WDIOC_GETSTATUS:
178 case WDIOC_GETBOOTSTATUS:
179 return put_user(0, p);
180
181 case WDIOC_SETOPTIONS:
182 if (get_user(new_value, p))
183 return -EFAULT;
184
185 if (new_value & WDIOS_DISABLECARD)
186 ks8695_wdt_stop();
187 if (new_value & WDIOS_ENABLECARD)
188 ks8695_wdt_start();
189 return 0;
190
191 default:
192 return -ENOTTY;
193 }
194}
195
196/*
197 * Pat the watchdog whenever device is written to.
198 */
199static ssize_t ks8695_wdt_write(struct file *file, const char *data, size_t len, loff_t *ppos)
200{
201 ks8695_wdt_reload(); /* pat the watchdog */
202 return len;
203}
204
205/* ......................................................................... */
206
207static const struct file_operations ks8695wdt_fops = {
208 .owner = THIS_MODULE,
209 .llseek = no_llseek,
210 .ioctl = ks8695_wdt_ioctl,
211 .open = ks8695_wdt_open,
212 .release = ks8695_wdt_close,
213 .write = ks8695_wdt_write,
214};
215
216static struct miscdevice ks8695wdt_miscdev = {
217 .minor = WATCHDOG_MINOR,
218 .name = "watchdog",
219 .fops = &ks8695wdt_fops,
220};
221
222static int __init ks8695wdt_probe(struct platform_device *pdev)
223{
224 int res;
225
226 if (ks8695wdt_miscdev.parent)
227 return -EBUSY;
228 ks8695wdt_miscdev.parent = &pdev->dev;
229
230 res = misc_register(&ks8695wdt_miscdev);
231 if (res)
232 return res;
233
234 printk("KS8695 Watchdog Timer enabled (%d seconds%s)\n", wdt_time, nowayout ? ", nowayout" : "");
235 return 0;
236}
237
238static int __exit ks8695wdt_remove(struct platform_device *pdev)
239{
240 int res;
241
242 res = misc_deregister(&ks8695wdt_miscdev);
243 if (!res)
244 ks8695wdt_miscdev.parent = NULL;
245
246 return res;
247}
248
249static void ks8695wdt_shutdown(struct platform_device *pdev)
250{
251 ks8695_wdt_stop();
252}
253
254#ifdef CONFIG_PM
255
256static int ks8695wdt_suspend(struct platform_device *pdev, pm_message_t message)
257{
258 ks8695_wdt_stop();
259 return 0;
260}
261
262static int ks8695wdt_resume(struct platform_device *pdev)
263{
264 if (ks8695wdt_busy)
265 ks8695_wdt_start();
266 return 0;
267}
268
269#else
270#define ks8695wdt_suspend NULL
271#define ks8695wdt_resume NULL
272#endif
273
274static struct platform_driver ks8695wdt_driver = {
275 .probe = ks8695wdt_probe,
276 .remove = __exit_p(ks8695wdt_remove),
277 .shutdown = ks8695wdt_shutdown,
278 .suspend = ks8695wdt_suspend,
279 .resume = ks8695wdt_resume,
280 .driver = {
281 .name = "ks8695_wdt",
282 .owner = THIS_MODULE,
283 },
284};
285
286static int __init ks8695_wdt_init(void)
287{
288 /* Check that the heartbeat value is within range; if not reset to the default */
289 if (ks8695_wdt_settimeout(wdt_time)) {
290 ks8695_wdt_settimeout(WDT_DEFAULT_TIME);
291 pr_info("ks8695_wdt: wdt_time value must be 1 <= wdt_time <= %i, using %d\n", wdt_time, WDT_MAX_TIME);
292 }
293
294 return platform_driver_register(&ks8695wdt_driver);
295}
296
297static void __exit ks8695_wdt_exit(void)
298{
299 platform_driver_unregister(&ks8695wdt_driver);
300}
301
302module_init(ks8695_wdt_init);
303module_exit(ks8695_wdt_exit);
304
305MODULE_AUTHOR("Andrew Victor");
306MODULE_DESCRIPTION("Watchdog driver for KS8695");
307MODULE_LICENSE("GPL");
308MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/firewire/fw-card.c b/drivers/firewire/fw-card.c
index 636151a64add..9eb1edacd825 100644
--- a/drivers/firewire/fw-card.c
+++ b/drivers/firewire/fw-card.c
@@ -407,11 +407,6 @@ fw_card_add(struct fw_card *card,
407 card->link_speed = link_speed; 407 card->link_speed = link_speed;
408 card->guid = guid; 408 card->guid = guid;
409 409
410 /* Activate link_on bit and contender bit in our self ID packets.*/
411 if (card->driver->update_phy_reg(card, 4, 0,
412 PHY_LINK_ACTIVE | PHY_CONTENDER) < 0)
413 return -EIO;
414
415 /* 410 /*
416 * The subsystem grabs a reference when the card is added and 411 * The subsystem grabs a reference when the card is added and
417 * drops it when the driver calls fw_core_remove_card. 412 * drops it when the driver calls fw_core_remove_card.
diff --git a/drivers/firewire/fw-cdev.c b/drivers/firewire/fw-cdev.c
index 3ab3585d3601..5d402d63799f 100644
--- a/drivers/firewire/fw-cdev.c
+++ b/drivers/firewire/fw-cdev.c
@@ -677,12 +677,21 @@ static int ioctl_create_iso_context(struct client *client, void *buffer)
677 return 0; 677 return 0;
678} 678}
679 679
680/* Macros for decoding the iso packet control header. */
681#define GET_PAYLOAD_LENGTH(v) ((v) & 0xffff)
682#define GET_INTERRUPT(v) (((v) >> 16) & 0x01)
683#define GET_SKIP(v) (((v) >> 17) & 0x01)
684#define GET_TAG(v) (((v) >> 18) & 0x02)
685#define GET_SY(v) (((v) >> 20) & 0x04)
686#define GET_HEADER_LENGTH(v) (((v) >> 24) & 0xff)
687
680static int ioctl_queue_iso(struct client *client, void *buffer) 688static int ioctl_queue_iso(struct client *client, void *buffer)
681{ 689{
682 struct fw_cdev_queue_iso *request = buffer; 690 struct fw_cdev_queue_iso *request = buffer;
683 struct fw_cdev_iso_packet __user *p, *end, *next; 691 struct fw_cdev_iso_packet __user *p, *end, *next;
684 struct fw_iso_context *ctx = client->iso_context; 692 struct fw_iso_context *ctx = client->iso_context;
685 unsigned long payload, buffer_end, header_length; 693 unsigned long payload, buffer_end, header_length;
694 u32 control;
686 int count; 695 int count;
687 struct { 696 struct {
688 struct fw_iso_packet packet; 697 struct fw_iso_packet packet;
@@ -717,8 +726,14 @@ static int ioctl_queue_iso(struct client *client, void *buffer)
717 end = (void __user *)p + request->size; 726 end = (void __user *)p + request->size;
718 count = 0; 727 count = 0;
719 while (p < end) { 728 while (p < end) {
720 if (__copy_from_user(&u.packet, p, sizeof(*p))) 729 if (get_user(control, &p->control))
721 return -EFAULT; 730 return -EFAULT;
731 u.packet.payload_length = GET_PAYLOAD_LENGTH(control);
732 u.packet.interrupt = GET_INTERRUPT(control);
733 u.packet.skip = GET_SKIP(control);
734 u.packet.tag = GET_TAG(control);
735 u.packet.sy = GET_SY(control);
736 u.packet.header_length = GET_HEADER_LENGTH(control);
722 737
723 if (ctx->type == FW_ISO_CONTEXT_TRANSMIT) { 738 if (ctx->type == FW_ISO_CONTEXT_TRANSMIT) {
724 header_length = u.packet.header_length; 739 header_length = u.packet.header_length;
diff --git a/drivers/firewire/fw-device.h b/drivers/firewire/fw-device.h
index 0ba9d64ccf4c..af1723eae4ba 100644
--- a/drivers/firewire/fw-device.h
+++ b/drivers/firewire/fw-device.h
@@ -99,6 +99,7 @@ fw_unit(struct device *dev)
99#define CSR_DEPENDENT_INFO 0x14 99#define CSR_DEPENDENT_INFO 0x14
100#define CSR_MODEL 0x17 100#define CSR_MODEL 0x17
101#define CSR_INSTANCE 0x18 101#define CSR_INSTANCE 0x18
102#define CSR_DIRECTORY_ID 0x20
102 103
103#define SBP2_COMMAND_SET_SPECIFIER 0x38 104#define SBP2_COMMAND_SET_SPECIFIER 0x38
104#define SBP2_COMMAND_SET 0x39 105#define SBP2_COMMAND_SET 0x39
diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index 2e4cfa57126d..0d08bf9b78c2 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -417,12 +417,21 @@ ar_context_init(struct ar_context *ctx, struct fw_ohci *ohci, u32 regs)
417 ctx->current_buffer = ab.next; 417 ctx->current_buffer = ab.next;
418 ctx->pointer = ctx->current_buffer->data; 418 ctx->pointer = ctx->current_buffer->data;
419 419
420 reg_write(ctx->ohci, COMMAND_PTR(ctx->regs), 420 return 0;
421 le32_to_cpu(ab.descriptor.branch_address)); 421}
422
423static void ar_context_run(struct ar_context *ctx)
424{
425 struct ar_buffer *ab = ctx->current_buffer;
426 dma_addr_t ab_bus;
427 size_t offset;
428
429 offset = offsetof(struct ar_buffer, data);
430 ab_bus = ab->descriptor.data_address - offset;
431
432 reg_write(ctx->ohci, COMMAND_PTR(ctx->regs), ab_bus | 1);
422 reg_write(ctx->ohci, CONTROL_SET(ctx->regs), CONTEXT_RUN); 433 reg_write(ctx->ohci, CONTROL_SET(ctx->regs), CONTEXT_RUN);
423 flush_writes(ctx->ohci); 434 flush_writes(ctx->ohci);
424
425 return 0;
426} 435}
427 436
428static void context_tasklet(unsigned long data) 437static void context_tasklet(unsigned long data)
@@ -1039,11 +1048,78 @@ static irqreturn_t irq_handler(int irq, void *data)
1039 return IRQ_HANDLED; 1048 return IRQ_HANDLED;
1040} 1049}
1041 1050
1051static int software_reset(struct fw_ohci *ohci)
1052{
1053 int i;
1054
1055 reg_write(ohci, OHCI1394_HCControlSet, OHCI1394_HCControl_softReset);
1056
1057 for (i = 0; i < OHCI_LOOP_COUNT; i++) {
1058 if ((reg_read(ohci, OHCI1394_HCControlSet) &
1059 OHCI1394_HCControl_softReset) == 0)
1060 return 0;
1061 msleep(1);
1062 }
1063
1064 return -EBUSY;
1065}
1066
1042static int ohci_enable(struct fw_card *card, u32 *config_rom, size_t length) 1067static int ohci_enable(struct fw_card *card, u32 *config_rom, size_t length)
1043{ 1068{
1044 struct fw_ohci *ohci = fw_ohci(card); 1069 struct fw_ohci *ohci = fw_ohci(card);
1045 struct pci_dev *dev = to_pci_dev(card->device); 1070 struct pci_dev *dev = to_pci_dev(card->device);
1046 1071
1072 if (software_reset(ohci)) {
1073 fw_error("Failed to reset ohci card.\n");
1074 return -EBUSY;
1075 }
1076
1077 /*
1078 * Now enable LPS, which we need in order to start accessing
1079 * most of the registers. In fact, on some cards (ALI M5251),
1080 * accessing registers in the SClk domain without LPS enabled
1081 * will lock up the machine. Wait 50msec to make sure we have
1082 * full link enabled.
1083 */
1084 reg_write(ohci, OHCI1394_HCControlSet,
1085 OHCI1394_HCControl_LPS |
1086 OHCI1394_HCControl_postedWriteEnable);
1087 flush_writes(ohci);
1088 msleep(50);
1089
1090 reg_write(ohci, OHCI1394_HCControlClear,
1091 OHCI1394_HCControl_noByteSwapData);
1092
1093 reg_write(ohci, OHCI1394_LinkControlSet,
1094 OHCI1394_LinkControl_rcvSelfID |
1095 OHCI1394_LinkControl_cycleTimerEnable |
1096 OHCI1394_LinkControl_cycleMaster);
1097
1098 reg_write(ohci, OHCI1394_ATRetries,
1099 OHCI1394_MAX_AT_REQ_RETRIES |
1100 (OHCI1394_MAX_AT_RESP_RETRIES << 4) |
1101 (OHCI1394_MAX_PHYS_RESP_RETRIES << 8));
1102
1103 ar_context_run(&ohci->ar_request_ctx);
1104 ar_context_run(&ohci->ar_response_ctx);
1105
1106 reg_write(ohci, OHCI1394_SelfIDBuffer, ohci->self_id_bus);
1107 reg_write(ohci, OHCI1394_PhyUpperBound, 0x00010000);
1108 reg_write(ohci, OHCI1394_IntEventClear, ~0);
1109 reg_write(ohci, OHCI1394_IntMaskClear, ~0);
1110 reg_write(ohci, OHCI1394_IntMaskSet,
1111 OHCI1394_selfIDComplete |
1112 OHCI1394_RQPkt | OHCI1394_RSPkt |
1113 OHCI1394_reqTxComplete | OHCI1394_respTxComplete |
1114 OHCI1394_isochRx | OHCI1394_isochTx |
1115 OHCI1394_masterIntEnable |
1116 OHCI1394_cycle64Seconds);
1117
1118 /* Activate link_on bit and contender bit in our self ID packets.*/
1119 if (ohci_update_phy_reg(card, 4, 0,
1120 PHY_LINK_ACTIVE | PHY_CONTENDER) < 0)
1121 return -EIO;
1122
1047 /* 1123 /*
1048 * When the link is not yet enabled, the atomic config rom 1124 * When the link is not yet enabled, the atomic config rom
1049 * update mechanism described below in ohci_set_config_rom() 1125 * update mechanism described below in ohci_set_config_rom()
@@ -1701,22 +1777,6 @@ static const struct fw_card_driver ohci_driver = {
1701 .stop_iso = ohci_stop_iso, 1777 .stop_iso = ohci_stop_iso,
1702}; 1778};
1703 1779
1704static int software_reset(struct fw_ohci *ohci)
1705{
1706 int i;
1707
1708 reg_write(ohci, OHCI1394_HCControlSet, OHCI1394_HCControl_softReset);
1709
1710 for (i = 0; i < OHCI_LOOP_COUNT; i++) {
1711 if ((reg_read(ohci, OHCI1394_HCControlSet) &
1712 OHCI1394_HCControl_softReset) == 0)
1713 return 0;
1714 msleep(1);
1715 }
1716
1717 return -EBUSY;
1718}
1719
1720static int __devinit 1780static int __devinit
1721pci_probe(struct pci_dev *dev, const struct pci_device_id *ent) 1781pci_probe(struct pci_dev *dev, const struct pci_device_id *ent)
1722{ 1782{
@@ -1762,33 +1822,6 @@ pci_probe(struct pci_dev *dev, const struct pci_device_id *ent)
1762 goto fail_iomem; 1822 goto fail_iomem;
1763 } 1823 }
1764 1824
1765 if (software_reset(ohci)) {
1766 fw_error("Failed to reset ohci card.\n");
1767 err = -EBUSY;
1768 goto fail_registers;
1769 }
1770
1771 /*
1772 * Now enable LPS, which we need in order to start accessing
1773 * most of the registers. In fact, on some cards (ALI M5251),
1774 * accessing registers in the SClk domain without LPS enabled
1775 * will lock up the machine. Wait 50msec to make sure we have
1776 * full link enabled.
1777 */
1778 reg_write(ohci, OHCI1394_HCControlSet,
1779 OHCI1394_HCControl_LPS |
1780 OHCI1394_HCControl_postedWriteEnable);
1781 flush_writes(ohci);
1782 msleep(50);
1783
1784 reg_write(ohci, OHCI1394_HCControlClear,
1785 OHCI1394_HCControl_noByteSwapData);
1786
1787 reg_write(ohci, OHCI1394_LinkControlSet,
1788 OHCI1394_LinkControl_rcvSelfID |
1789 OHCI1394_LinkControl_cycleTimerEnable |
1790 OHCI1394_LinkControl_cycleMaster);
1791
1792 ar_context_init(&ohci->ar_request_ctx, ohci, 1825 ar_context_init(&ohci->ar_request_ctx, ohci,
1793 OHCI1394_AsReqRcvContextControlSet); 1826 OHCI1394_AsReqRcvContextControlSet);
1794 1827
@@ -1801,11 +1834,6 @@ pci_probe(struct pci_dev *dev, const struct pci_device_id *ent)
1801 context_init(&ohci->at_response_ctx, ohci, AT_BUFFER_SIZE, 1834 context_init(&ohci->at_response_ctx, ohci, AT_BUFFER_SIZE,
1802 OHCI1394_AsRspTrContextControlSet, handle_at_packet); 1835 OHCI1394_AsRspTrContextControlSet, handle_at_packet);
1803 1836
1804 reg_write(ohci, OHCI1394_ATRetries,
1805 OHCI1394_MAX_AT_REQ_RETRIES |
1806 (OHCI1394_MAX_AT_RESP_RETRIES << 4) |
1807 (OHCI1394_MAX_PHYS_RESP_RETRIES << 8));
1808
1809 reg_write(ohci, OHCI1394_IsoRecvIntMaskSet, ~0); 1837 reg_write(ohci, OHCI1394_IsoRecvIntMaskSet, ~0);
1810 ohci->it_context_mask = reg_read(ohci, OHCI1394_IsoRecvIntMaskSet); 1838 ohci->it_context_mask = reg_read(ohci, OHCI1394_IsoRecvIntMaskSet);
1811 reg_write(ohci, OHCI1394_IsoRecvIntMaskClear, ~0); 1839 reg_write(ohci, OHCI1394_IsoRecvIntMaskClear, ~0);
@@ -1835,18 +1863,6 @@ pci_probe(struct pci_dev *dev, const struct pci_device_id *ent)
1835 goto fail_registers; 1863 goto fail_registers;
1836 } 1864 }
1837 1865
1838 reg_write(ohci, OHCI1394_SelfIDBuffer, ohci->self_id_bus);
1839 reg_write(ohci, OHCI1394_PhyUpperBound, 0x00010000);
1840 reg_write(ohci, OHCI1394_IntEventClear, ~0);
1841 reg_write(ohci, OHCI1394_IntMaskClear, ~0);
1842 reg_write(ohci, OHCI1394_IntMaskSet,
1843 OHCI1394_selfIDComplete |
1844 OHCI1394_RQPkt | OHCI1394_RSPkt |
1845 OHCI1394_reqTxComplete | OHCI1394_respTxComplete |
1846 OHCI1394_isochRx | OHCI1394_isochTx |
1847 OHCI1394_masterIntEnable |
1848 OHCI1394_cycle64Seconds);
1849
1850 bus_options = reg_read(ohci, OHCI1394_BusOptions); 1866 bus_options = reg_read(ohci, OHCI1394_BusOptions);
1851 max_receive = (bus_options >> 12) & 0xf; 1867 max_receive = (bus_options >> 12) & 0xf;
1852 link_speed = bus_options & 0x7; 1868 link_speed = bus_options & 0x7;
@@ -1908,6 +1924,45 @@ static void pci_remove(struct pci_dev *dev)
1908 fw_notify("Removed fw-ohci device.\n"); 1924 fw_notify("Removed fw-ohci device.\n");
1909} 1925}
1910 1926
1927#ifdef CONFIG_PM
1928static int pci_suspend(struct pci_dev *pdev, pm_message_t state)
1929{
1930 struct fw_ohci *ohci = pci_get_drvdata(pdev);
1931 int err;
1932
1933 software_reset(ohci);
1934 free_irq(pdev->irq, ohci);
1935 err = pci_save_state(pdev);
1936 if (err) {
1937 fw_error("pci_save_state failed with %d", err);
1938 return err;
1939 }
1940 err = pci_set_power_state(pdev, pci_choose_state(pdev, state));
1941 if (err) {
1942 fw_error("pci_set_power_state failed with %d", err);
1943 return err;
1944 }
1945
1946 return 0;
1947}
1948
1949static int pci_resume(struct pci_dev *pdev)
1950{
1951 struct fw_ohci *ohci = pci_get_drvdata(pdev);
1952 int err;
1953
1954 pci_set_power_state(pdev, PCI_D0);
1955 pci_restore_state(pdev);
1956 err = pci_enable_device(pdev);
1957 if (err) {
1958 fw_error("pci_enable_device failed with %d", err);
1959 return err;
1960 }
1961
1962 return ohci_enable(&ohci->card, ohci->config_rom, CONFIG_ROM_SIZE);
1963}
1964#endif
1965
1911static struct pci_device_id pci_table[] = { 1966static struct pci_device_id pci_table[] = {
1912 { PCI_DEVICE_CLASS(PCI_CLASS_SERIAL_FIREWIRE_OHCI, ~0) }, 1967 { PCI_DEVICE_CLASS(PCI_CLASS_SERIAL_FIREWIRE_OHCI, ~0) },
1913 { } 1968 { }
@@ -1920,6 +1975,10 @@ static struct pci_driver fw_ohci_pci_driver = {
1920 .id_table = pci_table, 1975 .id_table = pci_table,
1921 .probe = pci_probe, 1976 .probe = pci_probe,
1922 .remove = pci_remove, 1977 .remove = pci_remove,
1978#ifdef CONFIG_PM
1979 .resume = pci_resume,
1980 .suspend = pci_suspend,
1981#endif
1923}; 1982};
1924 1983
1925MODULE_AUTHOR("Kristian Hoegsberg <krh@bitplanet.net>"); 1984MODULE_AUTHOR("Kristian Hoegsberg <krh@bitplanet.net>");
diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c
index 68300414e5f4..a98d3915e26f 100644
--- a/drivers/firewire/fw-sbp2.c
+++ b/drivers/firewire/fw-sbp2.c
@@ -1108,6 +1108,58 @@ static int sbp2_scsi_abort(struct scsi_cmnd *cmd)
1108 return SUCCESS; 1108 return SUCCESS;
1109} 1109}
1110 1110
1111/*
1112 * Format of /sys/bus/scsi/devices/.../ieee1394_id:
1113 * u64 EUI-64 : u24 directory_ID : u16 LUN (all printed in hexadecimal)
1114 *
1115 * This is the concatenation of target port identifier and logical unit
1116 * identifier as per SAM-2...SAM-4 annex A.
1117 */
1118static ssize_t
1119sbp2_sysfs_ieee1394_id_show(struct device *dev, struct device_attribute *attr,
1120 char *buf)
1121{
1122 struct scsi_device *sdev = to_scsi_device(dev);
1123 struct sbp2_device *sd;
1124 struct fw_unit *unit;
1125 struct fw_device *device;
1126 u32 directory_id;
1127 struct fw_csr_iterator ci;
1128 int key, value, lun;
1129
1130 if (!sdev)
1131 return 0;
1132 sd = (struct sbp2_device *)sdev->host->hostdata;
1133 unit = sd->unit;
1134 device = fw_device(unit->device.parent);
1135
1136 /* implicit directory ID */
1137 directory_id = ((unit->directory - device->config_rom) * 4
1138 + CSR_CONFIG_ROM) & 0xffffff;
1139
1140 /* explicit directory ID, overrides implicit ID if present */
1141 fw_csr_iterator_init(&ci, unit->directory);
1142 while (fw_csr_iterator_next(&ci, &key, &value))
1143 if (key == CSR_DIRECTORY_ID) {
1144 directory_id = value;
1145 break;
1146 }
1147
1148 /* FIXME: Make this work for multi-lun devices. */
1149 lun = 0;
1150
1151 return sprintf(buf, "%08x%08x:%06x:%04x\n",
1152 device->config_rom[3], device->config_rom[4],
1153 directory_id, lun);
1154}
1155
1156static DEVICE_ATTR(ieee1394_id, S_IRUGO, sbp2_sysfs_ieee1394_id_show, NULL);
1157
1158static struct device_attribute *sbp2_scsi_sysfs_attrs[] = {
1159 &dev_attr_ieee1394_id,
1160 NULL
1161};
1162
1111static struct scsi_host_template scsi_driver_template = { 1163static struct scsi_host_template scsi_driver_template = {
1112 .module = THIS_MODULE, 1164 .module = THIS_MODULE,
1113 .name = "SBP-2 IEEE-1394", 1165 .name = "SBP-2 IEEE-1394",
@@ -1121,6 +1173,7 @@ static struct scsi_host_template scsi_driver_template = {
1121 .use_clustering = ENABLE_CLUSTERING, 1173 .use_clustering = ENABLE_CLUSTERING,
1122 .cmd_per_lun = 1, 1174 .cmd_per_lun = 1,
1123 .can_queue = 1, 1175 .can_queue = 1,
1176 .sdev_attrs = sbp2_scsi_sysfs_attrs,
1124}; 1177};
1125 1178
1126MODULE_AUTHOR("Kristian Hoegsberg <krh@bitplanet.net>"); 1179MODULE_AUTHOR("Kristian Hoegsberg <krh@bitplanet.net>");
diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
index 8a0a99b93641..28e7b91a4553 100644
--- a/drivers/i2c/busses/i2c-pxa.c
+++ b/drivers/i2c/busses/i2c-pxa.c
@@ -837,20 +837,10 @@ static const struct i2c_algorithm i2c_pxa_algorithm = {
837 .functionality = i2c_pxa_functionality, 837 .functionality = i2c_pxa_functionality,
838}; 838};
839 839
840static struct pxa_i2c i2c_pxa = {
841 .lock = __SPIN_LOCK_UNLOCKED(i2c_pxa.lock),
842 .adap = {
843 .owner = THIS_MODULE,
844 .algo = &i2c_pxa_algorithm,
845 .name = "pxa2xx-i2c.0",
846 .retries = 5,
847 },
848};
849
850#define res_len(r) ((r)->end - (r)->start + 1) 840#define res_len(r) ((r)->end - (r)->start + 1)
851static int i2c_pxa_probe(struct platform_device *dev) 841static int i2c_pxa_probe(struct platform_device *dev)
852{ 842{
853 struct pxa_i2c *i2c = &i2c_pxa; 843 struct pxa_i2c *i2c;
854 struct resource *res; 844 struct resource *res;
855 struct i2c_pxa_platform_data *plat = dev->dev.platform_data; 845 struct i2c_pxa_platform_data *plat = dev->dev.platform_data;
856 int ret; 846 int ret;
@@ -864,15 +854,20 @@ static int i2c_pxa_probe(struct platform_device *dev)
864 if (!request_mem_region(res->start, res_len(res), res->name)) 854 if (!request_mem_region(res->start, res_len(res), res->name))
865 return -ENOMEM; 855 return -ENOMEM;
866 856
867 i2c = kmalloc(sizeof(struct pxa_i2c), GFP_KERNEL); 857 i2c = kzalloc(sizeof(struct pxa_i2c), GFP_KERNEL);
868 if (!i2c) { 858 if (!i2c) {
869 ret = -ENOMEM; 859 ret = -ENOMEM;
870 goto emalloc; 860 goto emalloc;
871 } 861 }
872 862
873 memcpy(i2c, &i2c_pxa, sizeof(struct pxa_i2c)); 863 i2c->adap.owner = THIS_MODULE;
864 i2c->adap.algo = &i2c_pxa_algorithm;
865 i2c->adap.retries = 5;
866
867 spin_lock_init(&i2c->lock);
874 init_waitqueue_head(&i2c->wait); 868 init_waitqueue_head(&i2c->wait);
875 i2c->adap.name[strlen(i2c->adap.name) - 1] = '0' + dev->id % 10; 869
870 sprintf(i2c->adap.name, "pxa_i2c-i2c.%u", dev->id);
876 871
877 i2c->reg_base = ioremap(res->start, res_len(res)); 872 i2c->reg_base = ioremap(res->start, res_len(res));
878 if (!i2c->reg_base) { 873 if (!i2c->reg_base) {
diff --git a/drivers/ieee1394/nodemgr.c b/drivers/ieee1394/nodemgr.c
index 835937e38529..81b3864d2ba7 100644
--- a/drivers/ieee1394/nodemgr.c
+++ b/drivers/ieee1394/nodemgr.c
@@ -976,7 +976,8 @@ static struct unit_directory *nodemgr_process_unit_directory
976 976
977 ud->ne = ne; 977 ud->ne = ne;
978 ud->ignore_driver = ignore_drivers; 978 ud->ignore_driver = ignore_drivers;
979 ud->address = ud_kv->offset + CSR1212_CONFIG_ROM_SPACE_BASE; 979 ud->address = ud_kv->offset + CSR1212_REGISTER_SPACE_BASE;
980 ud->directory_id = ud->address & 0xffffff;
980 ud->ud_kv = ud_kv; 981 ud->ud_kv = ud_kv;
981 ud->id = (*id)++; 982 ud->id = (*id)++;
982 983
@@ -1085,6 +1086,10 @@ static struct unit_directory *nodemgr_process_unit_directory
1085 1086
1086 break; 1087 break;
1087 1088
1089 case CSR1212_KV_ID_DIRECTORY_ID:
1090 ud->directory_id = kv->value.immediate;
1091 break;
1092
1088 default: 1093 default:
1089 break; 1094 break;
1090 } 1095 }
diff --git a/drivers/ieee1394/nodemgr.h b/drivers/ieee1394/nodemgr.h
index e7ac683c72c7..4530b29d941c 100644
--- a/drivers/ieee1394/nodemgr.h
+++ b/drivers/ieee1394/nodemgr.h
@@ -75,6 +75,7 @@ struct unit_directory {
75 struct csr1212_keyval *model_name_kv; 75 struct csr1212_keyval *model_name_kv;
76 quadlet_t specifier_id; 76 quadlet_t specifier_id;
77 quadlet_t version; 77 quadlet_t version;
78 quadlet_t directory_id;
78 79
79 unsigned int id; 80 unsigned int id;
80 81
diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c
index 875eadd5e8f5..3f873cc7e247 100644
--- a/drivers/ieee1394/sbp2.c
+++ b/drivers/ieee1394/sbp2.c
@@ -194,6 +194,27 @@ MODULE_PARM_DESC(workarounds, "Work around device bugs (default = 0"
194 ", override internal blacklist = " __stringify(SBP2_WORKAROUND_OVERRIDE) 194 ", override internal blacklist = " __stringify(SBP2_WORKAROUND_OVERRIDE)
195 ", or a combination)"); 195 ", or a combination)");
196 196
197/*
198 * This influences the format of the sysfs attribute
199 * /sys/bus/scsi/devices/.../ieee1394_id.
200 *
201 * The default format is like in older kernels: %016Lx:%d:%d
202 * It contains the target's EUI-64, a number given to the logical unit by
203 * the ieee1394 driver's nodemgr (starting at 0), and the LUN.
204 *
205 * The long format is: %016Lx:%06x:%04x
206 * It contains the target's EUI-64, the unit directory's directory_ID as per
207 * IEEE 1212 clause 7.7.19, and the LUN. This format comes closest to the
208 * format of SBP(-3) target port and logical unit identifier as per SAM (SCSI
209 * Architecture Model) rev.2 to 4 annex A. Therefore and because it is
210 * independent of the implementation of the ieee1394 nodemgr, the longer format
211 * is recommended for future use.
212 */
213static int sbp2_long_sysfs_ieee1394_id;
214module_param_named(long_ieee1394_id, sbp2_long_sysfs_ieee1394_id, bool, 0644);
215MODULE_PARM_DESC(long_ieee1394_id, "8+3+2 bytes format of ieee1394_id in sysfs "
216 "(default = backwards-compatible = N, SAM-conforming = Y)");
217
197 218
198#define SBP2_INFO(fmt, args...) HPSB_INFO("sbp2: "fmt, ## args) 219#define SBP2_INFO(fmt, args...) HPSB_INFO("sbp2: "fmt, ## args)
199#define SBP2_ERR(fmt, args...) HPSB_ERR("sbp2: "fmt, ## args) 220#define SBP2_ERR(fmt, args...) HPSB_ERR("sbp2: "fmt, ## args)
@@ -2100,8 +2121,14 @@ static ssize_t sbp2_sysfs_ieee1394_id_show(struct device *dev,
2100 if (!(lu = (struct sbp2_lu *)sdev->host->hostdata[0])) 2121 if (!(lu = (struct sbp2_lu *)sdev->host->hostdata[0]))
2101 return 0; 2122 return 0;
2102 2123
2103 return sprintf(buf, "%016Lx:%d:%d\n", (unsigned long long)lu->ne->guid, 2124 if (sbp2_long_sysfs_ieee1394_id)
2104 lu->ud->id, ORB_SET_LUN(lu->lun)); 2125 return sprintf(buf, "%016Lx:%06x:%04x\n",
2126 (unsigned long long)lu->ne->guid,
2127 lu->ud->directory_id, ORB_SET_LUN(lu->lun));
2128 else
2129 return sprintf(buf, "%016Lx:%d:%d\n",
2130 (unsigned long long)lu->ne->guid,
2131 lu->ud->id, ORB_SET_LUN(lu->lun));
2105} 2132}
2106 2133
2107MODULE_AUTHOR("Ben Collins <bcollins@debian.org>"); 2134MODULE_AUTHOR("Ben Collins <bcollins@debian.org>");
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c
index b234729706be..be6b93c20f60 100644
--- a/drivers/input/evdev.c
+++ b/drivers/input/evdev.c
@@ -699,9 +699,9 @@ static void evdev_disconnect(struct input_handle *handle)
699 if (evdev->open) { 699 if (evdev->open) {
700 input_flush_device(handle, NULL); 700 input_flush_device(handle, NULL);
701 input_close_device(handle); 701 input_close_device(handle);
702 wake_up_interruptible(&evdev->wait);
703 list_for_each_entry(client, &evdev->client_list, node) 702 list_for_each_entry(client, &evdev->client_list, node)
704 kill_fasync(&client->fasync, SIGIO, POLL_HUP); 703 kill_fasync(&client->fasync, SIGIO, POLL_HUP);
704 wake_up_interruptible(&evdev->wait);
705 } else 705 } else
706 evdev_free(evdev); 706 evdev_free(evdev);
707} 707}
diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c
index 06f0541b24da..10e3b7bc925f 100644
--- a/drivers/input/joydev.c
+++ b/drivers/input/joydev.c
@@ -594,9 +594,9 @@ static void joydev_disconnect(struct input_handle *handle)
594 594
595 if (joydev->open) { 595 if (joydev->open) {
596 input_close_device(handle); 596 input_close_device(handle);
597 wake_up_interruptible(&joydev->wait);
598 list_for_each_entry(client, &joydev->client_list, node) 597 list_for_each_entry(client, &joydev->client_list, node)
599 kill_fasync(&client->fasync, SIGIO, POLL_HUP); 598 kill_fasync(&client->fasync, SIGIO, POLL_HUP);
599 wake_up_interruptible(&joydev->wait);
600 } else 600 } else
601 joydev_free(joydev); 601 joydev_free(joydev);
602} 602}
diff --git a/drivers/input/joystick/db9.c b/drivers/input/joystick/db9.c
index 86ad1027e12a..b069ee18e353 100644
--- a/drivers/input/joystick/db9.c
+++ b/drivers/input/joystick/db9.c
@@ -54,7 +54,7 @@ static struct db9_config db9_cfg[DB9_MAX_PORTS] __initdata;
54 54
55module_param_array_named(dev, db9_cfg[0].args, int, &db9_cfg[0].nargs, 0); 55module_param_array_named(dev, db9_cfg[0].args, int, &db9_cfg[0].nargs, 0);
56MODULE_PARM_DESC(dev, "Describes first attached device (<parport#>,<type>)"); 56MODULE_PARM_DESC(dev, "Describes first attached device (<parport#>,<type>)");
57module_param_array_named(dev2, db9_cfg[1].args, int, &db9_cfg[0].nargs, 0); 57module_param_array_named(dev2, db9_cfg[1].args, int, &db9_cfg[1].nargs, 0);
58MODULE_PARM_DESC(dev2, "Describes second attached device (<parport#>,<type>)"); 58MODULE_PARM_DESC(dev2, "Describes second attached device (<parport#>,<type>)");
59module_param_array_named(dev3, db9_cfg[2].args, int, &db9_cfg[2].nargs, 0); 59module_param_array_named(dev3, db9_cfg[2].args, int, &db9_cfg[2].nargs, 0);
60MODULE_PARM_DESC(dev3, "Describes third attached device (<parport#>,<type>)"); 60MODULE_PARM_DESC(dev3, "Describes third attached device (<parport#>,<type>)");
diff --git a/drivers/input/mouse/Kconfig b/drivers/input/mouse/Kconfig
index eb0167e9f0cb..50e06e8dd05d 100644
--- a/drivers/input/mouse/Kconfig
+++ b/drivers/input/mouse/Kconfig
@@ -48,7 +48,7 @@ config MOUSE_PS2_ALPS
48 If unsure, say Y. 48 If unsure, say Y.
49 49
50config MOUSE_PS2_LOGIPS2PP 50config MOUSE_PS2_LOGIPS2PP
51 bool "Logictech PS/2++ mouse protocol extension" if EMBEDDED 51 bool "Logitech PS/2++ mouse protocol extension" if EMBEDDED
52 default y 52 default y
53 depends on MOUSE_PS2 53 depends on MOUSE_PS2
54 help 54 help
diff --git a/drivers/input/mousedev.c b/drivers/input/mousedev.c
index 8675f9509393..3f4866d8d18c 100644
--- a/drivers/input/mousedev.c
+++ b/drivers/input/mousedev.c
@@ -766,9 +766,9 @@ static void mousedev_disconnect(struct input_handle *handle)
766 766
767 if (mousedev->open) { 767 if (mousedev->open) {
768 input_close_device(handle); 768 input_close_device(handle);
769 wake_up_interruptible(&mousedev->wait);
770 list_for_each_entry(client, &mousedev->client_list, node) 769 list_for_each_entry(client, &mousedev->client_list, node)
771 kill_fasync(&client->fasync, SIGIO, POLL_HUP); 770 kill_fasync(&client->fasync, SIGIO, POLL_HUP);
771 wake_up_interruptible(&mousedev->wait);
772 } else 772 } else
773 mousedev_free(mousedev); 773 mousedev_free(mousedev);
774} 774}
diff --git a/drivers/input/serio/sa1111ps2.c b/drivers/input/serio/sa1111ps2.c
index 559508795af1..d31ece8f68e9 100644
--- a/drivers/input/serio/sa1111ps2.c
+++ b/drivers/input/serio/sa1111ps2.c
@@ -170,7 +170,7 @@ static void ps2_close(struct serio *io)
170/* 170/*
171 * Clear the input buffer. 171 * Clear the input buffer.
172 */ 172 */
173static void __init ps2_clear_input(struct ps2if *ps2if) 173static void __devinit ps2_clear_input(struct ps2if *ps2if)
174{ 174{
175 int maxread = 100; 175 int maxread = 100;
176 176
@@ -228,7 +228,7 @@ static int __init ps2_test(struct ps2if *ps2if)
228/* 228/*
229 * Add one device to this driver. 229 * Add one device to this driver.
230 */ 230 */
231static int ps2_probe(struct sa1111_dev *dev) 231static int __devinit ps2_probe(struct sa1111_dev *dev)
232{ 232{
233 struct ps2if *ps2if; 233 struct ps2if *ps2if;
234 struct serio *serio; 234 struct serio *serio;
diff --git a/drivers/input/tsdev.c b/drivers/input/tsdev.c
index 8238b13874c2..2db364898e15 100644
--- a/drivers/input/tsdev.c
+++ b/drivers/input/tsdev.c
@@ -476,9 +476,9 @@ static void tsdev_disconnect(struct input_handle *handle)
476 476
477 if (tsdev->open) { 477 if (tsdev->open) {
478 input_close_device(handle); 478 input_close_device(handle);
479 wake_up_interruptible(&tsdev->wait);
480 list_for_each_entry(client, &tsdev->client_list, node) 479 list_for_each_entry(client, &tsdev->client_list, node)
481 kill_fasync(&client->fasync, SIGIO, POLL_HUP); 480 kill_fasync(&client->fasync, SIGIO, POLL_HUP);
481 wake_up_interruptible(&tsdev->wait);
482 } else 482 } else
483 tsdev_free(tsdev); 483 tsdev_free(tsdev);
484} 484}
diff --git a/drivers/isdn/Kconfig b/drivers/isdn/Kconfig
index d42fe89cddf6..3e088c42b222 100644
--- a/drivers/isdn/Kconfig
+++ b/drivers/isdn/Kconfig
@@ -26,9 +26,9 @@ menu "Old ISDN4Linux"
26 depends on NET && ISDN 26 depends on NET && ISDN
27 27
28config ISDN_I4L 28config ISDN_I4L
29 tristate "Old ISDN4Linux (obsolete)" 29 tristate "Old ISDN4Linux (deprecated)"
30 ---help--- 30 ---help---
31 This driver allows you to use an ISDN-card for networking 31 This driver allows you to use an ISDN adapter for networking
32 connections and as dialin/out device. The isdn-tty's have a built 32 connections and as dialin/out device. The isdn-tty's have a built
33 in AT-compatible modem emulator. Network devices support autodial, 33 in AT-compatible modem emulator. Network devices support autodial,
34 channel-bundling, callback and caller-authentication without having 34 channel-bundling, callback and caller-authentication without having
@@ -39,8 +39,9 @@ config ISDN_I4L
39 39
40 ISDN support in the linux kernel is moving towards a new API, 40 ISDN support in the linux kernel is moving towards a new API,
41 called CAPI (Common ISDN Application Programming Interface). 41 called CAPI (Common ISDN Application Programming Interface).
42 Therefore the old ISDN4Linux layer is becoming obsolete. It is 42 Therefore the old ISDN4Linux layer will eventually become obsolete.
43 still usable, though, if you select this option. 43 It is still available, though, for use with adapters that are not
44 supported by the new CAPI subsystem yet.
44 45
45if ISDN_I4L 46if ISDN_I4L
46source "drivers/isdn/i4l/Kconfig" 47source "drivers/isdn/i4l/Kconfig"
diff --git a/drivers/isdn/hardware/eicon/diva_didd.c b/drivers/isdn/hardware/eicon/diva_didd.c
index 14298b8c835f..d755d904e62c 100644
--- a/drivers/isdn/hardware/eicon/diva_didd.c
+++ b/drivers/isdn/hardware/eicon/diva_didd.c
@@ -99,7 +99,7 @@ static int DIVA_INIT_FUNCTION create_proc(void)
99 return (0); 99 return (0);
100} 100}
101 101
102static void DIVA_EXIT_FUNCTION remove_proc(void) 102static void remove_proc(void)
103{ 103{
104 remove_proc_entry(DRIVERLNAME, proc_net_eicon); 104 remove_proc_entry(DRIVERLNAME, proc_net_eicon);
105 remove_proc_entry("net/eicon", NULL); 105 remove_proc_entry("net/eicon", NULL);
diff --git a/drivers/isdn/hardware/eicon/divasfunc.c b/drivers/isdn/hardware/eicon/divasfunc.c
index df61e510a28b..46fc21a3f8ff 100644
--- a/drivers/isdn/hardware/eicon/divasfunc.c
+++ b/drivers/isdn/hardware/eicon/divasfunc.c
@@ -231,7 +231,7 @@ int DIVA_INIT_FUNCTION divasfunc_init(int dbgmask)
231/* 231/*
232 * exit 232 * exit
233 */ 233 */
234void DIVA_EXIT_FUNCTION divasfunc_exit(void) 234void divasfunc_exit(void)
235{ 235{
236 divasa_xdi_driver_unload(); 236 divasa_xdi_driver_unload();
237 disconnect_didd(); 237 disconnect_didd();
diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c
index ea5f30d4a5a2..4e5f87c1e714 100644
--- a/drivers/isdn/i4l/isdn_tty.c
+++ b/drivers/isdn/i4l/isdn_tty.c
@@ -2693,8 +2693,9 @@ isdn_tty_getdial(char *p, char *q,int cnt)
2693 int limit = ISDN_MSNLEN - 1; /* MUST match the size of interface var to avoid 2693 int limit = ISDN_MSNLEN - 1; /* MUST match the size of interface var to avoid
2694 buffer overflow */ 2694 buffer overflow */
2695 2695
2696 while (strchr(" 0123456789,#.*WPTS-", *p) && *p && --cnt>0) { 2696 while (strchr(" 0123456789,#.*WPTSR-", *p) && *p && --cnt>0) {
2697 if ((*p >= '0' && *p <= '9') || ((*p == 'S') && first) || 2697 if ((*p >= '0' && *p <= '9') || ((*p == 'S') && first) ||
2698 ((*p == 'R') && first) ||
2698 (*p == '*') || (*p == '#')) { 2699 (*p == '*') || (*p == '#')) {
2699 *q++ = *p; 2700 *q++ = *p;
2700 limit--; 2701 limit--;
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c
index e6e4d240b2a6..184238e2ece4 100644
--- a/drivers/kvm/vmx.c
+++ b/drivers/kvm/vmx.c
@@ -639,7 +639,7 @@ static void free_vmcs(struct vmcs *vmcs)
639 free_pages((unsigned long)vmcs, vmcs_descriptor.order); 639 free_pages((unsigned long)vmcs, vmcs_descriptor.order);
640} 640}
641 641
642static __exit void free_kvm_area(void) 642static void free_kvm_area(void)
643{ 643{
644 int cpu; 644 int cpu;
645 645
diff --git a/drivers/macintosh/Kconfig b/drivers/macintosh/Kconfig
index f44c94abd883..ee699a7d6214 100644
--- a/drivers/macintosh/Kconfig
+++ b/drivers/macintosh/Kconfig
@@ -114,7 +114,7 @@ config PMAC_SMU
114config PMAC_APM_EMU 114config PMAC_APM_EMU
115 tristate "APM emulation" 115 tristate "APM emulation"
116 select APM_EMULATION 116 select APM_EMULATION
117 depends on ADB_PMU && PM 117 depends on ADB_PMU && PM && PPC32
118 118
119config PMAC_MEDIABAY 119config PMAC_MEDIABAY
120 bool "Support PowerBook hotswap media bay" 120 bool "Support PowerBook hotswap media bay"
diff --git a/drivers/mfd/ucb1x00-ts.c b/drivers/mfd/ucb1x00-ts.c
index 7772bd1d92b4..38e815a2e871 100644
--- a/drivers/mfd/ucb1x00-ts.c
+++ b/drivers/mfd/ucb1x00-ts.c
@@ -291,7 +291,7 @@ static void ucb1x00_ts_irq(int idx, void *id)
291 291
292static int ucb1x00_ts_open(struct input_dev *idev) 292static int ucb1x00_ts_open(struct input_dev *idev)
293{ 293{
294 struct ucb1x00_ts *ts = idev->private; 294 struct ucb1x00_ts *ts = input_get_drvdata(idev);
295 int ret = 0; 295 int ret = 0;
296 296
297 BUG_ON(ts->rtask); 297 BUG_ON(ts->rtask);
@@ -328,7 +328,7 @@ static int ucb1x00_ts_open(struct input_dev *idev)
328 */ 328 */
329static void ucb1x00_ts_close(struct input_dev *idev) 329static void ucb1x00_ts_close(struct input_dev *idev)
330{ 330{
331 struct ucb1x00_ts *ts = idev->private; 331 struct ucb1x00_ts *ts = input_get_drvdata(idev);
332 332
333 if (ts->rtask) 333 if (ts->rtask)
334 kthread_stop(ts->rtask); 334 kthread_stop(ts->rtask);
@@ -380,7 +380,6 @@ static int ucb1x00_ts_add(struct ucb1x00_dev *dev)
380 ts->idev = idev; 380 ts->idev = idev;
381 ts->adcsync = adcsync ? UCB_SYNC : UCB_NOSYNC; 381 ts->adcsync = adcsync ? UCB_SYNC : UCB_NOSYNC;
382 382
383 idev->private = ts;
384 idev->name = "Touchscreen panel"; 383 idev->name = "Touchscreen panel";
385 idev->id.product = ts->ucb->id; 384 idev->id.product = ts->ucb->id;
386 idev->open = ucb1x00_ts_open; 385 idev->open = ucb1x00_ts_open;
@@ -391,6 +390,8 @@ static int ucb1x00_ts_add(struct ucb1x00_dev *dev)
391 __set_bit(ABS_Y, idev->absbit); 390 __set_bit(ABS_Y, idev->absbit);
392 __set_bit(ABS_PRESSURE, idev->absbit); 391 __set_bit(ABS_PRESSURE, idev->absbit);
393 392
393 input_set_drvdata(idev, ts);
394
394 err = input_register_device(idev); 395 err = input_register_device(idev);
395 if (err) 396 if (err)
396 goto fail; 397 goto fail;
diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c
index 6c36a55cb3d1..95c0b96e83f2 100644
--- a/drivers/misc/thinkpad_acpi.c
+++ b/drivers/misc/thinkpad_acpi.c
@@ -740,7 +740,7 @@ static ssize_t hotkey_enable_store(struct device *dev,
740} 740}
741 741
742static struct device_attribute dev_attr_hotkey_enable = 742static struct device_attribute dev_attr_hotkey_enable =
743 __ATTR(enable, S_IWUSR | S_IRUGO, 743 __ATTR(hotkey_enable, S_IWUSR | S_IRUGO,
744 hotkey_enable_show, hotkey_enable_store); 744 hotkey_enable_show, hotkey_enable_store);
745 745
746/* sysfs hotkey mask --------------------------------------------------- */ 746/* sysfs hotkey mask --------------------------------------------------- */
@@ -775,7 +775,7 @@ static ssize_t hotkey_mask_store(struct device *dev,
775} 775}
776 776
777static struct device_attribute dev_attr_hotkey_mask = 777static struct device_attribute dev_attr_hotkey_mask =
778 __ATTR(mask, S_IWUSR | S_IRUGO, 778 __ATTR(hotkey_mask, S_IWUSR | S_IRUGO,
779 hotkey_mask_show, hotkey_mask_store); 779 hotkey_mask_show, hotkey_mask_store);
780 780
781/* sysfs hotkey bios_enabled ------------------------------------------- */ 781/* sysfs hotkey bios_enabled ------------------------------------------- */
@@ -787,7 +787,7 @@ static ssize_t hotkey_bios_enabled_show(struct device *dev,
787} 787}
788 788
789static struct device_attribute dev_attr_hotkey_bios_enabled = 789static struct device_attribute dev_attr_hotkey_bios_enabled =
790 __ATTR(bios_enabled, S_IRUGO, hotkey_bios_enabled_show, NULL); 790 __ATTR(hotkey_bios_enabled, S_IRUGO, hotkey_bios_enabled_show, NULL);
791 791
792/* sysfs hotkey bios_mask ---------------------------------------------- */ 792/* sysfs hotkey bios_mask ---------------------------------------------- */
793static ssize_t hotkey_bios_mask_show(struct device *dev, 793static ssize_t hotkey_bios_mask_show(struct device *dev,
@@ -798,7 +798,7 @@ static ssize_t hotkey_bios_mask_show(struct device *dev,
798} 798}
799 799
800static struct device_attribute dev_attr_hotkey_bios_mask = 800static struct device_attribute dev_attr_hotkey_bios_mask =
801 __ATTR(bios_mask, S_IRUGO, hotkey_bios_mask_show, NULL); 801 __ATTR(hotkey_bios_mask, S_IRUGO, hotkey_bios_mask_show, NULL);
802 802
803/* --------------------------------------------------------------------- */ 803/* --------------------------------------------------------------------- */
804 804
@@ -824,8 +824,7 @@ static int __init hotkey_init(struct ibm_init_struct *iibm)
824 str_supported(tp_features.hotkey)); 824 str_supported(tp_features.hotkey));
825 825
826 if (tp_features.hotkey) { 826 if (tp_features.hotkey) {
827 hotkey_dev_attributes = create_attr_set(4, 827 hotkey_dev_attributes = create_attr_set(4, NULL);
828 TPACPI_HOTKEY_SYSFS_GROUP);
829 if (!hotkey_dev_attributes) 828 if (!hotkey_dev_attributes)
830 return -ENOMEM; 829 return -ENOMEM;
831 res = add_to_attr_set(hotkey_dev_attributes, 830 res = add_to_attr_set(hotkey_dev_attributes,
@@ -1050,7 +1049,7 @@ static ssize_t bluetooth_enable_store(struct device *dev,
1050} 1049}
1051 1050
1052static struct device_attribute dev_attr_bluetooth_enable = 1051static struct device_attribute dev_attr_bluetooth_enable =
1053 __ATTR(enable, S_IWUSR | S_IRUGO, 1052 __ATTR(bluetooth_enable, S_IWUSR | S_IRUGO,
1054 bluetooth_enable_show, bluetooth_enable_store); 1053 bluetooth_enable_show, bluetooth_enable_store);
1055 1054
1056/* --------------------------------------------------------------------- */ 1055/* --------------------------------------------------------------------- */
@@ -1061,7 +1060,6 @@ static struct attribute *bluetooth_attributes[] = {
1061}; 1060};
1062 1061
1063static const struct attribute_group bluetooth_attr_group = { 1062static const struct attribute_group bluetooth_attr_group = {
1064 .name = TPACPI_BLUETH_SYSFS_GROUP,
1065 .attrs = bluetooth_attributes, 1063 .attrs = bluetooth_attributes,
1066}; 1064};
1067 1065
@@ -1215,7 +1213,7 @@ static ssize_t wan_enable_store(struct device *dev,
1215} 1213}
1216 1214
1217static struct device_attribute dev_attr_wan_enable = 1215static struct device_attribute dev_attr_wan_enable =
1218 __ATTR(enable, S_IWUSR | S_IRUGO, 1216 __ATTR(wwan_enable, S_IWUSR | S_IRUGO,
1219 wan_enable_show, wan_enable_store); 1217 wan_enable_show, wan_enable_store);
1220 1218
1221/* --------------------------------------------------------------------- */ 1219/* --------------------------------------------------------------------- */
@@ -1226,7 +1224,6 @@ static struct attribute *wan_attributes[] = {
1226}; 1224};
1227 1225
1228static const struct attribute_group wan_attr_group = { 1226static const struct attribute_group wan_attr_group = {
1229 .name = TPACPI_WAN_SYSFS_GROUP,
1230 .attrs = wan_attributes, 1227 .attrs = wan_attributes,
1231}; 1228};
1232 1229
diff --git a/drivers/misc/thinkpad_acpi.h b/drivers/misc/thinkpad_acpi.h
index 440145a02617..72d62f2dabb9 100644
--- a/drivers/misc/thinkpad_acpi.h
+++ b/drivers/misc/thinkpad_acpi.h
@@ -278,8 +278,6 @@ static int beep_write(char *buf);
278 * Bluetooth subdriver 278 * Bluetooth subdriver
279 */ 279 */
280 280
281#define TPACPI_BLUETH_SYSFS_GROUP "bluetooth"
282
283enum { 281enum {
284 /* ACPI GBDC/SBDC bits */ 282 /* ACPI GBDC/SBDC bits */
285 TP_ACPI_BLUETOOTH_HWPRESENT = 0x01, /* Bluetooth hw available */ 283 TP_ACPI_BLUETOOTH_HWPRESENT = 0x01, /* Bluetooth hw available */
@@ -416,8 +414,6 @@ static int fan_write_cmd_watchdog(const char *cmd, int *rc);
416 * Hotkey subdriver 414 * Hotkey subdriver
417 */ 415 */
418 416
419#define TPACPI_HOTKEY_SYSFS_GROUP "hotkey"
420
421static int hotkey_orig_status; 417static int hotkey_orig_status;
422static int hotkey_orig_mask; 418static int hotkey_orig_mask;
423 419
@@ -553,8 +549,6 @@ static int volume_write(char *buf);
553 * Wan subdriver 549 * Wan subdriver
554 */ 550 */
555 551
556#define TPACPI_WAN_SYSFS_GROUP "wwan"
557
558enum { 552enum {
559 /* ACPI GWAN/SWAN bits */ 553 /* ACPI GWAN/SWAN bits */
560 TP_ACPI_WANCARD_HWPRESENT = 0x01, /* Wan hw available */ 554 TP_ACPI_WANCARD_HWPRESENT = 0x01, /* Wan hw available */
diff --git a/drivers/misc/tifm_7xx1.c b/drivers/misc/tifm_7xx1.c
index c08ad8f823d2..2d1b3df95c5b 100644
--- a/drivers/misc/tifm_7xx1.c
+++ b/drivers/misc/tifm_7xx1.c
@@ -343,7 +343,7 @@ static int tifm_7xx1_probe(struct pci_dev *dev,
343 if (!fm->addr) 343 if (!fm->addr)
344 goto err_out_free; 344 goto err_out_free;
345 345
346 rc = request_irq(dev->irq, tifm_7xx1_isr, SA_SHIRQ, DRIVER_NAME, fm); 346 rc = request_irq(dev->irq, tifm_7xx1_isr, IRQF_SHARED, DRIVER_NAME, fm);
347 if (rc) 347 if (rc)
348 goto err_out_unmap; 348 goto err_out_unmap;
349 349
diff --git a/drivers/mtd/devices/pmc551.c b/drivers/mtd/devices/pmc551.c
index a4873ab84e6b..e8f686f7a357 100644
--- a/drivers/mtd/devices/pmc551.c
+++ b/drivers/mtd/devices/pmc551.c
@@ -650,7 +650,7 @@ MODULE_DESCRIPTION(PMC551_VERSION);
650 */ 650 */
651static int msize = 0; 651static int msize = 0;
652#if defined(CONFIG_MTD_PMC551_APERTURE_SIZE) 652#if defined(CONFIG_MTD_PMC551_APERTURE_SIZE)
653static int asize = CONFIG_MTD_PMC551_APERTURE_SIZE 653static int asize = CONFIG_MTD_PMC551_APERTURE_SIZE;
654#else 654#else
655static int asize = 0; 655static int asize = 0;
656#endif 656#endif
diff --git a/drivers/mtd/nand/autcpu12.c b/drivers/mtd/nand/autcpu12.c
index fe94ae9ae1f2..e3744eb8eccb 100644
--- a/drivers/mtd/nand/autcpu12.c
+++ b/drivers/mtd/nand/autcpu12.c
@@ -101,7 +101,7 @@ static void autcpu12_hwcontrol(struct mtd_info *mtd, int cmd,
101 struct nand_chip *chip = mtd->priv; 101 struct nand_chip *chip = mtd->priv;
102 102
103 if (ctrl & NAND_CTRL_CHANGE) { 103 if (ctrl & NAND_CTRL_CHANGE) {
104 void __iomem *addr 104 void __iomem *addr;
105 unsigned char bits; 105 unsigned char bits;
106 106
107 addr = CS89712_VIRT_BASE + AUTCPU12_SMC_PORT_OFFSET; 107 addr = CS89712_VIRT_BASE + AUTCPU12_SMC_PORT_OFFSET;
diff --git a/drivers/mtd/nand/ppchameleonevb.c b/drivers/mtd/nand/ppchameleonevb.c
index eb7d4d443deb..082073acf20f 100644
--- a/drivers/mtd/nand/ppchameleonevb.c
+++ b/drivers/mtd/nand/ppchameleonevb.c
@@ -81,7 +81,7 @@ __setup("ppchameleonevb_fio_pbase=", ppchameleonevb_fio_pbase);
81 */ 81 */
82static struct mtd_partition partition_info_hi[] = { 82static struct mtd_partition partition_info_hi[] = {
83 { .name = "PPChameleon HI Nand Flash", 83 { .name = "PPChameleon HI Nand Flash",
84 offset = 0, 84 .offset = 0,
85 .size = 128 * 1024 * 1024 85 .size = 128 * 1024 * 1024
86 } 86 }
87}; 87};
@@ -424,9 +424,9 @@ static void __exit ppchameleonevb_cleanup(void)
424 424
425 /* Release iomaps */ 425 /* Release iomaps */
426 this = (struct nand_chip *) &ppchameleon_mtd[1]; 426 this = (struct nand_chip *) &ppchameleon_mtd[1];
427 iounmap((void *) this->IO_ADDR_R; 427 iounmap((void *) this->IO_ADDR_R);
428 this = (struct nand_chip *) &ppchameleonevb_mtd[1]; 428 this = (struct nand_chip *) &ppchameleonevb_mtd[1];
429 iounmap((void *) this->IO_ADDR_R; 429 iounmap((void *) this->IO_ADDR_R);
430 430
431 /* Free the MTD device structure */ 431 /* Free the MTD device structure */
432 kfree (ppchameleon_mtd); 432 kfree (ppchameleon_mtd);
diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c
index e8c9f27817b0..a804965e6542 100644
--- a/drivers/net/8139cp.c
+++ b/drivers/net/8139cp.c
@@ -435,20 +435,12 @@ static void cp_vlan_rx_register(struct net_device *dev, struct vlan_group *grp)
435 435
436 spin_lock_irqsave(&cp->lock, flags); 436 spin_lock_irqsave(&cp->lock, flags);
437 cp->vlgrp = grp; 437 cp->vlgrp = grp;
438 cp->cpcmd |= RxVlanOn; 438 if (grp)
439 cpw16(CpCmd, cp->cpcmd); 439 cp->cpcmd |= RxVlanOn;
440 spin_unlock_irqrestore(&cp->lock, flags); 440 else
441} 441 cp->cpcmd &= ~RxVlanOn;
442
443static void cp_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
444{
445 struct cp_private *cp = netdev_priv(dev);
446 unsigned long flags;
447 442
448 spin_lock_irqsave(&cp->lock, flags);
449 cp->cpcmd &= ~RxVlanOn;
450 cpw16(CpCmd, cp->cpcmd); 443 cpw16(CpCmd, cp->cpcmd);
451 vlan_group_set_device(cp->vlgrp, vid, NULL);
452 spin_unlock_irqrestore(&cp->lock, flags); 444 spin_unlock_irqrestore(&cp->lock, flags);
453} 445}
454#endif /* CP_VLAN_TAG_USED */ 446#endif /* CP_VLAN_TAG_USED */
@@ -1944,7 +1936,6 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
1944#if CP_VLAN_TAG_USED 1936#if CP_VLAN_TAG_USED
1945 dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; 1937 dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
1946 dev->vlan_rx_register = cp_vlan_rx_register; 1938 dev->vlan_rx_register = cp_vlan_rx_register;
1947 dev->vlan_rx_kill_vid = cp_vlan_rx_kill_vid;
1948#endif 1939#endif
1949 1940
1950 if (pci_using_dac) 1941 if (pci_using_dac)
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 1798a9f9fb25..7d57f4a25dc1 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -2280,6 +2280,7 @@ config GFAR_NAPI
2280config UCC_GETH 2280config UCC_GETH
2281 tristate "Freescale QE Gigabit Ethernet" 2281 tristate "Freescale QE Gigabit Ethernet"
2282 depends on QUICC_ENGINE 2282 depends on QUICC_ENGINE
2283 select PHYLIB
2283 help 2284 help
2284 This driver supports the Gigabit Ethernet mode of the QUICC Engine, 2285 This driver supports the Gigabit Ethernet mode of the QUICC Engine,
2285 which is available on some Freescale SOCs. 2286 which is available on some Freescale SOCs.
diff --git a/drivers/net/acenic.c b/drivers/net/acenic.c
index 7122b7ba8d61..04382f979c99 100644
--- a/drivers/net/acenic.c
+++ b/drivers/net/acenic.c
@@ -480,12 +480,10 @@ static int __devinit acenic_probe_one(struct pci_dev *pdev,
480#if ACENIC_DO_VLAN 480#if ACENIC_DO_VLAN
481 dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; 481 dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
482 dev->vlan_rx_register = ace_vlan_rx_register; 482 dev->vlan_rx_register = ace_vlan_rx_register;
483 dev->vlan_rx_kill_vid = ace_vlan_rx_kill_vid;
484#endif 483#endif
485 if (1) { 484
486 dev->tx_timeout = &ace_watchdog; 485 dev->tx_timeout = &ace_watchdog;
487 dev->watchdog_timeo = 5*HZ; 486 dev->watchdog_timeo = 5*HZ;
488 }
489 487
490 dev->open = &ace_open; 488 dev->open = &ace_open;
491 dev->stop = &ace_close; 489 dev->stop = &ace_close;
@@ -2283,19 +2281,6 @@ static void ace_vlan_rx_register(struct net_device *dev, struct vlan_group *grp)
2283 ace_unmask_irq(dev); 2281 ace_unmask_irq(dev);
2284 local_irq_restore(flags); 2282 local_irq_restore(flags);
2285} 2283}
2286
2287
2288static void ace_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
2289{
2290 struct ace_private *ap = netdev_priv(dev);
2291 unsigned long flags;
2292
2293 local_irq_save(flags);
2294 ace_mask_irq(dev);
2295 vlan_group_set_device(ap->vlgrp, vid, NULL);
2296 ace_unmask_irq(dev);
2297 local_irq_restore(flags);
2298}
2299#endif /* ACENIC_DO_VLAN */ 2284#endif /* ACENIC_DO_VLAN */
2300 2285
2301 2286
diff --git a/drivers/net/acenic.h b/drivers/net/acenic.h
index 8ca8534d70bf..60ed1837fa8f 100644
--- a/drivers/net/acenic.h
+++ b/drivers/net/acenic.h
@@ -787,7 +787,6 @@ static struct net_device_stats *ace_get_stats(struct net_device *dev);
787static int read_eeprom_byte(struct net_device *dev, unsigned long offset); 787static int read_eeprom_byte(struct net_device *dev, unsigned long offset);
788#if ACENIC_DO_VLAN 788#if ACENIC_DO_VLAN
789static void ace_vlan_rx_register(struct net_device *dev, struct vlan_group *grp); 789static void ace_vlan_rx_register(struct net_device *dev, struct vlan_group *grp);
790static void ace_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid);
791#endif 790#endif
792 791
793#endif /* _ACENIC_H_ */ 792#endif /* _ACENIC_H_ */
diff --git a/drivers/net/amd8111e.c b/drivers/net/amd8111e.c
index 675fe918421b..a61b2f89fc33 100644
--- a/drivers/net/amd8111e.c
+++ b/drivers/net/amd8111e.c
@@ -155,7 +155,7 @@ This function will write into PHY registers.
155*/ 155*/
156static int amd8111e_write_phy(struct amd8111e_priv* lp,int phy_id, int reg, u32 val) 156static int amd8111e_write_phy(struct amd8111e_priv* lp,int phy_id, int reg, u32 val)
157{ 157{
158 unsigned int repeat = REPEAT_CNT 158 unsigned int repeat = REPEAT_CNT;
159 void __iomem *mmio = lp->mmio; 159 void __iomem *mmio = lp->mmio;
160 unsigned int reg_val; 160 unsigned int reg_val;
161 161
@@ -1728,15 +1728,8 @@ static void amd8111e_vlan_rx_register(struct net_device *dev, struct vlan_group
1728 lp->vlgrp = grp; 1728 lp->vlgrp = grp;
1729 spin_unlock_irq(&lp->lock); 1729 spin_unlock_irq(&lp->lock);
1730} 1730}
1731
1732static void amd8111e_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
1733{
1734 struct amd8111e_priv *lp = netdev_priv(dev);
1735 spin_lock_irq(&lp->lock);
1736 vlan_group_set_device(lp->vlgrp, vid, NULL);
1737 spin_unlock_irq(&lp->lock);
1738}
1739#endif 1731#endif
1732
1740static int amd8111e_enable_magicpkt(struct amd8111e_priv* lp) 1733static int amd8111e_enable_magicpkt(struct amd8111e_priv* lp)
1741{ 1734{
1742 writel( VAL1|MPPLBA, lp->mmio + CMD3); 1735 writel( VAL1|MPPLBA, lp->mmio + CMD3);
@@ -1996,7 +1989,6 @@ static int __devinit amd8111e_probe_one(struct pci_dev *pdev,
1996#if AMD8111E_VLAN_TAG_USED 1989#if AMD8111E_VLAN_TAG_USED
1997 dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX ; 1990 dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX ;
1998 dev->vlan_rx_register =amd8111e_vlan_rx_register; 1991 dev->vlan_rx_register =amd8111e_vlan_rx_register;
1999 dev->vlan_rx_kill_vid = amd8111e_vlan_rx_kill_vid;
2000#endif 1992#endif
2001 1993
2002 lp = netdev_priv(dev); 1994 lp = netdev_priv(dev);
@@ -2049,7 +2041,6 @@ static int __devinit amd8111e_probe_one(struct pci_dev *pdev,
2049#if AMD8111E_VLAN_TAG_USED 2041#if AMD8111E_VLAN_TAG_USED
2050 dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; 2042 dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
2051 dev->vlan_rx_register =amd8111e_vlan_rx_register; 2043 dev->vlan_rx_register =amd8111e_vlan_rx_register;
2052 dev->vlan_rx_kill_vid = amd8111e_vlan_rx_kill_vid;
2053#endif 2044#endif
2054 /* Probe the external PHY */ 2045 /* Probe the external PHY */
2055 amd8111e_probe_ext_phy(dev); 2046 amd8111e_probe_ext_phy(dev);
diff --git a/drivers/net/amd8111e.h b/drivers/net/amd8111e.h
index 2007510c4eb6..e65080a5994a 100644
--- a/drivers/net/amd8111e.h
+++ b/drivers/net/amd8111e.h
@@ -615,7 +615,7 @@ typedef enum {
615#define SSTATE 2 615#define SSTATE 2
616 616
617/* Assume contoller gets data 10 times the maximum processing time */ 617/* Assume contoller gets data 10 times the maximum processing time */
618#define REPEAT_CNT 10; 618#define REPEAT_CNT 10
619 619
620/* amd8111e decriptor flag definitions */ 620/* amd8111e decriptor flag definitions */
621typedef enum { 621typedef enum {
diff --git a/drivers/net/atl1/atl1_main.c b/drivers/net/atl1/atl1_main.c
index 78cf00ff3d38..6862c11ff864 100644
--- a/drivers/net/atl1/atl1_main.c
+++ b/drivers/net/atl1/atl1_main.c
@@ -1229,39 +1229,9 @@ static void atl1_vlan_rx_register(struct net_device *netdev,
1229 spin_unlock_irqrestore(&adapter->lock, flags); 1229 spin_unlock_irqrestore(&adapter->lock, flags);
1230} 1230}
1231 1231
1232/* FIXME: justify or remove -- CHS */
1233static void atl1_vlan_rx_add_vid(struct net_device *netdev, u16 vid)
1234{
1235 /* We don't do Vlan filtering */
1236 return;
1237}
1238
1239/* FIXME: this looks wrong too -- CHS */
1240static void atl1_vlan_rx_kill_vid(struct net_device *netdev, u16 vid)
1241{
1242 struct atl1_adapter *adapter = netdev_priv(netdev);
1243 unsigned long flags;
1244
1245 spin_lock_irqsave(&adapter->lock, flags);
1246 /* atl1_irq_disable(adapter); */
1247 vlan_group_set_device(adapter->vlgrp, vid, NULL);
1248 /* atl1_irq_enable(adapter); */
1249 spin_unlock_irqrestore(&adapter->lock, flags);
1250 /* We don't do Vlan filtering */
1251 return;
1252}
1253
1254static void atl1_restore_vlan(struct atl1_adapter *adapter) 1232static void atl1_restore_vlan(struct atl1_adapter *adapter)
1255{ 1233{
1256 atl1_vlan_rx_register(adapter->netdev, adapter->vlgrp); 1234 atl1_vlan_rx_register(adapter->netdev, adapter->vlgrp);
1257 if (adapter->vlgrp) {
1258 u16 vid;
1259 for (vid = 0; vid < VLAN_GROUP_ARRAY_LEN; vid++) {
1260 if (!vlan_group_get_device(adapter->vlgrp, vid))
1261 continue;
1262 atl1_vlan_rx_add_vid(adapter->netdev, vid);
1263 }
1264 }
1265} 1235}
1266 1236
1267static u16 tpd_avail(struct atl1_tpd_ring *tpd_ring) 1237static u16 tpd_avail(struct atl1_tpd_ring *tpd_ring)
@@ -2203,8 +2173,7 @@ static int __devinit atl1_probe(struct pci_dev *pdev,
2203 netdev->poll_controller = atl1_poll_controller; 2173 netdev->poll_controller = atl1_poll_controller;
2204#endif 2174#endif
2205 netdev->vlan_rx_register = atl1_vlan_rx_register; 2175 netdev->vlan_rx_register = atl1_vlan_rx_register;
2206 netdev->vlan_rx_add_vid = atl1_vlan_rx_add_vid; 2176
2207 netdev->vlan_rx_kill_vid = atl1_vlan_rx_kill_vid;
2208 netdev->ethtool_ops = &atl1_ethtool_ops; 2177 netdev->ethtool_ops = &atl1_ethtool_ops;
2209 adapter->bd_number = cards_found; 2178 adapter->bd_number = cards_found;
2210 adapter->pci_using_64 = pci_using_64; 2179 adapter->pci_using_64 = pci_using_64;
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 88b33c6ddda8..da7c3b0c533c 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -4786,19 +4786,6 @@ bnx2_vlan_rx_register(struct net_device *dev, struct vlan_group *vlgrp)
4786 4786
4787 bnx2_netif_start(bp); 4787 bnx2_netif_start(bp);
4788} 4788}
4789
4790/* Called with rtnl_lock */
4791static void
4792bnx2_vlan_rx_kill_vid(struct net_device *dev, uint16_t vid)
4793{
4794 struct bnx2 *bp = netdev_priv(dev);
4795
4796 bnx2_netif_stop(bp);
4797 vlan_group_set_device(bp->vlgrp, vid, NULL);
4798 bnx2_set_rx_mode(dev);
4799
4800 bnx2_netif_start(bp);
4801}
4802#endif 4789#endif
4803 4790
4804/* Called with netif_tx_lock. 4791/* Called with netif_tx_lock.
@@ -6453,7 +6440,6 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
6453 dev->watchdog_timeo = TX_TIMEOUT; 6440 dev->watchdog_timeo = TX_TIMEOUT;
6454#ifdef BCM_VLAN 6441#ifdef BCM_VLAN
6455 dev->vlan_rx_register = bnx2_vlan_rx_register; 6442 dev->vlan_rx_register = bnx2_vlan_rx_register;
6456 dev->vlan_rx_kill_vid = bnx2_vlan_rx_kill_vid;
6457#endif 6443#endif
6458 dev->poll = bnx2_poll; 6444 dev->poll = bnx2_poll;
6459 dev->ethtool_ops = &bnx2_ethtool_ops; 6445 dev->ethtool_ops = &bnx2_ethtool_ops;
diff --git a/drivers/net/cassini.c b/drivers/net/cassini.c
index 9fe3a38883ee..59b9943b077d 100644
--- a/drivers/net/cassini.c
+++ b/drivers/net/cassini.c
@@ -4920,7 +4920,7 @@ static int __devinit cas_init_one(struct pci_dev *pdev,
4920 pci_cmd |= PCI_COMMAND_PARITY; 4920 pci_cmd |= PCI_COMMAND_PARITY;
4921 pci_write_config_word(pdev, PCI_COMMAND, pci_cmd); 4921 pci_write_config_word(pdev, PCI_COMMAND, pci_cmd);
4922 if (pci_set_mwi(pdev)) 4922 if (pci_set_mwi(pdev))
4923 printk(KERN_WARNING PFX "Could enable MWI for %s\n", 4923 printk(KERN_WARNING PFX "Could not enable MWI for %s\n",
4924 pci_name(pdev)); 4924 pci_name(pdev));
4925 4925
4926 /* 4926 /*
diff --git a/drivers/net/chelsio/cxgb2.c b/drivers/net/chelsio/cxgb2.c
index 125c9b105869..231ce43b97cf 100644
--- a/drivers/net/chelsio/cxgb2.c
+++ b/drivers/net/chelsio/cxgb2.c
@@ -883,15 +883,6 @@ static void vlan_rx_register(struct net_device *dev,
883 t1_set_vlan_accel(adapter, grp != NULL); 883 t1_set_vlan_accel(adapter, grp != NULL);
884 spin_unlock_irq(&adapter->async_lock); 884 spin_unlock_irq(&adapter->async_lock);
885} 885}
886
887static void vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
888{
889 struct adapter *adapter = dev->priv;
890
891 spin_lock_irq(&adapter->async_lock);
892 vlan_group_set_device(adapter->vlan_grp, vid, NULL);
893 spin_unlock_irq(&adapter->async_lock);
894}
895#endif 886#endif
896 887
897#ifdef CONFIG_NET_POLL_CONTROLLER 888#ifdef CONFIG_NET_POLL_CONTROLLER
@@ -1099,7 +1090,6 @@ static int __devinit init_one(struct pci_dev *pdev,
1099 netdev->features |= 1090 netdev->features |=
1100 NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; 1091 NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
1101 netdev->vlan_rx_register = vlan_rx_register; 1092 netdev->vlan_rx_register = vlan_rx_register;
1102 netdev->vlan_rx_kill_vid = vlan_rx_kill_vid;
1103#endif 1093#endif
1104 1094
1105 /* T204: disable TSO */ 1095 /* T204: disable TSO */
diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c
index 67b4b219d927..1b20f4060e2d 100644
--- a/drivers/net/cxgb3/cxgb3_main.c
+++ b/drivers/net/cxgb3/cxgb3_main.c
@@ -2067,11 +2067,6 @@ static void vlan_rx_register(struct net_device *dev, struct vlan_group *grp)
2067 t3_synchronize_rx(adapter, pi); 2067 t3_synchronize_rx(adapter, pi);
2068} 2068}
2069 2069
2070static void vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
2071{
2072 /* nothing */
2073}
2074
2075#ifdef CONFIG_NET_POLL_CONTROLLER 2070#ifdef CONFIG_NET_POLL_CONTROLLER
2076static void cxgb_netpoll(struct net_device *dev) 2071static void cxgb_netpoll(struct net_device *dev)
2077{ 2072{
@@ -2409,7 +2404,6 @@ static int __devinit init_one(struct pci_dev *pdev,
2409 2404
2410 netdev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; 2405 netdev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
2411 netdev->vlan_rx_register = vlan_rx_register; 2406 netdev->vlan_rx_register = vlan_rx_register;
2412 netdev->vlan_rx_kill_vid = vlan_rx_kill_vid;
2413 2407
2414 netdev->open = cxgb_open; 2408 netdev->open = cxgb_open;
2415 netdev->stop = cxgb_close; 2409 netdev->stop = cxgb_close;
diff --git a/drivers/net/defxx.c b/drivers/net/defxx.c
index 571d82f8008c..7df23dc28190 100644
--- a/drivers/net/defxx.c
+++ b/drivers/net/defxx.c
@@ -566,6 +566,7 @@ static int __devinit dfx_register(struct device *bdev)
566 bp->base.mem = ioremap_nocache(bar_start, bar_len); 566 bp->base.mem = ioremap_nocache(bar_start, bar_len);
567 if (!bp->base.mem) { 567 if (!bp->base.mem) {
568 printk(KERN_ERR "%s: Cannot map MMIO\n", print_name); 568 printk(KERN_ERR "%s: Cannot map MMIO\n", print_name);
569 err = -ENOMEM;
569 goto err_out_region; 570 goto err_out_region;
570 } 571 }
571 } else { 572 } else {
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index cbc7febe9cdc..cf8af928a69c 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -1142,13 +1142,16 @@ e1000_probe(struct pci_dev *pdev,
1142 !e1000_check_mng_mode(&adapter->hw)) 1142 !e1000_check_mng_mode(&adapter->hw))
1143 e1000_get_hw_control(adapter); 1143 e1000_get_hw_control(adapter);
1144 1144
1145 strcpy(netdev->name, "eth%d");
1146 if ((err = register_netdev(netdev)))
1147 goto err_register;
1148
1149 /* tell the stack to leave us alone until e1000_open() is called */ 1145 /* tell the stack to leave us alone until e1000_open() is called */
1150 netif_carrier_off(netdev); 1146 netif_carrier_off(netdev);
1151 netif_stop_queue(netdev); 1147 netif_stop_queue(netdev);
1148#ifdef CONFIG_E1000_NAPI
1149 netif_poll_disable(netdev);
1150#endif
1151
1152 strcpy(netdev->name, "eth%d");
1153 if ((err = register_netdev(netdev)))
1154 goto err_register;
1152 1155
1153 DPRINTK(PROBE, INFO, "Intel(R) PRO/1000 Network Connection\n"); 1156 DPRINTK(PROBE, INFO, "Intel(R) PRO/1000 Network Connection\n");
1154 1157
@@ -1325,7 +1328,10 @@ e1000_sw_init(struct e1000_adapter *adapter)
1325 spin_lock_init(&adapter->tx_queue_lock); 1328 spin_lock_init(&adapter->tx_queue_lock);
1326#endif 1329#endif
1327 1330
1328 atomic_set(&adapter->irq_sem, 1); 1331 /* Explicitly disable IRQ since the NIC can be in any state. */
1332 atomic_set(&adapter->irq_sem, 0);
1333 e1000_irq_disable(adapter);
1334
1329 spin_lock_init(&adapter->stats_lock); 1335 spin_lock_init(&adapter->stats_lock);
1330 1336
1331 set_bit(__E1000_DOWN, &adapter->flags); 1337 set_bit(__E1000_DOWN, &adapter->flags);
@@ -1431,6 +1437,10 @@ e1000_open(struct net_device *netdev)
1431 /* From here on the code is the same as e1000_up() */ 1437 /* From here on the code is the same as e1000_up() */
1432 clear_bit(__E1000_DOWN, &adapter->flags); 1438 clear_bit(__E1000_DOWN, &adapter->flags);
1433 1439
1440#ifdef CONFIG_E1000_NAPI
1441 netif_poll_enable(netdev);
1442#endif
1443
1434 e1000_irq_enable(adapter); 1444 e1000_irq_enable(adapter);
1435 1445
1436 /* fire a link status change interrupt to start the watchdog */ 1446 /* fire a link status change interrupt to start the watchdog */
diff --git a/drivers/net/ehea/ehea.h b/drivers/net/ehea/ehea.h
index 602872dbe15f..e85a933a4762 100644
--- a/drivers/net/ehea/ehea.h
+++ b/drivers/net/ehea/ehea.h
@@ -39,7 +39,7 @@
39#include <asm/io.h> 39#include <asm/io.h>
40 40
41#define DRV_NAME "ehea" 41#define DRV_NAME "ehea"
42#define DRV_VERSION "EHEA_0058" 42#define DRV_VERSION "EHEA_0061"
43 43
44#define EHEA_MSG_DEFAULT (NETIF_MSG_LINK | NETIF_MSG_TIMER \ 44#define EHEA_MSG_DEFAULT (NETIF_MSG_LINK | NETIF_MSG_TIMER \
45 | NETIF_MSG_RX_ERR | NETIF_MSG_TX_ERR) 45 | NETIF_MSG_RX_ERR | NETIF_MSG_TX_ERR)
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index f6e0cb1ada1f..152bb2016a2c 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -428,7 +428,7 @@ static struct ehea_cqe *ehea_proc_rwqes(struct net_device *dev,
428 } 428 }
429 skb_copy_to_linear_data(skb, ((char*)cqe) + 64, 429 skb_copy_to_linear_data(skb, ((char*)cqe) + 64,
430 cqe->num_bytes_transfered - 4); 430 cqe->num_bytes_transfered - 4);
431 ehea_fill_skb(dev, skb, cqe); 431 ehea_fill_skb(port->netdev, skb, cqe);
432 } else if (rq == 2) { /* RQ2 */ 432 } else if (rq == 2) { /* RQ2 */
433 skb = get_skb_by_index(skb_arr_rq2, 433 skb = get_skb_by_index(skb_arr_rq2,
434 skb_arr_rq2_len, cqe); 434 skb_arr_rq2_len, cqe);
diff --git a/drivers/net/fec_8xx/fec_main.c b/drivers/net/fec_8xx/fec_main.c
index 88efe9731bab..e5502af5b8e2 100644
--- a/drivers/net/fec_8xx/fec_main.c
+++ b/drivers/net/fec_8xx/fec_main.c
@@ -550,7 +550,7 @@ static int fec_enet_rx_common(struct net_device *dev, int *budget)
550 skbn = dev_alloc_skb(pkt_len + 2); 550 skbn = dev_alloc_skb(pkt_len + 2);
551 if (skbn != NULL) { 551 if (skbn != NULL) {
552 skb_reserve(skbn, 2); /* align IP header */ 552 skb_reserve(skbn, 2); /* align IP header */
553 skb_copy_from_linear_data(skb 553 skb_copy_from_linear_data(skb,
554 skbn->data, 554 skbn->data,
555 pkt_len); 555 pkt_len);
556 /* swap */ 556 /* swap */
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index 4154fd000746..32788ca40d25 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -4605,12 +4605,7 @@ static void nv_vlan_rx_register(struct net_device *dev, struct vlan_group *grp)
4605 writel(np->txrxctl_bits, get_hwbase(dev) + NvRegTxRxControl); 4605 writel(np->txrxctl_bits, get_hwbase(dev) + NvRegTxRxControl);
4606 4606
4607 spin_unlock_irq(&np->lock); 4607 spin_unlock_irq(&np->lock);
4608}; 4608}
4609
4610static void nv_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
4611{
4612 /* nothing to do */
4613};
4614 4609
4615/* The mgmt unit and driver use a semaphore to access the phy during init */ 4610/* The mgmt unit and driver use a semaphore to access the phy during init */
4616static int nv_mgmt_acquire_sema(struct net_device *dev) 4611static int nv_mgmt_acquire_sema(struct net_device *dev)
@@ -4956,7 +4951,6 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
4956 np->vlanctl_bits = NVREG_VLANCONTROL_ENABLE; 4951 np->vlanctl_bits = NVREG_VLANCONTROL_ENABLE;
4957 dev->features |= NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_TX; 4952 dev->features |= NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_TX;
4958 dev->vlan_rx_register = nv_vlan_rx_register; 4953 dev->vlan_rx_register = nv_vlan_rx_register;
4959 dev->vlan_rx_kill_vid = nv_vlan_rx_kill_vid;
4960 } 4954 }
4961 4955
4962 np->msi_flags = 0; 4956 np->msi_flags = 0;
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index f5b3cba23fc5..6822bf14267b 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -140,7 +140,6 @@ int gfar_clean_rx_ring(struct net_device *dev, int rx_work_limit);
140static int gfar_process_frame(struct net_device *dev, struct sk_buff *skb, int length); 140static int gfar_process_frame(struct net_device *dev, struct sk_buff *skb, int length);
141static void gfar_vlan_rx_register(struct net_device *netdev, 141static void gfar_vlan_rx_register(struct net_device *netdev,
142 struct vlan_group *grp); 142 struct vlan_group *grp);
143static void gfar_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid);
144void gfar_halt(struct net_device *dev); 143void gfar_halt(struct net_device *dev);
145void gfar_start(struct net_device *dev); 144void gfar_start(struct net_device *dev);
146static void gfar_clear_exact_match(struct net_device *dev); 145static void gfar_clear_exact_match(struct net_device *dev);
@@ -284,7 +283,6 @@ static int gfar_probe(struct platform_device *pdev)
284 283
285 if (priv->einfo->device_flags & FSL_GIANFAR_DEV_HAS_VLAN) { 284 if (priv->einfo->device_flags & FSL_GIANFAR_DEV_HAS_VLAN) {
286 dev->vlan_rx_register = gfar_vlan_rx_register; 285 dev->vlan_rx_register = gfar_vlan_rx_register;
287 dev->vlan_rx_kill_vid = gfar_vlan_rx_kill_vid;
288 286
289 dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; 287 dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
290 288
@@ -1133,20 +1131,6 @@ static void gfar_vlan_rx_register(struct net_device *dev,
1133 spin_unlock_irqrestore(&priv->rxlock, flags); 1131 spin_unlock_irqrestore(&priv->rxlock, flags);
1134} 1132}
1135 1133
1136
1137static void gfar_vlan_rx_kill_vid(struct net_device *dev, uint16_t vid)
1138{
1139 struct gfar_private *priv = netdev_priv(dev);
1140 unsigned long flags;
1141
1142 spin_lock_irqsave(&priv->rxlock, flags);
1143
1144 vlan_group_set_device(priv->vlgrp, vid, NULL);
1145
1146 spin_unlock_irqrestore(&priv->rxlock, flags);
1147}
1148
1149
1150static int gfar_change_mtu(struct net_device *dev, int new_mtu) 1134static int gfar_change_mtu(struct net_device *dev, int new_mtu)
1151{ 1135{
1152 int tempsize, tempval; 1136 int tempsize, tempval;
diff --git a/drivers/net/hp100.c b/drivers/net/hp100.c
index 8118a6750b61..8caa591c5649 100644
--- a/drivers/net/hp100.c
+++ b/drivers/net/hp100.c
@@ -3005,7 +3005,7 @@ static int __init hp100_isa_init(void)
3005 return cards > 0 ? 0 : -ENODEV; 3005 return cards > 0 ? 0 : -ENODEV;
3006} 3006}
3007 3007
3008static void __exit hp100_isa_cleanup(void) 3008static void hp100_isa_cleanup(void)
3009{ 3009{
3010 int i; 3010 int i;
3011 3011
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c
index 5d14be7405a3..b53b7ad999bc 100644
--- a/drivers/net/myri10ge/myri10ge.c
+++ b/drivers/net/myri10ge/myri10ge.c
@@ -1472,6 +1472,7 @@ static const struct ethtool_ops myri10ge_ethtool_ops = {
1472 .set_sg = ethtool_op_set_sg, 1472 .set_sg = ethtool_op_set_sg,
1473 .get_tso = ethtool_op_get_tso, 1473 .get_tso = ethtool_op_get_tso,
1474 .set_tso = ethtool_op_set_tso, 1474 .set_tso = ethtool_op_set_tso,
1475 .get_link = ethtool_op_get_link,
1475 .get_strings = myri10ge_get_strings, 1476 .get_strings = myri10ge_get_strings,
1476 .get_stats_count = myri10ge_get_stats_count, 1477 .get_stats_count = myri10ge_get_stats_count,
1477 .get_ethtool_stats = myri10ge_get_ethtool_stats, 1478 .get_ethtool_stats = myri10ge_get_ethtool_stats,
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c
index 2c5c6d20e6e9..c61181f23bd5 100644
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -654,8 +654,6 @@ static void __devexit netxen_nic_remove(struct pci_dev *pdev)
654 if (adapter->portnum == 0) 654 if (adapter->portnum == 0)
655 netxen_free_adapter_offload(adapter); 655 netxen_free_adapter_offload(adapter);
656 656
657 if (adapter->irq)
658 free_irq(adapter->irq, adapter);
659 if(adapter->portnum == 0) { 657 if(adapter->portnum == 0) {
660 /* leave the hw in the same state as reboot */ 658 /* leave the hw in the same state as reboot */
661 writel(0, NETXEN_CRB_NORMALIZE(adapter, CRB_CMDPEG_STATE)); 659 writel(0, NETXEN_CRB_NORMALIZE(adapter, CRB_CMDPEG_STATE));
diff --git a/drivers/net/ns83820.c b/drivers/net/ns83820.c
index 3439f8c649f9..717d8e9b9833 100644
--- a/drivers/net/ns83820.c
+++ b/drivers/net/ns83820.c
@@ -506,17 +506,6 @@ static void ns83820_vlan_rx_register(struct net_device *ndev, struct vlan_group
506 spin_unlock(&dev->tx_lock); 506 spin_unlock(&dev->tx_lock);
507 spin_unlock_irq(&dev->misc_lock); 507 spin_unlock_irq(&dev->misc_lock);
508} 508}
509
510static void ns83820_vlan_rx_kill_vid(struct net_device *ndev, unsigned short vid)
511{
512 struct ns83820 *dev = PRIV(ndev);
513
514 spin_lock_irq(&dev->misc_lock);
515 spin_lock(&dev->tx_lock);
516 vlan_group_set_device(dev->vlgrp, vid, NULL);
517 spin_unlock(&dev->tx_lock);
518 spin_unlock_irq(&dev->misc_lock);
519}
520#endif 509#endif
521 510
522/* Packet Receiver 511/* Packet Receiver
@@ -2083,7 +2072,6 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_
2083 /* We also support hardware vlan acceleration */ 2072 /* We also support hardware vlan acceleration */
2084 ndev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; 2073 ndev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
2085 ndev->vlan_rx_register = ns83820_vlan_rx_register; 2074 ndev->vlan_rx_register = ns83820_vlan_rx_register;
2086 ndev->vlan_rx_kill_vid = ns83820_vlan_rx_kill_vid;
2087#endif 2075#endif
2088 2076
2089 if (using_dac) { 2077 if (using_dac) {
diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c
index d8766c0e8255..585be044ebbb 100755
--- a/drivers/net/qla3xxx.c
+++ b/drivers/net/qla3xxx.c
@@ -4044,7 +4044,7 @@ static int __devinit ql3xxx_probe(struct pci_dev *pdev,
4044 if (pci_using_dac) 4044 if (pci_using_dac)
4045 ndev->features |= NETIF_F_HIGHDMA; 4045 ndev->features |= NETIF_F_HIGHDMA;
4046 if (qdev->device_id == QL3032_DEVICE_ID) 4046 if (qdev->device_id == QL3032_DEVICE_ID)
4047 ndev->features |= (NETIF_F_HW_CSUM | NETIF_F_SG); 4047 ndev->features |= NETIF_F_IP_CSUM | NETIF_F_SG;
4048 4048
4049 qdev->mem_map_registers = 4049 qdev->mem_map_registers =
4050 ioremap_nocache(pci_resource_start(pdev, 1), 4050 ioremap_nocache(pci_resource_start(pdev, 1),
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 45876a854f00..5ec7752caa48 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -886,16 +886,6 @@ static void rtl8169_vlan_rx_register(struct net_device *dev,
886 spin_unlock_irqrestore(&tp->lock, flags); 886 spin_unlock_irqrestore(&tp->lock, flags);
887} 887}
888 888
889static void rtl8169_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
890{
891 struct rtl8169_private *tp = netdev_priv(dev);
892 unsigned long flags;
893
894 spin_lock_irqsave(&tp->lock, flags);
895 vlan_group_set_device(tp->vlgrp, vid, NULL);
896 spin_unlock_irqrestore(&tp->lock, flags);
897}
898
899static int rtl8169_rx_vlan_skb(struct rtl8169_private *tp, struct RxDesc *desc, 889static int rtl8169_rx_vlan_skb(struct rtl8169_private *tp, struct RxDesc *desc,
900 struct sk_buff *skb) 890 struct sk_buff *skb)
901{ 891{
@@ -1671,7 +1661,6 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
1671#ifdef CONFIG_R8169_VLAN 1661#ifdef CONFIG_R8169_VLAN
1672 dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; 1662 dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
1673 dev->vlan_rx_register = rtl8169_vlan_rx_register; 1663 dev->vlan_rx_register = rtl8169_vlan_rx_register;
1674 dev->vlan_rx_kill_vid = rtl8169_vlan_rx_kill_vid;
1675#endif 1664#endif
1676 1665
1677#ifdef CONFIG_NET_POLL_CONTROLLER 1666#ifdef CONFIG_NET_POLL_CONTROLLER
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index e3e6d410d72c..c6ba3dee8ae0 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -340,17 +340,6 @@ static void s2io_vlan_rx_register(struct net_device *dev,
340/* A flag indicating whether 'RX_PA_CFG_STRIP_VLAN_TAG' bit is set or not */ 340/* A flag indicating whether 'RX_PA_CFG_STRIP_VLAN_TAG' bit is set or not */
341static int vlan_strip_flag; 341static int vlan_strip_flag;
342 342
343/* Unregister the vlan */
344static void s2io_vlan_rx_kill_vid(struct net_device *dev, unsigned long vid)
345{
346 struct s2io_nic *nic = dev->priv;
347 unsigned long flags;
348
349 spin_lock_irqsave(&nic->tx_lock, flags);
350 vlan_group_set_device(nic->vlgrp, vid, NULL);
351 spin_unlock_irqrestore(&nic->tx_lock, flags);
352}
353
354/* 343/*
355 * Constants to be programmed into the Xena's registers, to configure 344 * Constants to be programmed into the Xena's registers, to configure
356 * the XAUI. 345 * the XAUI.
@@ -7412,7 +7401,6 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre)
7412 SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); 7401 SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops);
7413 dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; 7402 dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
7414 dev->vlan_rx_register = s2io_vlan_rx_register; 7403 dev->vlan_rx_register = s2io_vlan_rx_register;
7415 dev->vlan_rx_kill_vid = (void *)s2io_vlan_rx_kill_vid;
7416 7404
7417 /* 7405 /*
7418 * will use eth_mac_addr() for dev->set_mac_address 7406 * will use eth_mac_addr() for dev->set_mac_address
diff --git a/drivers/net/skfp/smt.c b/drivers/net/skfp/smt.c
index fe847800acdc..75afc1f07ba0 100644
--- a/drivers/net/skfp/smt.c
+++ b/drivers/net/skfp/smt.c
@@ -1748,7 +1748,7 @@ char *addr_to_string(struct fddi_addr *addr)
1748#endif 1748#endif
1749 1749
1750#ifdef AM29K 1750#ifdef AM29K
1751smt_ifconfig(int argc, char *argv[]) 1751int smt_ifconfig(int argc, char *argv[])
1752{ 1752{
1753 if (argc >= 2 && !strcmp(argv[0],"opt_bypass") && 1753 if (argc >= 2 && !strcmp(argv[0],"opt_bypass") &&
1754 !strcmp(argv[1],"yes")) { 1754 !strcmp(argv[1],"yes")) {
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 832fd69a0e59..fe01b961b597 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -364,7 +364,7 @@ static void sky2_phy_init(struct sky2_hw *hw, unsigned port)
364 /* for SFP-module set SIGDET polarity to low */ 364 /* for SFP-module set SIGDET polarity to low */
365 ctrl = gm_phy_read(hw, port, PHY_MARV_PHY_CTRL); 365 ctrl = gm_phy_read(hw, port, PHY_MARV_PHY_CTRL);
366 ctrl |= PHY_M_FIB_SIGD_POL; 366 ctrl |= PHY_M_FIB_SIGD_POL;
367 gm_phy_write(hw, port, PHY_MARV_CTRL, ctrl); 367 gm_phy_write(hw, port, PHY_MARV_PHY_CTRL, ctrl);
368 } 368 }
369 369
370 gm_phy_write(hw, port, PHY_MARV_EXT_ADR, pg); 370 gm_phy_write(hw, port, PHY_MARV_EXT_ADR, pg);
@@ -658,7 +658,7 @@ static void sky2_mac_init(struct sky2_hw *hw, unsigned port)
658 const u8 *addr = hw->dev[port]->dev_addr; 658 const u8 *addr = hw->dev[port]->dev_addr;
659 659
660 sky2_write32(hw, SK_REG(port, GPHY_CTRL), GPC_RST_SET); 660 sky2_write32(hw, SK_REG(port, GPHY_CTRL), GPC_RST_SET);
661 sky2_write32(hw, SK_REG(port, GPHY_CTRL), GPC_RST_CLR|GPC_ENA_PAUSE); 661 sky2_write32(hw, SK_REG(port, GPHY_CTRL), GPC_RST_CLR);
662 662
663 sky2_write8(hw, SK_REG(port, GMAC_CTRL), GMC_RST_CLR); 663 sky2_write8(hw, SK_REG(port, GMAC_CTRL), GMC_RST_CLR);
664 664
@@ -1049,26 +1049,22 @@ static void sky2_vlan_rx_register(struct net_device *dev, struct vlan_group *grp
1049 u16 port = sky2->port; 1049 u16 port = sky2->port;
1050 1050
1051 netif_tx_lock_bh(dev); 1051 netif_tx_lock_bh(dev);
1052 netif_poll_disable(sky2->hw->dev[0]);
1052 1053
1053 sky2_write32(hw, SK_REG(port, RX_GMF_CTRL_T), RX_VLAN_STRIP_ON);
1054 sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T), TX_VLAN_TAG_ON);
1055 sky2->vlgrp = grp; 1054 sky2->vlgrp = grp;
1055 if (grp) {
1056 sky2_write32(hw, SK_REG(port, RX_GMF_CTRL_T),
1057 RX_VLAN_STRIP_ON);
1058 sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T),
1059 TX_VLAN_TAG_ON);
1060 } else {
1061 sky2_write32(hw, SK_REG(port, RX_GMF_CTRL_T),
1062 RX_VLAN_STRIP_OFF);
1063 sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T),
1064 TX_VLAN_TAG_OFF);
1065 }
1056 1066
1057 netif_tx_unlock_bh(dev); 1067 netif_poll_enable(sky2->hw->dev[0]);
1058}
1059
1060static void sky2_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
1061{
1062 struct sky2_port *sky2 = netdev_priv(dev);
1063 struct sky2_hw *hw = sky2->hw;
1064 u16 port = sky2->port;
1065
1066 netif_tx_lock_bh(dev);
1067
1068 sky2_write32(hw, SK_REG(port, RX_GMF_CTRL_T), RX_VLAN_STRIP_OFF);
1069 sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T), TX_VLAN_TAG_OFF);
1070 vlan_group_set_device(sky2->vlgrp, vid, NULL);
1071
1072 netif_tx_unlock_bh(dev); 1068 netif_tx_unlock_bh(dev);
1073} 1069}
1074#endif 1070#endif
@@ -1432,7 +1428,7 @@ static int sky2_xmit_frame(struct sk_buff *skb, struct net_device *dev)
1432 tcpsum = offset << 16; /* sum start */ 1428 tcpsum = offset << 16; /* sum start */
1433 tcpsum |= offset + skb->csum_offset; /* sum write */ 1429 tcpsum |= offset + skb->csum_offset; /* sum write */
1434 1430
1435 ctrl = CALSUM | WR_SUM | INIT_SUM | LOCK_SUM; 1431 ctrl |= CALSUM | WR_SUM | INIT_SUM | LOCK_SUM;
1436 if (ip_hdr(skb)->protocol == IPPROTO_UDP) 1432 if (ip_hdr(skb)->protocol == IPPROTO_UDP)
1437 ctrl |= UDPTCP; 1433 ctrl |= UDPTCP;
1438 1434
@@ -3484,7 +3480,6 @@ static __devinit struct net_device *sky2_init_netdev(struct sky2_hw *hw,
3484#ifdef SKY2_VLAN_TAG_USED 3480#ifdef SKY2_VLAN_TAG_USED
3485 dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; 3481 dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
3486 dev->vlan_rx_register = sky2_vlan_rx_register; 3482 dev->vlan_rx_register = sky2_vlan_rx_register;
3487 dev->vlan_rx_kill_vid = sky2_vlan_rx_kill_vid;
3488#endif 3483#endif
3489 3484
3490 /* read the mac address */ 3485 /* read the mac address */
diff --git a/drivers/net/sky2.h b/drivers/net/sky2.h
index 5efb5afc45ba..b8c4a3b5eadf 100644
--- a/drivers/net/sky2.h
+++ b/drivers/net/sky2.h
@@ -1149,7 +1149,7 @@ enum {
1149 PHY_M_IS_JABBER = 1<<0, /* Jabber */ 1149 PHY_M_IS_JABBER = 1<<0, /* Jabber */
1150 1150
1151 PHY_M_DEF_MSK = PHY_M_IS_LSP_CHANGE | PHY_M_IS_LST_CHANGE 1151 PHY_M_DEF_MSK = PHY_M_IS_LSP_CHANGE | PHY_M_IS_LST_CHANGE
1152 | PHY_M_IS_FIFO_ERROR, 1152 | PHY_M_IS_DUP_CHANGE,
1153 PHY_M_AN_MSK = PHY_M_IS_AN_ERROR | PHY_M_IS_AN_COMPL, 1153 PHY_M_AN_MSK = PHY_M_IS_AN_ERROR | PHY_M_IS_AN_COMPL,
1154}; 1154};
1155 1155
@@ -1732,28 +1732,6 @@ enum {
1732 1732
1733/* GPHY_CTRL 32 bit GPHY Control Reg (YUKON only) */ 1733/* GPHY_CTRL 32 bit GPHY Control Reg (YUKON only) */
1734enum { 1734enum {
1735 GPC_SEL_BDT = 1<<28, /* Select Bi-Dir. Transfer for MDC/MDIO */
1736 GPC_INT_POL_HI = 1<<27, /* IRQ Polarity is Active HIGH */
1737 GPC_75_OHM = 1<<26, /* Use 75 Ohm Termination instead of 50 */
1738 GPC_DIS_FC = 1<<25, /* Disable Automatic Fiber/Copper Detection */
1739 GPC_DIS_SLEEP = 1<<24, /* Disable Energy Detect */
1740 GPC_HWCFG_M_3 = 1<<23, /* HWCFG_MODE[3] */
1741 GPC_HWCFG_M_2 = 1<<22, /* HWCFG_MODE[2] */
1742 GPC_HWCFG_M_1 = 1<<21, /* HWCFG_MODE[1] */
1743 GPC_HWCFG_M_0 = 1<<20, /* HWCFG_MODE[0] */
1744 GPC_ANEG_0 = 1<<19, /* ANEG[0] */
1745 GPC_ENA_XC = 1<<18, /* Enable MDI crossover */
1746 GPC_DIS_125 = 1<<17, /* Disable 125 MHz clock */
1747 GPC_ANEG_3 = 1<<16, /* ANEG[3] */
1748 GPC_ANEG_2 = 1<<15, /* ANEG[2] */
1749 GPC_ANEG_1 = 1<<14, /* ANEG[1] */
1750 GPC_ENA_PAUSE = 1<<13, /* Enable Pause (SYM_OR_REM) */
1751 GPC_PHYADDR_4 = 1<<12, /* Bit 4 of Phy Addr */
1752 GPC_PHYADDR_3 = 1<<11, /* Bit 3 of Phy Addr */
1753 GPC_PHYADDR_2 = 1<<10, /* Bit 2 of Phy Addr */
1754 GPC_PHYADDR_1 = 1<<9, /* Bit 1 of Phy Addr */
1755 GPC_PHYADDR_0 = 1<<8, /* Bit 0 of Phy Addr */
1756 /* Bits 7..2: reserved */
1757 GPC_RST_CLR = 1<<1, /* Clear GPHY Reset */ 1735 GPC_RST_CLR = 1<<1, /* Clear GPHY Reset */
1758 GPC_RST_SET = 1<<0, /* Set GPHY Reset */ 1736 GPC_RST_SET = 1<<0, /* Set GPHY Reset */
1759}; 1737};
diff --git a/drivers/net/smc91x.h b/drivers/net/smc91x.h
index 111f23d05764..506bffcbc6dc 100644
--- a/drivers/net/smc91x.h
+++ b/drivers/net/smc91x.h
@@ -281,17 +281,14 @@ SMC_outw(u16 val, void __iomem *ioaddr, int reg)
281 281
282#elif defined(CONFIG_SUPERH) 282#elif defined(CONFIG_SUPERH)
283 283
284#if defined(CONFIG_SH_7780_SOLUTION_ENGINE) || defined(CONFIG_SH_7722_SOLUTION_ENGINE) 284#ifdef CONFIG_SOLUTION_ENGINE
285#define SMC_CAN_USE_8BIT 0 285#define SMC_CAN_USE_8BIT 0
286#define SMC_CAN_USE_16BIT 1 286#define SMC_CAN_USE_16BIT 1
287#define SMC_CAN_USE_32BIT 0 287#define SMC_CAN_USE_32BIT 0
288#define SMC_IO_SHIFT 0 288#define SMC_IO_SHIFT 0
289#define SMC_NOWAIT 1 289#define SMC_NOWAIT 1
290 290
291#define SMC_inb(a, r) (inw((a) + ((r)&~1)) >> (8*(r%2)))&0xff
292#define SMC_inw(a, r) inw((a) + (r)) 291#define SMC_inw(a, r) inw((a) + (r))
293#define SMC_outb(v, a, r) outw(((inw((a)+((r)&~1))*(0xff<<8*(r%2)))) | ((v)<<(8*(r&2)))), (a) + ((r)&~1))
294
295#define SMC_outw(v, a, r) outw(v, (a) + (r)) 292#define SMC_outw(v, a, r) outw(v, (a) + (r))
296#define SMC_insw(a, r, p, l) insw((a) + (r), p, l) 293#define SMC_insw(a, r, p, l) insw((a) + (r), p, l)
297#define SMC_outsw(a, r, p, l) outsw((a) + (r), p, l) 294#define SMC_outsw(a, r, p, l) outsw((a) + (r), p, l)
diff --git a/drivers/net/spider_net.c b/drivers/net/spider_net.c
index ef84d7c757a0..b47ad1df2e0c 100644
--- a/drivers/net/spider_net.c
+++ b/drivers/net/spider_net.c
@@ -1191,43 +1191,6 @@ spider_net_poll(struct net_device *netdev, int *budget)
1191} 1191}
1192 1192
1193/** 1193/**
1194 * spider_net_vlan_rx_reg - initializes VLAN structures in the driver and card
1195 * @netdev: interface device structure
1196 * @grp: vlan_group structure that is registered (NULL on destroying interface)
1197 */
1198static void
1199spider_net_vlan_rx_reg(struct net_device *netdev, struct vlan_group *grp)
1200{
1201 /* further enhancement... yet to do */
1202 return;
1203}
1204
1205/**
1206 * spider_net_vlan_rx_add - adds VLAN id to the card filter
1207 * @netdev: interface device structure
1208 * @vid: VLAN id to add
1209 */
1210static void
1211spider_net_vlan_rx_add(struct net_device *netdev, uint16_t vid)
1212{
1213 /* further enhancement... yet to do */
1214 /* add vid to card's VLAN filter table */
1215 return;
1216}
1217
1218/**
1219 * spider_net_vlan_rx_kill - removes VLAN id to the card filter
1220 * @netdev: interface device structure
1221 * @vid: VLAN id to remove
1222 */
1223static void
1224spider_net_vlan_rx_kill(struct net_device *netdev, uint16_t vid)
1225{
1226 /* further enhancement... yet to do */
1227 /* remove vid from card's VLAN filter table */
1228}
1229
1230/**
1231 * spider_net_get_stats - get interface statistics 1194 * spider_net_get_stats - get interface statistics
1232 * @netdev: interface device structure 1195 * @netdev: interface device structure
1233 * 1196 *
@@ -2177,9 +2140,6 @@ spider_net_setup_netdev_ops(struct net_device *netdev)
2177 netdev->poll = &spider_net_poll; 2140 netdev->poll = &spider_net_poll;
2178 netdev->weight = SPIDER_NET_NAPI_WEIGHT; 2141 netdev->weight = SPIDER_NET_NAPI_WEIGHT;
2179 /* HW VLAN */ 2142 /* HW VLAN */
2180 netdev->vlan_rx_register = &spider_net_vlan_rx_reg;
2181 netdev->vlan_rx_add_vid = &spider_net_vlan_rx_add;
2182 netdev->vlan_rx_kill_vid = &spider_net_vlan_rx_kill;
2183#ifdef CONFIG_NET_POLL_CONTROLLER 2143#ifdef CONFIG_NET_POLL_CONTROLLER
2184 /* poll controller */ 2144 /* poll controller */
2185 netdev->poll_controller = &spider_net_poll_controller; 2145 netdev->poll_controller = &spider_net_poll_controller;
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 923b9c725cc3..2f3184184ad9 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -64,8 +64,8 @@
64 64
65#define DRV_MODULE_NAME "tg3" 65#define DRV_MODULE_NAME "tg3"
66#define PFX DRV_MODULE_NAME ": " 66#define PFX DRV_MODULE_NAME ": "
67#define DRV_MODULE_VERSION "3.76" 67#define DRV_MODULE_VERSION "3.77"
68#define DRV_MODULE_RELDATE "May 5, 2007" 68#define DRV_MODULE_RELDATE "May 31, 2007"
69 69
70#define TG3_DEF_MAC_MODE 0 70#define TG3_DEF_MAC_MODE 0
71#define TG3_DEF_RX_MODE 0 71#define TG3_DEF_RX_MODE 0
@@ -9121,21 +9121,6 @@ static void tg3_vlan_rx_register(struct net_device *dev, struct vlan_group *grp)
9121 if (netif_running(dev)) 9121 if (netif_running(dev))
9122 tg3_netif_start(tp); 9122 tg3_netif_start(tp);
9123} 9123}
9124
9125static void tg3_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
9126{
9127 struct tg3 *tp = netdev_priv(dev);
9128
9129 if (netif_running(dev))
9130 tg3_netif_stop(tp);
9131
9132 tg3_full_lock(tp, 0);
9133 vlan_group_set_device(tp->vlgrp, vid, NULL);
9134 tg3_full_unlock(tp);
9135
9136 if (netif_running(dev))
9137 tg3_netif_start(tp);
9138}
9139#endif 9124#endif
9140 9125
9141static int tg3_get_coalesce(struct net_device *dev, struct ethtool_coalesce *ec) 9126static int tg3_get_coalesce(struct net_device *dev, struct ethtool_coalesce *ec)
@@ -10976,6 +10961,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
10976 * upon subsystem IDs. 10961 * upon subsystem IDs.
10977 */ 10962 */
10978 if (tp->pdev->subsystem_vendor == PCI_VENDOR_ID_DELL && 10963 if (tp->pdev->subsystem_vendor == PCI_VENDOR_ID_DELL &&
10964 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5701 &&
10979 !(tp->tg3_flags2 & TG3_FLG2_PHY_SERDES)) { 10965 !(tp->tg3_flags2 & TG3_FLG2_PHY_SERDES)) {
10980 tp->tg3_flags |= (TG3_FLAG_USE_MI_INTERRUPT | 10966 tp->tg3_flags |= (TG3_FLAG_USE_MI_INTERRUPT |
10981 TG3_FLAG_USE_LINKCHG_REG); 10967 TG3_FLAG_USE_LINKCHG_REG);
@@ -11778,7 +11764,6 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
11778#if TG3_VLAN_TAG_USED 11764#if TG3_VLAN_TAG_USED
11779 dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; 11765 dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
11780 dev->vlan_rx_register = tg3_vlan_rx_register; 11766 dev->vlan_rx_register = tg3_vlan_rx_register;
11781 dev->vlan_rx_kill_vid = tg3_vlan_rx_kill_vid;
11782#endif 11767#endif
11783 11768
11784 tp = netdev_priv(dev); 11769 tp = netdev_priv(dev);
diff --git a/drivers/net/typhoon.c b/drivers/net/typhoon.c
index f72573594121..15b2fb8aa492 100644
--- a/drivers/net/typhoon.c
+++ b/drivers/net/typhoon.c
@@ -741,15 +741,6 @@ typhoon_vlan_rx_register(struct net_device *dev, struct vlan_group *grp)
741 spin_unlock_bh(&tp->state_lock); 741 spin_unlock_bh(&tp->state_lock);
742} 742}
743 743
744static void
745typhoon_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
746{
747 struct typhoon *tp = netdev_priv(dev);
748 spin_lock_bh(&tp->state_lock);
749 vlan_group_set_device(tp->vlgrp, vid, NULL);
750 spin_unlock_bh(&tp->state_lock);
751}
752
753static inline void 744static inline void
754typhoon_tso_fill(struct sk_buff *skb, struct transmit_ring *txRing, 745typhoon_tso_fill(struct sk_buff *skb, struct transmit_ring *txRing,
755 u32 ring_dma) 746 u32 ring_dma)
@@ -2542,7 +2533,7 @@ typhoon_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
2542 dev->get_stats = typhoon_get_stats; 2533 dev->get_stats = typhoon_get_stats;
2543 dev->set_mac_address = typhoon_set_mac_address; 2534 dev->set_mac_address = typhoon_set_mac_address;
2544 dev->vlan_rx_register = typhoon_vlan_rx_register; 2535 dev->vlan_rx_register = typhoon_vlan_rx_register;
2545 dev->vlan_rx_kill_vid = typhoon_vlan_rx_kill_vid; 2536
2546 SET_ETHTOOL_OPS(dev, &typhoon_ethtool_ops); 2537 SET_ETHTOOL_OPS(dev, &typhoon_ethtool_ops);
2547 2538
2548 /* We can handle scatter gather, up to 16 entries, and 2539 /* We can handle scatter gather, up to 16 entries, and
diff --git a/drivers/net/wireless/hostap/hostap_80211_tx.c b/drivers/net/wireless/hostap/hostap_80211_tx.c
index 246fac0e8001..3df3c60263d4 100644
--- a/drivers/net/wireless/hostap/hostap_80211_tx.c
+++ b/drivers/net/wireless/hostap/hostap_80211_tx.c
@@ -311,7 +311,7 @@ static struct sk_buff * hostap_tx_encrypt(struct sk_buff *skb,
311 local_info_t *local; 311 local_info_t *local;
312 struct ieee80211_hdr_4addr *hdr; 312 struct ieee80211_hdr_4addr *hdr;
313 u16 fc; 313 u16 fc;
314 int hdr_len, res; 314 int prefix_len, postfix_len, hdr_len, res;
315 315
316 iface = netdev_priv(skb->dev); 316 iface = netdev_priv(skb->dev);
317 local = iface->local; 317 local = iface->local;
@@ -337,10 +337,13 @@ static struct sk_buff * hostap_tx_encrypt(struct sk_buff *skb,
337 if (skb == NULL) 337 if (skb == NULL)
338 return NULL; 338 return NULL;
339 339
340 if ((skb_headroom(skb) < crypt->ops->extra_mpdu_prefix_len || 340 prefix_len = crypt->ops->extra_mpdu_prefix_len +
341 skb_tailroom(skb) < crypt->ops->extra_mpdu_postfix_len) && 341 crypt->ops->extra_msdu_prefix_len;
342 pskb_expand_head(skb, crypt->ops->extra_mpdu_prefix_len, 342 postfix_len = crypt->ops->extra_mpdu_postfix_len +
343 crypt->ops->extra_mpdu_postfix_len, GFP_ATOMIC)) { 343 crypt->ops->extra_msdu_postfix_len;
344 if ((skb_headroom(skb) < prefix_len ||
345 skb_tailroom(skb) < postfix_len) &&
346 pskb_expand_head(skb, prefix_len, postfix_len, GFP_ATOMIC)) {
344 kfree_skb(skb); 347 kfree_skb(skb);
345 return NULL; 348 return NULL;
346 } 349 }
diff --git a/drivers/net/wireless/prism54/islpci_eth.c b/drivers/net/wireless/prism54/islpci_eth.c
index dd070cccf324..f49eb068c7d0 100644
--- a/drivers/net/wireless/prism54/islpci_eth.c
+++ b/drivers/net/wireless/prism54/islpci_eth.c
@@ -378,9 +378,10 @@ islpci_eth_receive(islpci_private *priv)
378 display_buffer((char *) skb->data, skb->len); 378 display_buffer((char *) skb->data, skb->len);
379#endif 379#endif
380 /* take care of monitor mode and spy monitoring. */ 380 /* take care of monitor mode and spy monitoring. */
381 if (unlikely(priv->iw_mode == IW_MODE_MONITOR)) 381 if (unlikely(priv->iw_mode == IW_MODE_MONITOR)) {
382 skb->dev = ndev;
382 discard = islpci_monitor_rx(priv, &skb); 383 discard = islpci_monitor_rx(priv, &skb);
383 else { 384 } else {
384 if (unlikely(skb->data[2 * ETH_ALEN] == 0)) { 385 if (unlikely(skb->data[2 * ETH_ALEN] == 0)) {
385 /* The packet has a rx_annex. Read it for spy monitoring, Then 386 /* The packet has a rx_annex. Read it for spy monitoring, Then
386 * remove it, while keeping the 2 leading MAC addr. 387 * remove it, while keeping the 2 leading MAC addr.
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index d9cbd586ae4b..be1df85e5e2d 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -15,10 +15,10 @@
15#include <linux/pci.h> 15#include <linux/pci.h>
16#include <linux/proc_fs.h> 16#include <linux/proc_fs.h>
17#include <linux/msi.h> 17#include <linux/msi.h>
18#include <linux/smp.h>
18 19
19#include <asm/errno.h> 20#include <asm/errno.h>
20#include <asm/io.h> 21#include <asm/io.h>
21#include <asm/smp.h>
22 22
23#include "pci.h" 23#include "pci.h"
24#include "msi.h" 24#include "msi.h"
@@ -333,7 +333,7 @@ static int msi_capability_init(struct pci_dev *dev)
333 msi_mask_bits_reg(pos, is_64bit_address(control)), 333 msi_mask_bits_reg(pos, is_64bit_address(control)),
334 maskbits); 334 maskbits);
335 } 335 }
336 list_add(&entry->list, &dev->msi_list); 336 list_add_tail(&entry->list, &dev->msi_list);
337 337
338 /* Configure MSI capability structure */ 338 /* Configure MSI capability structure */
339 ret = arch_setup_msi_irqs(dev, 1, PCI_CAP_ID_MSI); 339 ret = arch_setup_msi_irqs(dev, 1, PCI_CAP_ID_MSI);
@@ -404,7 +404,7 @@ static int msix_capability_init(struct pci_dev *dev,
404 entry->dev = dev; 404 entry->dev = dev;
405 entry->mask_base = base; 405 entry->mask_base = base;
406 406
407 list_add(&entry->list, &dev->msi_list); 407 list_add_tail(&entry->list, &dev->msi_list);
408 } 408 }
409 409
410 ret = arch_setup_msi_irqs(dev, nvec, PCI_CAP_ID_MSIX); 410 ret = arch_setup_msi_irqs(dev, nvec, PCI_CAP_ID_MSIX);
@@ -558,12 +558,12 @@ static int msi_free_irqs(struct pci_dev* dev)
558 558
559 list_for_each_entry_safe(entry, tmp, &dev->msi_list, list) { 559 list_for_each_entry_safe(entry, tmp, &dev->msi_list, list) {
560 if (entry->msi_attrib.type == PCI_CAP_ID_MSIX) { 560 if (entry->msi_attrib.type == PCI_CAP_ID_MSIX) {
561 if (list_is_last(&entry->list, &dev->msi_list))
562 iounmap(entry->mask_base);
563
564 writel(1, entry->mask_base + entry->msi_attrib.entry_nr 561 writel(1, entry->mask_base + entry->msi_attrib.entry_nr
565 * PCI_MSIX_ENTRY_SIZE 562 * PCI_MSIX_ENTRY_SIZE
566 + PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET); 563 + PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET);
564
565 if (list_is_last(&entry->list, &dev->msi_list))
566 iounmap(entry->mask_base);
567 } 567 }
568 list_del(&entry->list); 568 list_del(&entry->list);
569 kfree(entry); 569 kfree(entry);
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 6ccc2e95930a..01d8f8a8843c 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -1625,18 +1625,22 @@ DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_CK804_PCIE,
1625 quirk_nvidia_ck804_pcie_aer_ext_cap); 1625 quirk_nvidia_ck804_pcie_aer_ext_cap);
1626 1626
1627#ifdef CONFIG_PCI_MSI 1627#ifdef CONFIG_PCI_MSI
1628/* The Serverworks PCI-X chipset does not support MSI. We cannot easily rely 1628/* Some chipsets do not support MSI. We cannot easily rely on setting
1629 * on setting PCI_BUS_FLAGS_NO_MSI in its bus flags because there are actually 1629 * PCI_BUS_FLAGS_NO_MSI in its bus flags because there are actually
1630 * some other busses controlled by the chipset even if Linux is not aware of it. 1630 * some other busses controlled by the chipset even if Linux is not
1631 * Instead of setting the flag on all busses in the machine, simply disable MSI 1631 * aware of it. Instead of setting the flag on all busses in the
1632 * globally. 1632 * machine, simply disable MSI globally.
1633 */ 1633 */
1634static void __init quirk_svw_msi(struct pci_dev *dev) 1634static void __init quirk_disable_all_msi(struct pci_dev *dev)
1635{ 1635{
1636 pci_no_msi(); 1636 pci_no_msi();
1637 printk(KERN_WARNING "PCI: MSI quirk detected. MSI deactivated.\n"); 1637 printk(KERN_WARNING "PCI: MSI quirk detected. MSI deactivated.\n");
1638} 1638}
1639DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_GCNB_LE, quirk_svw_msi); 1639DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_GCNB_LE, quirk_disable_all_msi);
1640DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_HT1000_PCIX, quirk_disable_all_msi);
1641DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS400_200, quirk_disable_all_msi);
1642DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS480, quirk_disable_all_msi);
1643DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_VT3351, quirk_disable_all_msi);
1640 1644
1641/* Disable MSI on chipsets that are known to not support it */ 1645/* Disable MSI on chipsets that are known to not support it */
1642static void __devinit quirk_disable_msi(struct pci_dev *dev) 1646static void __devinit quirk_disable_msi(struct pci_dev *dev)
@@ -1649,8 +1653,6 @@ static void __devinit quirk_disable_msi(struct pci_dev *dev)
1649 } 1653 }
1650} 1654}
1651DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8131_BRIDGE, quirk_disable_msi); 1655DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8131_BRIDGE, quirk_disable_msi);
1652DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS400_200, quirk_disable_msi);
1653DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS480, quirk_disable_msi);
1654 1656
1655/* Go through the list of Hypertransport capabilities and 1657/* Go through the list of Hypertransport capabilities and
1656 * return 1 if a HT MSI capability is found and enabled */ 1658 * return 1 if a HT MSI capability is found and enabled */
diff --git a/drivers/pci/search.c b/drivers/pci/search.c
index b137a27472c7..c13232435dc0 100644
--- a/drivers/pci/search.c
+++ b/drivers/pci/search.c
@@ -403,10 +403,11 @@ const struct pci_device_id *pci_find_present(const struct pci_device_id *ids)
403 while (ids->vendor || ids->subvendor || ids->class_mask) { 403 while (ids->vendor || ids->subvendor || ids->class_mask) {
404 list_for_each_entry(dev, &pci_devices, global_list) { 404 list_for_each_entry(dev, &pci_devices, global_list) {
405 if ((found = pci_match_one_device(ids, dev)) != NULL) 405 if ((found = pci_match_one_device(ids, dev)) != NULL)
406 break; 406 goto exit;
407 } 407 }
408 ids++; 408 ids++;
409 } 409 }
410exit:
410 up_read(&pci_bus_sem); 411 up_read(&pci_bus_sem);
411 return found; 412 return found;
412} 413}
diff --git a/drivers/pcmcia/at91_cf.c b/drivers/pcmcia/at91_cf.c
index 948efc775a78..eb6abd3f9221 100644
--- a/drivers/pcmcia/at91_cf.c
+++ b/drivers/pcmcia/at91_cf.c
@@ -336,16 +336,21 @@ static int at91_cf_suspend(struct platform_device *pdev, pm_message_t mesg)
336 enable_irq_wake(board->det_pin); 336 enable_irq_wake(board->det_pin);
337 if (board->irq_pin) 337 if (board->irq_pin)
338 enable_irq_wake(board->irq_pin); 338 enable_irq_wake(board->irq_pin);
339 } else {
340 disable_irq_wake(board->det_pin);
341 if (board->irq_pin)
342 disable_irq_wake(board->irq_pin);
343 } 339 }
344 return 0; 340 return 0;
345} 341}
346 342
347static int at91_cf_resume(struct platform_device *pdev) 343static int at91_cf_resume(struct platform_device *pdev)
348{ 344{
345 struct at91_cf_socket *cf = platform_get_drvdata(pdev);
346 struct at91_cf_data *board = cf->board;
347
348 if (device_may_wakeup(&pdev->dev)) {
349 disable_irq_wake(board->det_pin);
350 if (board->irq_pin)
351 disable_irq_wake(board->irq_pin);
352 }
353
349 pcmcia_socket_dev_resume(&pdev->dev); 354 pcmcia_socket_dev_resume(&pdev->dev);
350 return 0; 355 return 0;
351} 356}
diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c
index 6085261aa2c1..e24ea82dc35b 100644
--- a/drivers/rtc/rtc-cmos.c
+++ b/drivers/rtc/rtc-cmos.c
@@ -641,9 +641,16 @@ cmos_pnp_probe(struct pnp_dev *pnp, const struct pnp_device_id *id)
641 * drivers can't provide shutdown() methods to disable IRQs. 641 * drivers can't provide shutdown() methods to disable IRQs.
642 * Or better yet, fix PNP to allow those methods... 642 * Or better yet, fix PNP to allow those methods...
643 */ 643 */
644 return cmos_do_probe(&pnp->dev, 644 if (pnp_port_start(pnp,0) == 0x70 && !pnp_irq_valid(pnp,0))
645 &pnp->res.port_resource[0], 645 /* Some machines contain a PNP entry for the RTC, but
646 pnp->res.irq_resource[0].start); 646 * don't define the IRQ. It should always be safe to
647 * hardcode it in these cases
648 */
649 return cmos_do_probe(&pnp->dev, &pnp->res.port_resource[0], 8);
650 else
651 return cmos_do_probe(&pnp->dev,
652 &pnp->res.port_resource[0],
653 pnp->res.irq_resource[0].start);
647} 654}
648 655
649static void __exit cmos_pnp_remove(struct pnp_dev *pnp) 656static void __exit cmos_pnp_remove(struct pnp_dev *pnp)
diff --git a/drivers/s390/block/dasd_eer.c b/drivers/s390/block/dasd_eer.c
index a1dc8c466ec9..0c081a664ee8 100644
--- a/drivers/s390/block/dasd_eer.c
+++ b/drivers/s390/block/dasd_eer.c
@@ -14,9 +14,9 @@
14#include <linux/moduleparam.h> 14#include <linux/moduleparam.h>
15#include <linux/device.h> 15#include <linux/device.h>
16#include <linux/poll.h> 16#include <linux/poll.h>
17#include <linux/mutex.h>
17 18
18#include <asm/uaccess.h> 19#include <asm/uaccess.h>
19#include <asm/semaphore.h>
20#include <asm/atomic.h> 20#include <asm/atomic.h>
21#include <asm/ebcdic.h> 21#include <asm/ebcdic.h>
22 22
@@ -514,7 +514,7 @@ void dasd_eer_disable(struct dasd_device *device)
514 * to transfer in a readbuffer, which is protected by the readbuffer_mutex. 514 * to transfer in a readbuffer, which is protected by the readbuffer_mutex.
515 */ 515 */
516static char readbuffer[PAGE_SIZE]; 516static char readbuffer[PAGE_SIZE];
517static DECLARE_MUTEX(readbuffer_mutex); 517static DEFINE_MUTEX(readbuffer_mutex);
518 518
519static int dasd_eer_open(struct inode *inp, struct file *filp) 519static int dasd_eer_open(struct inode *inp, struct file *filp)
520{ 520{
@@ -579,7 +579,7 @@ static ssize_t dasd_eer_read(struct file *filp, char __user *buf,
579 struct eerbuffer *eerb; 579 struct eerbuffer *eerb;
580 580
581 eerb = (struct eerbuffer *) filp->private_data; 581 eerb = (struct eerbuffer *) filp->private_data;
582 if (down_interruptible(&readbuffer_mutex)) 582 if (mutex_lock_interruptible(&readbuffer_mutex))
583 return -ERESTARTSYS; 583 return -ERESTARTSYS;
584 584
585 spin_lock_irqsave(&bufferlock, flags); 585 spin_lock_irqsave(&bufferlock, flags);
@@ -588,7 +588,7 @@ static ssize_t dasd_eer_read(struct file *filp, char __user *buf,
588 /* has been deleted */ 588 /* has been deleted */
589 eerb->residual = 0; 589 eerb->residual = 0;
590 spin_unlock_irqrestore(&bufferlock, flags); 590 spin_unlock_irqrestore(&bufferlock, flags);
591 up(&readbuffer_mutex); 591 mutex_unlock(&readbuffer_mutex);
592 return -EIO; 592 return -EIO;
593 } else if (eerb->residual > 0) { 593 } else if (eerb->residual > 0) {
594 /* OK we still have a second half of a record to deliver */ 594 /* OK we still have a second half of a record to deliver */
@@ -602,7 +602,7 @@ static ssize_t dasd_eer_read(struct file *filp, char __user *buf,
602 if (!tc) { 602 if (!tc) {
603 /* no data available */ 603 /* no data available */
604 spin_unlock_irqrestore(&bufferlock, flags); 604 spin_unlock_irqrestore(&bufferlock, flags);
605 up(&readbuffer_mutex); 605 mutex_unlock(&readbuffer_mutex);
606 if (filp->f_flags & O_NONBLOCK) 606 if (filp->f_flags & O_NONBLOCK)
607 return -EAGAIN; 607 return -EAGAIN;
608 rc = wait_event_interruptible( 608 rc = wait_event_interruptible(
@@ -610,7 +610,7 @@ static ssize_t dasd_eer_read(struct file *filp, char __user *buf,
610 eerb->head != eerb->tail); 610 eerb->head != eerb->tail);
611 if (rc) 611 if (rc)
612 return rc; 612 return rc;
613 if (down_interruptible(&readbuffer_mutex)) 613 if (mutex_lock_interruptible(&readbuffer_mutex))
614 return -ERESTARTSYS; 614 return -ERESTARTSYS;
615 spin_lock_irqsave(&bufferlock, flags); 615 spin_lock_irqsave(&bufferlock, flags);
616 } 616 }
@@ -626,11 +626,11 @@ static ssize_t dasd_eer_read(struct file *filp, char __user *buf,
626 spin_unlock_irqrestore(&bufferlock, flags); 626 spin_unlock_irqrestore(&bufferlock, flags);
627 627
628 if (copy_to_user(buf, readbuffer, effective_count)) { 628 if (copy_to_user(buf, readbuffer, effective_count)) {
629 up(&readbuffer_mutex); 629 mutex_unlock(&readbuffer_mutex);
630 return -EFAULT; 630 return -EFAULT;
631 } 631 }
632 632
633 up(&readbuffer_mutex); 633 mutex_unlock(&readbuffer_mutex);
634 return effective_count; 634 return effective_count;
635} 635}
636 636
diff --git a/drivers/s390/char/raw3270.c b/drivers/s390/char/raw3270.c
index f6ef90ee3e7d..743944ad61ec 100644
--- a/drivers/s390/char/raw3270.c
+++ b/drivers/s390/char/raw3270.c
@@ -487,7 +487,7 @@ struct raw3270_ua { /* Query Reply structure for Usable Area */
487} __attribute__ ((packed)); 487} __attribute__ ((packed));
488 488
489static struct diag210 raw3270_init_diag210; 489static struct diag210 raw3270_init_diag210;
490static DECLARE_MUTEX(raw3270_init_sem); 490static DEFINE_MUTEX(raw3270_init_mutex);
491 491
492static int 492static int
493raw3270_init_irq(struct raw3270_view *view, struct raw3270_request *rq, 493raw3270_init_irq(struct raw3270_view *view, struct raw3270_request *rq,
@@ -713,7 +713,7 @@ raw3270_size_device(struct raw3270 *rp)
713{ 713{
714 int rc; 714 int rc;
715 715
716 down(&raw3270_init_sem); 716 mutex_lock(&raw3270_init_mutex);
717 rp->view = &raw3270_init_view; 717 rp->view = &raw3270_init_view;
718 raw3270_init_view.dev = rp; 718 raw3270_init_view.dev = rp;
719 if (MACHINE_IS_VM) 719 if (MACHINE_IS_VM)
@@ -722,7 +722,7 @@ raw3270_size_device(struct raw3270 *rp)
722 rc = __raw3270_size_device(rp); 722 rc = __raw3270_size_device(rp);
723 raw3270_init_view.dev = NULL; 723 raw3270_init_view.dev = NULL;
724 rp->view = NULL; 724 rp->view = NULL;
725 up(&raw3270_init_sem); 725 mutex_unlock(&raw3270_init_mutex);
726 if (rc == 0) { /* Found something. */ 726 if (rc == 0) { /* Found something. */
727 /* Try to find a model. */ 727 /* Try to find a model. */
728 rp->model = 0; 728 rp->model = 0;
@@ -749,7 +749,7 @@ raw3270_reset_device(struct raw3270 *rp)
749{ 749{
750 int rc; 750 int rc;
751 751
752 down(&raw3270_init_sem); 752 mutex_lock(&raw3270_init_mutex);
753 memset(&rp->init_request, 0, sizeof(rp->init_request)); 753 memset(&rp->init_request, 0, sizeof(rp->init_request));
754 memset(&rp->init_data, 0, sizeof(rp->init_data)); 754 memset(&rp->init_data, 0, sizeof(rp->init_data));
755 /* Store reset data stream to init_data/init_request */ 755 /* Store reset data stream to init_data/init_request */
@@ -764,7 +764,7 @@ raw3270_reset_device(struct raw3270 *rp)
764 rc = raw3270_start_init(rp, &raw3270_init_view, &rp->init_request); 764 rc = raw3270_start_init(rp, &raw3270_init_view, &rp->init_request);
765 raw3270_init_view.dev = NULL; 765 raw3270_init_view.dev = NULL;
766 rp->view = NULL; 766 rp->view = NULL;
767 up(&raw3270_init_sem); 767 mutex_unlock(&raw3270_init_mutex);
768 return rc; 768 return rc;
769} 769}
770 770
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c
index a8b373f69cf0..6b264bdb5bfb 100644
--- a/drivers/s390/cio/device.c
+++ b/drivers/s390/cio/device.c
@@ -296,30 +296,57 @@ static void ccw_device_unregister(struct ccw_device *cdev)
296 device_del(&cdev->dev); 296 device_del(&cdev->dev);
297} 297}
298 298
299static void ccw_device_remove_orphan_cb(struct device *dev)
300{
301 struct ccw_device *cdev = to_ccwdev(dev);
302
303 ccw_device_unregister(cdev);
304 put_device(&cdev->dev);
305}
306
307static void ccw_device_remove_sch_cb(struct device *dev)
308{
309 struct subchannel *sch;
310
311 sch = to_subchannel(dev);
312 css_sch_device_unregister(sch);
313 /* Reset intparm to zeroes. */
314 sch->schib.pmcw.intparm = 0;
315 cio_modify(sch);
316 put_device(&sch->dev);
317}
318
299static void 319static void
300ccw_device_remove_disconnected(struct ccw_device *cdev) 320ccw_device_remove_disconnected(struct ccw_device *cdev)
301{ 321{
302 struct subchannel *sch;
303 unsigned long flags; 322 unsigned long flags;
323 int rc;
324
304 /* 325 /*
305 * Forced offline in disconnected state means 326 * Forced offline in disconnected state means
306 * 'throw away device'. 327 * 'throw away device'.
307 */ 328 */
308 if (ccw_device_is_orphan(cdev)) { 329 if (ccw_device_is_orphan(cdev)) {
309 /* Deregister ccw device. */ 330 /*
331 * Deregister ccw device.
332 * Unfortunately, we cannot do this directly from the
333 * attribute method.
334 */
310 spin_lock_irqsave(cdev->ccwlock, flags); 335 spin_lock_irqsave(cdev->ccwlock, flags);
311 cdev->private->state = DEV_STATE_NOT_OPER; 336 cdev->private->state = DEV_STATE_NOT_OPER;
312 spin_unlock_irqrestore(cdev->ccwlock, flags); 337 spin_unlock_irqrestore(cdev->ccwlock, flags);
313 ccw_device_unregister(cdev); 338 rc = device_schedule_callback(&cdev->dev,
314 put_device(&cdev->dev); 339 ccw_device_remove_orphan_cb);
315 return ; 340 if (rc)
341 dev_info(&cdev->dev, "Couldn't unregister orphan\n");
342 return;
316 } 343 }
317 sch = to_subchannel(cdev->dev.parent); 344 /* Deregister subchannel, which will kill the ccw device. */
318 css_sch_device_unregister(sch); 345 rc = device_schedule_callback(cdev->dev.parent,
319 /* Reset intparm to zeroes. */ 346 ccw_device_remove_sch_cb);
320 sch->schib.pmcw.intparm = 0; 347 if (rc)
321 cio_modify(sch); 348 dev_info(&cdev->dev,
322 put_device(&sch->dev); 349 "Couldn't unregister disconnected device\n");
323} 350}
324 351
325int 352int
diff --git a/drivers/s390/cio/device_fsm.c b/drivers/s390/cio/device_fsm.c
index 898ec3b2bebb..6bba80929577 100644
--- a/drivers/s390/cio/device_fsm.c
+++ b/drivers/s390/cio/device_fsm.c
@@ -688,6 +688,12 @@ ccw_device_disband_done(struct ccw_device *cdev, int err)
688 ccw_device_done(cdev, DEV_STATE_BOXED); 688 ccw_device_done(cdev, DEV_STATE_BOXED);
689 break; 689 break;
690 default: 690 default:
691 cdev->private->flags.donotify = 0;
692 if (get_device(&cdev->dev)) {
693 PREPARE_WORK(&cdev->private->kick_work,
694 ccw_device_call_sch_unregister);
695 queue_work(ccw_device_work, &cdev->private->kick_work);
696 }
691 ccw_device_done(cdev, DEV_STATE_NOT_OPER); 697 ccw_device_done(cdev, DEV_STATE_NOT_OPER);
692 break; 698 break;
693 } 699 }
diff --git a/drivers/sbus/char/flash.c b/drivers/sbus/char/flash.c
index 262f01e68592..44e039865aa9 100644
--- a/drivers/sbus/char/flash.c
+++ b/drivers/sbus/char/flash.c
@@ -14,6 +14,7 @@
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/smp_lock.h> 15#include <linux/smp_lock.h>
16#include <linux/spinlock.h> 16#include <linux/spinlock.h>
17#include <linux/mm.h>
17 18
18#include <asm/system.h> 19#include <asm/system.h>
19#include <asm/uaccess.h> 20#include <asm/uaccess.h>
diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c
index bb3cb3360541..88ea5a1fb606 100644
--- a/drivers/scsi/NCR5380.c
+++ b/drivers/scsi/NCR5380.c
@@ -2625,7 +2625,7 @@ static void NCR5380_reselect(struct Scsi_Host *instance) {
2625#ifdef REAL_DMA 2625#ifdef REAL_DMA
2626static void NCR5380_dma_complete(NCR5380_instance * instance) { 2626static void NCR5380_dma_complete(NCR5380_instance * instance) {
2627 NCR5380_local_declare(); 2627 NCR5380_local_declare();
2628 struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata * instance->hostdata); 2628 struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata *) instance->hostdata;
2629 int transferred; 2629 int transferred;
2630 NCR5380_setup(instance); 2630 NCR5380_setup(instance);
2631 2631
diff --git a/drivers/scsi/aic7xxx/aic79xx_core.c b/drivers/scsi/aic7xxx/aic79xx_core.c
index 9ddc6e4a74b0..05f692bd0adc 100644
--- a/drivers/scsi/aic7xxx/aic79xx_core.c
+++ b/drivers/scsi/aic7xxx/aic79xx_core.c
@@ -5180,7 +5180,7 @@ ahd_handle_devreset(struct ahd_softc *ahd, struct ahd_devinfo *devinfo,
5180 cur_lun = lun; 5180 cur_lun = lun;
5181 max_lun = lun; 5181 max_lun = lun;
5182 } 5182 }
5183 for (cur_lun <= max_lun; cur_lun++) { 5183 for (;cur_lun <= max_lun; cur_lun++) {
5184 struct ahd_tmode_lstate* lstate; 5184 struct ahd_tmode_lstate* lstate;
5185 5185
5186 lstate = tstate->enabled_luns[cur_lun]; 5186 lstate = tstate->enabled_luns[cur_lun];
diff --git a/drivers/serial/amba-pl010.c b/drivers/serial/amba-pl010.c
index 1a9a24b82636..00d1255e4c12 100644
--- a/drivers/serial/amba-pl010.c
+++ b/drivers/serial/amba-pl010.c
@@ -167,8 +167,9 @@ static void pl010_rx_chars(struct uart_amba_port *uap)
167 ignore_char: 167 ignore_char:
168 status = readb(uap->port.membase + UART01x_FR); 168 status = readb(uap->port.membase + UART01x_FR);
169 } 169 }
170 spin_unlock(&port->lock);
170 tty_flip_buffer_push(tty); 171 tty_flip_buffer_push(tty);
171 return; 172 spin_lock(&port->lock);
172} 173}
173 174
174static void pl010_tx_chars(struct uart_amba_port *uap) 175static void pl010_tx_chars(struct uart_amba_port *uap)
diff --git a/drivers/serial/amba-pl011.c b/drivers/serial/amba-pl011.c
index 44639e71372a..954073c6ce3a 100644
--- a/drivers/serial/amba-pl011.c
+++ b/drivers/serial/amba-pl011.c
@@ -153,8 +153,9 @@ static void pl011_rx_chars(struct uart_amba_port *uap)
153 ignore_char: 153 ignore_char:
154 status = readw(uap->port.membase + UART01x_FR); 154 status = readw(uap->port.membase + UART01x_FR);
155 } 155 }
156 spin_unlock(&uap->port.lock);
156 tty_flip_buffer_push(tty); 157 tty_flip_buffer_push(tty);
157 return; 158 spin_lock(&uap->port.lock);
158} 159}
159 160
160static void pl011_tx_chars(struct uart_amba_port *uap) 161static void pl011_tx_chars(struct uart_amba_port *uap)
diff --git a/drivers/serial/serial_ks8695.c b/drivers/serial/serial_ks8695.c
index 698763b28ddd..8721afe1ae4f 100644
--- a/drivers/serial/serial_ks8695.c
+++ b/drivers/serial/serial_ks8695.c
@@ -589,7 +589,7 @@ static int __init ks8695_console_setup(struct console *co, char *options)
589 return uart_set_options(port, co, baud, parity, bits, flow); 589 return uart_set_options(port, co, baud, parity, bits, flow);
590} 590}
591 591
592extern struct uart_driver ks8695_reg; 592static struct uart_driver ks8695_reg;
593 593
594static struct console ks8695_console = { 594static struct console ks8695_console = {
595 .name = SERIAL_KS8695_DEVNAME, 595 .name = SERIAL_KS8695_DEVNAME,
diff --git a/drivers/spi/atmel_spi.c b/drivers/spi/atmel_spi.c
index 1d8a2f6bb8eb..8b2601de3630 100644
--- a/drivers/spi/atmel_spi.c
+++ b/drivers/spi/atmel_spi.c
@@ -113,16 +113,16 @@ static void atmel_spi_next_xfer(struct spi_master *master,
113 113
114 len = as->remaining_bytes; 114 len = as->remaining_bytes;
115 115
116 tx_dma = xfer->tx_dma; 116 tx_dma = xfer->tx_dma + xfer->len - len;
117 rx_dma = xfer->rx_dma; 117 rx_dma = xfer->rx_dma + xfer->len - len;
118 118
119 /* use scratch buffer only when rx or tx data is unspecified */ 119 /* use scratch buffer only when rx or tx data is unspecified */
120 if (rx_dma == INVALID_DMA_ADDRESS) { 120 if (!xfer->rx_buf) {
121 rx_dma = as->buffer_dma; 121 rx_dma = as->buffer_dma;
122 if (len > BUFFER_SIZE) 122 if (len > BUFFER_SIZE)
123 len = BUFFER_SIZE; 123 len = BUFFER_SIZE;
124 } 124 }
125 if (tx_dma == INVALID_DMA_ADDRESS) { 125 if (!xfer->tx_buf) {
126 tx_dma = as->buffer_dma; 126 tx_dma = as->buffer_dma;
127 if (len > BUFFER_SIZE) 127 if (len > BUFFER_SIZE)
128 len = BUFFER_SIZE; 128 len = BUFFER_SIZE;
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index c3219b29b5ac..4831edbae2d5 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -411,7 +411,7 @@ EXPORT_SYMBOL_GPL(spi_alloc_master);
411 */ 411 */
412int spi_register_master(struct spi_master *master) 412int spi_register_master(struct spi_master *master)
413{ 413{
414 static atomic_t dyn_bus_id = ATOMIC_INIT((1<<16) - 1); 414 static atomic_t dyn_bus_id = ATOMIC_INIT((1<<15) - 1);
415 struct device *dev = master->cdev.dev; 415 struct device *dev = master->cdev.dev;
416 int status = -ENODEV; 416 int status = -ENODEV;
417 int dynamic = 0; 417 int dynamic = 0;
diff --git a/drivers/spi/spi_imx.c b/drivers/spi/spi_imx.c
index 51daa212c6b7..656be4a5094a 100644
--- a/drivers/spi/spi_imx.c
+++ b/drivers/spi/spi_imx.c
@@ -121,7 +121,7 @@
121 32.768 KHz Clock */ 121 32.768 KHz Clock */
122 122
123/* SPI DMA Register Bit Fields & Masks */ 123/* SPI DMA Register Bit Fields & Masks */
124#define SPI_DMA_RHDMA (0xF << 4) /* RXFIFO Half Status */ 124#define SPI_DMA_RHDMA (0x1 << 4) /* RXFIFO Half Status */
125#define SPI_DMA_RFDMA (0x1 << 5) /* RXFIFO Full Status */ 125#define SPI_DMA_RFDMA (0x1 << 5) /* RXFIFO Full Status */
126#define SPI_DMA_TEDMA (0x1 << 6) /* TXFIFO Empty Status */ 126#define SPI_DMA_TEDMA (0x1 << 6) /* TXFIFO Empty Status */
127#define SPI_DMA_THDMA (0x1 << 7) /* TXFIFO Half Status */ 127#define SPI_DMA_THDMA (0x1 << 7) /* TXFIFO Half Status */
@@ -1355,6 +1355,7 @@ static int setup(struct spi_device *spi)
1355 spi->bits_per_word, 1355 spi->bits_per_word,
1356 spi_speed_hz(SPI_CONTROL_DATARATE_MIN), 1356 spi_speed_hz(SPI_CONTROL_DATARATE_MIN),
1357 spi->max_speed_hz); 1357 spi->max_speed_hz);
1358 return status;
1358 1359
1359err_first_setup: 1360err_first_setup:
1360 kfree(chip); 1361 kfree(chip);
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 6e1f1ea21b38..403dac787ebf 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -755,7 +755,7 @@ config FB_LEO
755 755
756config FB_IGA 756config FB_IGA
757 bool "IGA 168x display support" 757 bool "IGA 168x display support"
758 depends on FB && SPARC32 758 depends on (FB = y) && SPARC32
759 select FB_CFB_FILLRECT 759 select FB_CFB_FILLRECT
760 select FB_CFB_COPYAREA 760 select FB_CFB_COPYAREA
761 select FB_CFB_IMAGEBLIT 761 select FB_CFB_IMAGEBLIT
@@ -765,7 +765,7 @@ config FB_IGA
765 765
766config FB_XVR500 766config FB_XVR500
767 bool "Sun XVR-500 3DLABS Wildcat support" 767 bool "Sun XVR-500 3DLABS Wildcat support"
768 depends on FB && PCI && SPARC64 768 depends on (FB = y) && PCI && SPARC64
769 select FB_CFB_FILLRECT 769 select FB_CFB_FILLRECT
770 select FB_CFB_COPYAREA 770 select FB_CFB_COPYAREA
771 select FB_CFB_IMAGEBLIT 771 select FB_CFB_IMAGEBLIT
@@ -778,7 +778,7 @@ config FB_XVR500
778 778
779config FB_XVR2500 779config FB_XVR2500
780 bool "Sun XVR-2500 3DLABS Wildcat support" 780 bool "Sun XVR-2500 3DLABS Wildcat support"
781 depends on FB && PCI && SPARC64 781 depends on (FB = y) && PCI && SPARC64
782 select FB_CFB_FILLRECT 782 select FB_CFB_FILLRECT
783 select FB_CFB_COPYAREA 783 select FB_CFB_COPYAREA
784 select FB_CFB_IMAGEBLIT 784 select FB_CFB_IMAGEBLIT
diff --git a/drivers/video/arkfb.c b/drivers/video/arkfb.c
index ba6fede5c466..8a1b07c74394 100644
--- a/drivers/video/arkfb.c
+++ b/drivers/video/arkfb.c
@@ -1055,9 +1055,10 @@ err_enable_device:
1055static void __devexit ark_pci_remove(struct pci_dev *dev) 1055static void __devexit ark_pci_remove(struct pci_dev *dev)
1056{ 1056{
1057 struct fb_info *info = pci_get_drvdata(dev); 1057 struct fb_info *info = pci_get_drvdata(dev);
1058 struct arkfb_info *par = info->par;
1059 1058
1060 if (info) { 1059 if (info) {
1060 struct arkfb_info *par = info->par;
1061
1061#ifdef CONFIG_MTRR 1062#ifdef CONFIG_MTRR
1062 if (par->mtrr_reg >= 0) { 1063 if (par->mtrr_reg >= 0) {
1063 mtrr_del(par->mtrr_reg, 0, 0); 1064 mtrr_del(par->mtrr_reg, 0, 0);
diff --git a/drivers/video/console/fbcon.h b/drivers/video/console/fbcon.h
index 71f24e00fcd0..8e6ef4bc7a5c 100644
--- a/drivers/video/console/fbcon.h
+++ b/drivers/video/console/fbcon.h
@@ -176,7 +176,6 @@ extern void fbcon_set_tileops(struct vc_data *vc, struct fb_info *info);
176#endif 176#endif
177extern void fbcon_set_bitops(struct fbcon_ops *ops); 177extern void fbcon_set_bitops(struct fbcon_ops *ops);
178extern int soft_cursor(struct fb_info *info, struct fb_cursor *cursor); 178extern int soft_cursor(struct fb_info *info, struct fb_cursor *cursor);
179extern struct class *fb_class;
180 179
181#define FBCON_ATTRIBUTE_UNDERLINE 1 180#define FBCON_ATTRIBUTE_UNDERLINE 1
182#define FBCON_ATTRIBUTE_REVERSE 2 181#define FBCON_ATTRIBUTE_REVERSE 2
diff --git a/drivers/video/neofb.c b/drivers/video/neofb.c
index bd30aba242d0..731d7a5c5aa2 100644
--- a/drivers/video/neofb.c
+++ b/drivers/video/neofb.c
@@ -1286,34 +1286,36 @@ static int neofb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
1286 if (regno >= fb->cmap.len || regno > 255) 1286 if (regno >= fb->cmap.len || regno > 255)
1287 return -EINVAL; 1287 return -EINVAL;
1288 1288
1289 switch (fb->var.bits_per_pixel) { 1289 if (fb->var.bits_per_pixel <= 8) {
1290 case 8:
1291 outb(regno, 0x3c8); 1290 outb(regno, 0x3c8);
1292 1291
1293 outb(red >> 10, 0x3c9); 1292 outb(red >> 10, 0x3c9);
1294 outb(green >> 10, 0x3c9); 1293 outb(green >> 10, 0x3c9);
1295 outb(blue >> 10, 0x3c9); 1294 outb(blue >> 10, 0x3c9);
1296 break; 1295 } else if (regno < 16) {
1297 case 16: 1296 switch (fb->var.bits_per_pixel) {
1298 ((u32 *) fb->pseudo_palette)[regno] = 1297 case 16:
1298 ((u32 *) fb->pseudo_palette)[regno] =
1299 ((red & 0xf800)) | ((green & 0xfc00) >> 5) | 1299 ((red & 0xf800)) | ((green & 0xfc00) >> 5) |
1300 ((blue & 0xf800) >> 11); 1300 ((blue & 0xf800) >> 11);
1301 break; 1301 break;
1302 case 24: 1302 case 24:
1303 ((u32 *) fb->pseudo_palette)[regno] = 1303 ((u32 *) fb->pseudo_palette)[regno] =
1304 ((red & 0xff00) << 8) | ((green & 0xff00)) | 1304 ((red & 0xff00) << 8) | ((green & 0xff00)) |
1305 ((blue & 0xff00) >> 8); 1305 ((blue & 0xff00) >> 8);
1306 break; 1306 break;
1307#ifdef NO_32BIT_SUPPORT_YET 1307#ifdef NO_32BIT_SUPPORT_YET
1308 case 32: 1308 case 32:
1309 ((u32 *) fb->pseudo_palette)[regno] = 1309 ((u32 *) fb->pseudo_palette)[regno] =
1310 ((transp & 0xff00) << 16) | ((red & 0xff00) << 8) | 1310 ((transp & 0xff00) << 16) | ((red & 0xff00) << 8) |
1311 ((green & 0xff00)) | ((blue & 0xff00) >> 8); 1311 ((green & 0xff00)) | ((blue & 0xff00) >> 8);
1312 break; 1312 break;
1313#endif 1313#endif
1314 default: 1314 default:
1315 return 1; 1315 return 1;
1316 }
1316 } 1317 }
1318
1317 return 0; 1319 return 0;
1318} 1320}
1319 1321
diff --git a/drivers/video/pm3fb.c b/drivers/video/pm3fb.c
index 616a0c08e30c..b52e883f0a52 100644
--- a/drivers/video/pm3fb.c
+++ b/drivers/video/pm3fb.c
@@ -498,7 +498,7 @@ static int pm3fb_set_par(struct fb_info *info)
498 else 498 else
499 par->video |= PM3VideoControl_LINE_DOUBLE_OFF; 499 par->video |= PM3VideoControl_LINE_DOUBLE_OFF;
500 500
501 if (info->var.activate == FB_ACTIVATE_NOW) 501 if ((info->var.activate & FB_ACTIVATE_MASK) == FB_ACTIVATE_NOW)
502 par->video |= PM3VideoControl_ENABLE; 502 par->video |= PM3VideoControl_ENABLE;
503 else { 503 else {
504 par->video |= PM3VideoControl_DISABLE; 504 par->video |= PM3VideoControl_DISABLE;
diff --git a/drivers/video/skeletonfb.c b/drivers/video/skeletonfb.c
index 836a612af977..64779e70408f 100644
--- a/drivers/video/skeletonfb.c
+++ b/drivers/video/skeletonfb.c
@@ -132,7 +132,6 @@ static struct fb_info info;
132static struct xxx_par __initdata current_par; 132static struct xxx_par __initdata current_par;
133 133
134int xxxfb_init(void); 134int xxxfb_init(void);
135int xxxfb_setup(char*);
136 135
137/** 136/**
138 * xxxfb_open - Optional function. Called when the framebuffer is 137 * xxxfb_open - Optional function. Called when the framebuffer is
@@ -975,6 +974,21 @@ static struct platform_device xxxfb_device = {
975 .name = "xxxfb", 974 .name = "xxxfb",
976}; 975};
977 976
977#ifndef MODULE
978 /*
979 * Setup
980 */
981
982/*
983 * Only necessary if your driver takes special options,
984 * otherwise we fall back on the generic fb_setup().
985 */
986int __init xxxfb_setup(char *options)
987{
988 /* Parse user speficied options (`video=xxxfb:') */
989}
990#endif /* MODULE */
991
978static int __init xxxfb_init(void) 992static int __init xxxfb_init(void)
979{ 993{
980 int ret; 994 int ret;
@@ -1006,21 +1020,6 @@ static void __exit xxxfb_exit(void)
1006} 1020}
1007#endif /* CONFIG_PCI */ 1021#endif /* CONFIG_PCI */
1008 1022
1009#ifdef MODULE
1010 /*
1011 * Setup
1012 */
1013
1014/*
1015 * Only necessary if your driver takes special options,
1016 * otherwise we fall back on the generic fb_setup().
1017 */
1018int __init xxxfb_setup(char *options)
1019{
1020 /* Parse user speficied options (`video=xxxfb:') */
1021}
1022#endif /* MODULE */
1023
1024/* ------------------------------------------------------------------------- */ 1023/* ------------------------------------------------------------------------- */
1025 1024
1026 1025
diff --git a/drivers/video/vt8623fb.c b/drivers/video/vt8623fb.c
index 5e9755e464a1..30c0b948852b 100644
--- a/drivers/video/vt8623fb.c
+++ b/drivers/video/vt8623fb.c
@@ -778,9 +778,10 @@ err_enable_device:
778static void __devexit vt8623_pci_remove(struct pci_dev *dev) 778static void __devexit vt8623_pci_remove(struct pci_dev *dev)
779{ 779{
780 struct fb_info *info = pci_get_drvdata(dev); 780 struct fb_info *info = pci_get_drvdata(dev);
781 struct vt8623fb_info *par = info->par;
782 781
783 if (info) { 782 if (info) {
783 struct vt8623fb_info *par = info->par;
784
784#ifdef CONFIG_MTRR 785#ifdef CONFIG_MTRR
785 if (par->mtrr_reg >= 0) { 786 if (par->mtrr_reg >= 0) {
786 mtrr_del(par->mtrr_reg, 0, 0); 787 mtrr_del(par->mtrr_reg, 0, 0);