aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/atm/fore200e.c36
-rw-r--r--drivers/block/DAC960.c3
-rw-r--r--drivers/char/mmtimer.c2
-rw-r--r--drivers/edac/Kconfig18
-rw-r--r--drivers/edac/edac_mc.c12
-rw-r--r--drivers/firmware/dcdbas.c8
-rw-r--r--drivers/infiniband/ulp/srp/ib_srp.c6
-rw-r--r--drivers/input/mouse/psmouse-base.c2
-rw-r--r--drivers/isdn/hisax/config.c2
-rw-r--r--drivers/isdn/hisax/hfc_pci.c2
-rw-r--r--drivers/isdn/hisax/hfc_usb.c32
-rw-r--r--drivers/isdn/i4l/isdn_tty.c1
-rw-r--r--drivers/macintosh/windfarm_core.c7
-rw-r--r--drivers/macintosh/windfarm_cpufreq_clamp.c8
-rw-r--r--drivers/macintosh/windfarm_lm75_sensor.c32
-rw-r--r--drivers/macintosh/windfarm_max6690_sensor.c25
-rw-r--r--drivers/macintosh/windfarm_pid.c4
-rw-r--r--drivers/macintosh/windfarm_pm112.c8
-rw-r--r--drivers/md/raid1.c13
-rw-r--r--drivers/media/dvb/b2c2/flexcop-fe-tuner.c2
-rw-r--r--drivers/media/dvb/bt8xx/bt878.c2
-rw-r--r--drivers/media/dvb/bt8xx/dst.c2
-rw-r--r--drivers/media/dvb/dvb-core/demux.h2
-rw-r--r--drivers/media/dvb/dvb-usb/cxusb.c8
-rw-r--r--drivers/media/dvb/dvb-usb/dvb-usb-init.c2
-rw-r--r--drivers/media/dvb/dvb-usb/dvb-usb.h2
-rw-r--r--drivers/media/dvb/frontends/Kconfig2
-rw-r--r--drivers/media/dvb/frontends/mt312.c116
-rw-r--r--drivers/media/dvb/frontends/mt312.h6
-rw-r--r--drivers/media/dvb/frontends/stv0297.c4
-rw-r--r--drivers/media/dvb/ttpci/av7110.c9
-rw-r--r--drivers/media/dvb/ttpci/av7110_hw.c3
-rw-r--r--drivers/media/dvb/ttpci/av7110_ir.c4
-rw-r--r--drivers/media/video/cpia.c2
-rw-r--r--drivers/media/video/cx25840/cx25840-core.c4
-rw-r--r--drivers/media/video/saa7115.c4
-rw-r--r--drivers/media/video/saa7134/saa7134-alsa.c4
-rw-r--r--drivers/media/video/saa7134/saa7134-cards.c21
-rw-r--r--drivers/media/video/saa7134/saa7134-dvb.c12
-rw-r--r--drivers/media/video/tda8290.c8
-rw-r--r--drivers/media/video/tuner-core.c5
-rw-r--r--drivers/media/video/videocodec.h2
-rw-r--r--drivers/media/video/zr36050.c2
-rw-r--r--drivers/media/video/zr36060.c2
-rw-r--r--drivers/media/video/zr36120_i2c.c2
-rw-r--r--drivers/misc/ibmasm/ibmasm.h9
-rw-r--r--drivers/net/3c509.c13
-rw-r--r--drivers/net/Kconfig3
-rw-r--r--drivers/net/de620.c2
-rw-r--r--drivers/net/dl2k.c25
-rw-r--r--drivers/net/e1000/e1000_main.c2
-rw-r--r--drivers/net/sky2.c32
-rw-r--r--drivers/net/tg3.c87
-rw-r--r--drivers/net/tulip/de2104x.c26
-rw-r--r--drivers/parport/parport_serial.c11
-rw-r--r--drivers/pcmcia/ds.c2
-rw-r--r--drivers/s390/block/dasd.c38
-rw-r--r--drivers/s390/block/dasd_genhd.c2
-rw-r--r--drivers/s390/block/dasd_int.h7
-rw-r--r--drivers/s390/block/dasd_proc.c3
-rw-r--r--drivers/s390/cio/chsc.c5
-rw-r--r--drivers/s390/net/smsgiucv.c2
-rw-r--r--drivers/scsi/sr_ioctl.c2
-rw-r--r--drivers/serial/ioc4_serial.c6
-rw-r--r--drivers/serial/ip22zilog.c4
-rw-r--r--drivers/serial/serial_core.c32
-rw-r--r--drivers/serial/sn_console.c2
-rw-r--r--drivers/usb/serial/usb-serial.c10
-rw-r--r--drivers/video/arcfb.c5
-rw-r--r--drivers/video/aty/aty128fb.c7
-rw-r--r--drivers/video/aty/radeon_monitor.c4
-rw-r--r--drivers/video/backlight/backlight.c2
-rw-r--r--drivers/video/backlight/lcd.c2
-rw-r--r--drivers/video/imsttfb.c2
-rw-r--r--drivers/video/intelfb/intelfbdrv.c50
-rw-r--r--drivers/video/kyro/STG4000VTG.c2
-rw-r--r--drivers/video/neofb.c4
-rw-r--r--drivers/video/s1d13xxxfb.c3
-rw-r--r--drivers/video/savage/savagefb_driver.c2
-rw-r--r--drivers/video/tdfxfb.c42
80 files changed, 537 insertions, 366 deletions
diff --git a/drivers/atm/fore200e.c b/drivers/atm/fore200e.c
index 14f6a6201da3..05983a312d50 100644
--- a/drivers/atm/fore200e.c
+++ b/drivers/atm/fore200e.c
@@ -555,7 +555,7 @@ fore200e_pca_reset(struct fore200e* fore200e)
555} 555}
556 556
557 557
558static int __init 558static int __devinit
559fore200e_pca_map(struct fore200e* fore200e) 559fore200e_pca_map(struct fore200e* fore200e)
560{ 560{
561 DPRINTK(2, "device %s being mapped in memory\n", fore200e->name); 561 DPRINTK(2, "device %s being mapped in memory\n", fore200e->name);
@@ -589,7 +589,7 @@ fore200e_pca_unmap(struct fore200e* fore200e)
589} 589}
590 590
591 591
592static int __init 592static int __devinit
593fore200e_pca_configure(struct fore200e* fore200e) 593fore200e_pca_configure(struct fore200e* fore200e)
594{ 594{
595 struct pci_dev* pci_dev = (struct pci_dev*)fore200e->bus_dev; 595 struct pci_dev* pci_dev = (struct pci_dev*)fore200e->bus_dev;
@@ -2125,7 +2125,7 @@ fore200e_change_qos(struct atm_vcc* vcc,struct atm_qos* qos, int flags)
2125} 2125}
2126 2126
2127 2127
2128static int __init 2128static int __devinit
2129fore200e_irq_request(struct fore200e* fore200e) 2129fore200e_irq_request(struct fore200e* fore200e)
2130{ 2130{
2131 if (request_irq(fore200e->irq, fore200e_interrupt, SA_SHIRQ, fore200e->name, fore200e->atm_dev) < 0) { 2131 if (request_irq(fore200e->irq, fore200e_interrupt, SA_SHIRQ, fore200e->name, fore200e->atm_dev) < 0) {
@@ -2148,7 +2148,7 @@ fore200e_irq_request(struct fore200e* fore200e)
2148} 2148}
2149 2149
2150 2150
2151static int __init 2151static int __devinit
2152fore200e_get_esi(struct fore200e* fore200e) 2152fore200e_get_esi(struct fore200e* fore200e)
2153{ 2153{
2154 struct prom_data* prom = fore200e_kmalloc(sizeof(struct prom_data), GFP_KERNEL | GFP_DMA); 2154 struct prom_data* prom = fore200e_kmalloc(sizeof(struct prom_data), GFP_KERNEL | GFP_DMA);
@@ -2180,7 +2180,7 @@ fore200e_get_esi(struct fore200e* fore200e)
2180} 2180}
2181 2181
2182 2182
2183static int __init 2183static int __devinit
2184fore200e_alloc_rx_buf(struct fore200e* fore200e) 2184fore200e_alloc_rx_buf(struct fore200e* fore200e)
2185{ 2185{
2186 int scheme, magn, nbr, size, i; 2186 int scheme, magn, nbr, size, i;
@@ -2245,7 +2245,7 @@ fore200e_alloc_rx_buf(struct fore200e* fore200e)
2245} 2245}
2246 2246
2247 2247
2248static int __init 2248static int __devinit
2249fore200e_init_bs_queue(struct fore200e* fore200e) 2249fore200e_init_bs_queue(struct fore200e* fore200e)
2250{ 2250{
2251 int scheme, magn, i; 2251 int scheme, magn, i;
@@ -2308,7 +2308,7 @@ fore200e_init_bs_queue(struct fore200e* fore200e)
2308} 2308}
2309 2309
2310 2310
2311static int __init 2311static int __devinit
2312fore200e_init_rx_queue(struct fore200e* fore200e) 2312fore200e_init_rx_queue(struct fore200e* fore200e)
2313{ 2313{
2314 struct host_rxq* rxq = &fore200e->host_rxq; 2314 struct host_rxq* rxq = &fore200e->host_rxq;
@@ -2368,7 +2368,7 @@ fore200e_init_rx_queue(struct fore200e* fore200e)
2368} 2368}
2369 2369
2370 2370
2371static int __init 2371static int __devinit
2372fore200e_init_tx_queue(struct fore200e* fore200e) 2372fore200e_init_tx_queue(struct fore200e* fore200e)
2373{ 2373{
2374 struct host_txq* txq = &fore200e->host_txq; 2374 struct host_txq* txq = &fore200e->host_txq;
@@ -2431,7 +2431,7 @@ fore200e_init_tx_queue(struct fore200e* fore200e)
2431} 2431}
2432 2432
2433 2433
2434static int __init 2434static int __devinit
2435fore200e_init_cmd_queue(struct fore200e* fore200e) 2435fore200e_init_cmd_queue(struct fore200e* fore200e)
2436{ 2436{
2437 struct host_cmdq* cmdq = &fore200e->host_cmdq; 2437 struct host_cmdq* cmdq = &fore200e->host_cmdq;
@@ -2487,7 +2487,7 @@ fore200e_param_bs_queue(struct fore200e* fore200e,
2487} 2487}
2488 2488
2489 2489
2490static int __init 2490static int __devinit
2491fore200e_initialize(struct fore200e* fore200e) 2491fore200e_initialize(struct fore200e* fore200e)
2492{ 2492{
2493 struct cp_queues __iomem * cpq; 2493 struct cp_queues __iomem * cpq;
@@ -2539,7 +2539,7 @@ fore200e_initialize(struct fore200e* fore200e)
2539} 2539}
2540 2540
2541 2541
2542static void __init 2542static void __devinit
2543fore200e_monitor_putc(struct fore200e* fore200e, char c) 2543fore200e_monitor_putc(struct fore200e* fore200e, char c)
2544{ 2544{
2545 struct cp_monitor __iomem * monitor = fore200e->cp_monitor; 2545 struct cp_monitor __iomem * monitor = fore200e->cp_monitor;
@@ -2551,7 +2551,7 @@ fore200e_monitor_putc(struct fore200e* fore200e, char c)
2551} 2551}
2552 2552
2553 2553
2554static int __init 2554static int __devinit
2555fore200e_monitor_getc(struct fore200e* fore200e) 2555fore200e_monitor_getc(struct fore200e* fore200e)
2556{ 2556{
2557 struct cp_monitor __iomem * monitor = fore200e->cp_monitor; 2557 struct cp_monitor __iomem * monitor = fore200e->cp_monitor;
@@ -2576,7 +2576,7 @@ fore200e_monitor_getc(struct fore200e* fore200e)
2576} 2576}
2577 2577
2578 2578
2579static void __init 2579static void __devinit
2580fore200e_monitor_puts(struct fore200e* fore200e, char* str) 2580fore200e_monitor_puts(struct fore200e* fore200e, char* str)
2581{ 2581{
2582 while (*str) { 2582 while (*str) {
@@ -2591,7 +2591,7 @@ fore200e_monitor_puts(struct fore200e* fore200e, char* str)
2591} 2591}
2592 2592
2593 2593
2594static int __init 2594static int __devinit
2595fore200e_start_fw(struct fore200e* fore200e) 2595fore200e_start_fw(struct fore200e* fore200e)
2596{ 2596{
2597 int ok; 2597 int ok;
@@ -2622,7 +2622,7 @@ fore200e_start_fw(struct fore200e* fore200e)
2622} 2622}
2623 2623
2624 2624
2625static int __init 2625static int __devinit
2626fore200e_load_fw(struct fore200e* fore200e) 2626fore200e_load_fw(struct fore200e* fore200e)
2627{ 2627{
2628 u32* fw_data = (u32*) fore200e->bus->fw_data; 2628 u32* fw_data = (u32*) fore200e->bus->fw_data;
@@ -2648,7 +2648,7 @@ fore200e_load_fw(struct fore200e* fore200e)
2648} 2648}
2649 2649
2650 2650
2651static int __init 2651static int __devinit
2652fore200e_register(struct fore200e* fore200e) 2652fore200e_register(struct fore200e* fore200e)
2653{ 2653{
2654 struct atm_dev* atm_dev; 2654 struct atm_dev* atm_dev;
@@ -2675,7 +2675,7 @@ fore200e_register(struct fore200e* fore200e)
2675} 2675}
2676 2676
2677 2677
2678static int __init 2678static int __devinit
2679fore200e_init(struct fore200e* fore200e) 2679fore200e_init(struct fore200e* fore200e)
2680{ 2680{
2681 if (fore200e_register(fore200e) < 0) 2681 if (fore200e_register(fore200e) < 0)
@@ -2721,7 +2721,7 @@ fore200e_init(struct fore200e* fore200e)
2721 return -EBUSY; 2721 return -EBUSY;
2722 2722
2723 fore200e_supply(fore200e); 2723 fore200e_supply(fore200e);
2724 2724
2725 /* all done, board initialization is now complete */ 2725 /* all done, board initialization is now complete */
2726 fore200e->state = FORE200E_STATE_COMPLETE; 2726 fore200e->state = FORE200E_STATE_COMPLETE;
2727 return 0; 2727 return 0;
diff --git a/drivers/block/DAC960.c b/drivers/block/DAC960.c
index 6ede1f352c29..37b8cda3e8bc 100644
--- a/drivers/block/DAC960.c
+++ b/drivers/block/DAC960.c
@@ -41,6 +41,7 @@
41#include <linux/timer.h> 41#include <linux/timer.h>
42#include <linux/pci.h> 42#include <linux/pci.h>
43#include <linux/init.h> 43#include <linux/init.h>
44#include <linux/random.h>
44#include <asm/io.h> 45#include <asm/io.h>
45#include <asm/uaccess.h> 46#include <asm/uaccess.h>
46#include "DAC960.h" 47#include "DAC960.h"
@@ -3463,7 +3464,7 @@ static inline boolean DAC960_ProcessCompletedRequest(DAC960_Command_T *Command,
3463 Command->SegmentCount, Command->DmaDirection); 3464 Command->SegmentCount, Command->DmaDirection);
3464 3465
3465 if (!end_that_request_first(Request, UpToDate, Command->BlockCount)) { 3466 if (!end_that_request_first(Request, UpToDate, Command->BlockCount)) {
3466 3467 add_disk_randomness(Request->rq_disk);
3467 end_that_request_last(Request, UpToDate); 3468 end_that_request_last(Request, UpToDate);
3468 3469
3469 if (Command->Completion) { 3470 if (Command->Completion) {
diff --git a/drivers/char/mmtimer.c b/drivers/char/mmtimer.c
index c92378121b4c..1b05fa688996 100644
--- a/drivers/char/mmtimer.c
+++ b/drivers/char/mmtimer.c
@@ -675,7 +675,7 @@ static int __init mmtimer_init(void)
675 cnodeid_t node, maxn = -1; 675 cnodeid_t node, maxn = -1;
676 676
677 if (!ia64_platform_is("sn2")) 677 if (!ia64_platform_is("sn2"))
678 return -1; 678 return 0;
679 679
680 /* 680 /*
681 * Sanity check the cycles/sec variable 681 * Sanity check the cycles/sec variable
diff --git a/drivers/edac/Kconfig b/drivers/edac/Kconfig
index 18a455651121..52f3eb45d2b9 100644
--- a/drivers/edac/Kconfig
+++ b/drivers/edac/Kconfig
@@ -6,17 +6,29 @@
6# $Id: Kconfig,v 1.4.2.7 2005/07/08 22:05:38 dsp_llnl Exp $ 6# $Id: Kconfig,v 1.4.2.7 2005/07/08 22:05:38 dsp_llnl Exp $
7# 7#
8 8
9menu 'EDAC - error detection and reporting (RAS)' 9menu 'EDAC - error detection and reporting (RAS) (EXPERIMENTAL)'
10 10
11config EDAC 11config EDAC
12 tristate "EDAC core system error reporting" 12 tristate "EDAC core system error reporting (EXPERIMENTAL)"
13 depends on X86 13 depends on X86 && EXPERIMENTAL
14 help 14 help
15 EDAC is designed to report errors in the core system. 15 EDAC is designed to report errors in the core system.
16 These are low-level errors that are reported in the CPU or 16 These are low-level errors that are reported in the CPU or
17 supporting chipset: memory errors, cache errors, PCI errors, 17 supporting chipset: memory errors, cache errors, PCI errors,
18 thermal throttling, etc.. If unsure, select 'Y'. 18 thermal throttling, etc.. If unsure, select 'Y'.
19 19
20 If this code is reporting problems on your system, please
21 see the EDAC project web pages for more information at:
22
23 <http://bluesmoke.sourceforge.net/>
24
25 and:
26
27 <http://buttersideup.com/edacwiki>
28
29 There is also a mailing list for the EDAC project, which can
30 be found via the sourceforge page.
31
20 32
21comment "Reporting subsystems" 33comment "Reporting subsystems"
22 depends on EDAC 34 depends on EDAC
diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c
index b10ee4698b1d..262e44544dc8 100644
--- a/drivers/edac/edac_mc.c
+++ b/drivers/edac/edac_mc.c
@@ -132,11 +132,13 @@ static struct kobject edac_pci_kobj;
132 * /sys/devices/system/edac/mc; 132 * /sys/devices/system/edac/mc;
133 * data structures and methods 133 * data structures and methods
134 */ 134 */
135#if 0
135static ssize_t memctrl_string_show(void *ptr, char *buffer) 136static ssize_t memctrl_string_show(void *ptr, char *buffer)
136{ 137{
137 char *value = (char*) ptr; 138 char *value = (char*) ptr;
138 return sprintf(buffer, "%s\n", value); 139 return sprintf(buffer, "%s\n", value);
139} 140}
141#endif
140 142
141static ssize_t memctrl_int_show(void *ptr, char *buffer) 143static ssize_t memctrl_int_show(void *ptr, char *buffer)
142{ 144{
@@ -207,7 +209,9 @@ struct memctrl_dev_attribute attr_##_name = { \
207}; 209};
208 210
209/* cwrow<id> attribute f*/ 211/* cwrow<id> attribute f*/
212#if 0
210MEMCTRL_STRING_ATTR(mc_version,EDAC_MC_VERSION,S_IRUGO,memctrl_string_show,NULL); 213MEMCTRL_STRING_ATTR(mc_version,EDAC_MC_VERSION,S_IRUGO,memctrl_string_show,NULL);
214#endif
211 215
212/* csrow<id> control files */ 216/* csrow<id> control files */
213MEMCTRL_ATTR(panic_on_ue,S_IRUGO|S_IWUSR,memctrl_int_show,memctrl_int_store); 217MEMCTRL_ATTR(panic_on_ue,S_IRUGO|S_IWUSR,memctrl_int_show,memctrl_int_store);
@@ -222,7 +226,6 @@ static struct memctrl_dev_attribute *memctrl_attr[] = {
222 &attr_log_ue, 226 &attr_log_ue,
223 &attr_log_ce, 227 &attr_log_ce,
224 &attr_poll_msec, 228 &attr_poll_msec,
225 &attr_mc_version,
226 NULL, 229 NULL,
227}; 230};
228 231
@@ -309,6 +312,8 @@ struct list_control {
309 int *count; 312 int *count;
310}; 313};
311 314
315
316#if 0
312/* Output the list as: vendor_id:device:id<,vendor_id:device_id> */ 317/* Output the list as: vendor_id:device:id<,vendor_id:device_id> */
313static ssize_t edac_pci_list_string_show(void *ptr, char *buffer) 318static ssize_t edac_pci_list_string_show(void *ptr, char *buffer)
314{ 319{
@@ -430,6 +435,7 @@ static ssize_t edac_pci_list_string_store(void *ptr, const char *buffer,
430 return count; 435 return count;
431} 436}
432 437
438#endif
433static ssize_t edac_pci_int_show(void *ptr, char *buffer) 439static ssize_t edac_pci_int_show(void *ptr, char *buffer)
434{ 440{
435 int *value = ptr; 441 int *value = ptr;
@@ -498,6 +504,7 @@ struct edac_pci_dev_attribute edac_pci_attr_##_name = { \
498 .store = _store, \ 504 .store = _store, \
499}; 505};
500 506
507#if 0
501static struct list_control pci_whitelist_control = { 508static struct list_control pci_whitelist_control = {
502 .list = pci_whitelist, 509 .list = pci_whitelist,
503 .count = &pci_whitelist_count 510 .count = &pci_whitelist_count
@@ -520,6 +527,7 @@ EDAC_PCI_STRING_ATTR(pci_parity_blacklist,
520 S_IRUGO|S_IWUSR, 527 S_IRUGO|S_IWUSR,
521 edac_pci_list_string_show, 528 edac_pci_list_string_show,
522 edac_pci_list_string_store); 529 edac_pci_list_string_store);
530#endif
523 531
524/* PCI Parity control files */ 532/* PCI Parity control files */
525EDAC_PCI_ATTR(check_pci_parity,S_IRUGO|S_IWUSR,edac_pci_int_show,edac_pci_int_store); 533EDAC_PCI_ATTR(check_pci_parity,S_IRUGO|S_IWUSR,edac_pci_int_show,edac_pci_int_store);
@@ -531,8 +539,6 @@ static struct edac_pci_dev_attribute *edac_pci_attr[] = {
531 &edac_pci_attr_check_pci_parity, 539 &edac_pci_attr_check_pci_parity,
532 &edac_pci_attr_panic_on_pci_parity, 540 &edac_pci_attr_panic_on_pci_parity,
533 &edac_pci_attr_pci_parity_count, 541 &edac_pci_attr_pci_parity_count,
534 &edac_pci_attr_pci_parity_whitelist,
535 &edac_pci_attr_pci_parity_blacklist,
536 NULL, 542 NULL,
537}; 543};
538 544
diff --git a/drivers/firmware/dcdbas.c b/drivers/firmware/dcdbas.c
index 8ed6ddbb9c5d..4652512f7d1a 100644
--- a/drivers/firmware/dcdbas.c
+++ b/drivers/firmware/dcdbas.c
@@ -39,7 +39,7 @@
39#include "dcdbas.h" 39#include "dcdbas.h"
40 40
41#define DRIVER_NAME "dcdbas" 41#define DRIVER_NAME "dcdbas"
42#define DRIVER_VERSION "5.6.0-1" 42#define DRIVER_VERSION "5.6.0-2"
43#define DRIVER_DESCRIPTION "Dell Systems Management Base Driver" 43#define DRIVER_DESCRIPTION "Dell Systems Management Base Driver"
44 44
45static struct platform_device *dcdbas_pdev; 45static struct platform_device *dcdbas_pdev;
@@ -581,9 +581,13 @@ static int __init dcdbas_init(void)
581 */ 581 */
582static void __exit dcdbas_exit(void) 582static void __exit dcdbas_exit(void)
583{ 583{
584 platform_device_unregister(dcdbas_pdev); 584 /*
585 * make sure functions that use dcdbas_pdev are called
586 * before platform_device_unregister
587 */
585 unregister_reboot_notifier(&dcdbas_reboot_nb); 588 unregister_reboot_notifier(&dcdbas_reboot_nb);
586 smi_data_buf_free(); 589 smi_data_buf_free();
590 platform_device_unregister(dcdbas_pdev);
587} 591}
588 592
589module_init(dcdbas_init); 593module_init(dcdbas_init);
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
index 2d2d4ac3525a..960dae5c87d1 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -1155,6 +1155,12 @@ static int srp_send_tsk_mgmt(struct scsi_cmnd *scmnd, u8 func)
1155 1155
1156 spin_lock_irq(target->scsi_host->host_lock); 1156 spin_lock_irq(target->scsi_host->host_lock);
1157 1157
1158 if (target->state == SRP_TARGET_DEAD ||
1159 target->state == SRP_TARGET_REMOVED) {
1160 scmnd->result = DID_BAD_TARGET << 16;
1161 goto out;
1162 }
1163
1158 if (scmnd->host_scribble == (void *) -1L) 1164 if (scmnd->host_scribble == (void *) -1L)
1159 goto out; 1165 goto out;
1160 1166
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c
index 19b1b0121726..ad6217467676 100644
--- a/drivers/input/mouse/psmouse-base.c
+++ b/drivers/input/mouse/psmouse-base.c
@@ -58,7 +58,7 @@ static unsigned int psmouse_resetafter = 5;
58module_param_named(resetafter, psmouse_resetafter, uint, 0644); 58module_param_named(resetafter, psmouse_resetafter, uint, 0644);
59MODULE_PARM_DESC(resetafter, "Reset device after so many bad packets (0 = never)."); 59MODULE_PARM_DESC(resetafter, "Reset device after so many bad packets (0 = never).");
60 60
61static unsigned int psmouse_resync_time = 5; 61static unsigned int psmouse_resync_time;
62module_param_named(resync_time, psmouse_resync_time, uint, 0644); 62module_param_named(resync_time, psmouse_resync_time, uint, 0644);
63MODULE_PARM_DESC(resync_time, "How long can mouse stay idle before forcing resync (in seconds, 0 = never)."); 63MODULE_PARM_DESC(resync_time, "How long can mouse stay idle before forcing resync (in seconds, 0 = never).");
64 64
diff --git a/drivers/isdn/hisax/config.c b/drivers/isdn/hisax/config.c
index 8159bcecd0c2..df9d65201819 100644
--- a/drivers/isdn/hisax/config.c
+++ b/drivers/isdn/hisax/config.c
@@ -1929,6 +1929,8 @@ static struct pci_device_id hisax_pci_tbl[] __initdata = {
1929 {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B00B, PCI_ANY_ID, PCI_ANY_ID}, 1929 {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B00B, PCI_ANY_ID, PCI_ANY_ID},
1930 {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B00C, PCI_ANY_ID, PCI_ANY_ID}, 1930 {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B00C, PCI_ANY_ID, PCI_ANY_ID},
1931 {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B100, PCI_ANY_ID, PCI_ANY_ID}, 1931 {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B100, PCI_ANY_ID, PCI_ANY_ID},
1932 {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B700, PCI_ANY_ID, PCI_ANY_ID},
1933 {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B701, PCI_ANY_ID, PCI_ANY_ID},
1932 {PCI_VENDOR_ID_ABOCOM, PCI_DEVICE_ID_ABOCOM_2BD1, PCI_ANY_ID, PCI_ANY_ID}, 1934 {PCI_VENDOR_ID_ABOCOM, PCI_DEVICE_ID_ABOCOM_2BD1, PCI_ANY_ID, PCI_ANY_ID},
1933 {PCI_VENDOR_ID_ASUSTEK, PCI_DEVICE_ID_ASUSTEK_0675, PCI_ANY_ID, PCI_ANY_ID}, 1935 {PCI_VENDOR_ID_ASUSTEK, PCI_DEVICE_ID_ASUSTEK_0675, PCI_ANY_ID, PCI_ANY_ID},
1934 {PCI_VENDOR_ID_BERKOM, PCI_DEVICE_ID_BERKOM_T_CONCEPT, PCI_ANY_ID, PCI_ANY_ID}, 1936 {PCI_VENDOR_ID_BERKOM, PCI_DEVICE_ID_BERKOM_T_CONCEPT, PCI_ANY_ID, PCI_ANY_ID},
diff --git a/drivers/isdn/hisax/hfc_pci.c b/drivers/isdn/hisax/hfc_pci.c
index 4866fc32d8d9..91d25acb5ede 100644
--- a/drivers/isdn/hisax/hfc_pci.c
+++ b/drivers/isdn/hisax/hfc_pci.c
@@ -51,6 +51,8 @@ static const PCI_ENTRY id_list[] =
51 {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B00B, "Billion", "B00B"}, 51 {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B00B, "Billion", "B00B"},
52 {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B00C, "Billion", "B00C"}, 52 {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B00C, "Billion", "B00C"},
53 {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B100, "Seyeon", "B100"}, 53 {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B100, "Seyeon", "B100"},
54 {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B700, "Primux II S0", "B700"},
55 {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B701, "Primux II S0 NT", "B701"},
54 {PCI_VENDOR_ID_ABOCOM, PCI_DEVICE_ID_ABOCOM_2BD1, "Abocom/Magitek", "2BD1"}, 56 {PCI_VENDOR_ID_ABOCOM, PCI_DEVICE_ID_ABOCOM_2BD1, "Abocom/Magitek", "2BD1"},
55 {PCI_VENDOR_ID_ASUSTEK, PCI_DEVICE_ID_ASUSTEK_0675, "Asuscom/Askey", "675"}, 57 {PCI_VENDOR_ID_ASUSTEK, PCI_DEVICE_ID_ASUSTEK_0675, "Asuscom/Askey", "675"},
56 {PCI_VENDOR_ID_BERKOM, PCI_DEVICE_ID_BERKOM_T_CONCEPT, "German telekom", "T-Concept"}, 58 {PCI_VENDOR_ID_BERKOM, PCI_DEVICE_ID_BERKOM_T_CONCEPT, "German telekom", "T-Concept"},
diff --git a/drivers/isdn/hisax/hfc_usb.c b/drivers/isdn/hisax/hfc_usb.c
index ca5b4a3b683e..262c44127419 100644
--- a/drivers/isdn/hisax/hfc_usb.c
+++ b/drivers/isdn/hisax/hfc_usb.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * hfc_usb.c 2 * hfc_usb.c
3 * 3 *
4 * $Id: hfc_usb.c,v 4.36 2005/04/08 09:55:13 martinb1 Exp $ 4 * $Id: hfc_usb.c,v 2.3.2.13 2006/02/17 17:17:22 mbachem Exp $
5 * 5 *
6 * modular HiSax ISDN driver for Colognechip HFC-S USB chip 6 * modular HiSax ISDN driver for Colognechip HFC-S USB chip
7 * 7 *
@@ -45,7 +45,7 @@
45#include "hfc_usb.h" 45#include "hfc_usb.h"
46 46
47static const char *hfcusb_revision = 47static const char *hfcusb_revision =
48 "$Revision: 4.36 $ $Date: 2005/04/08 09:55:13 $ "; 48 "$Revision: 2.3.2.13 $ $Date: 2006/02/17 17:17:22 $ ";
49 49
50/* Hisax debug support 50/* Hisax debug support
51* use "modprobe debug=x" where x is bitfield of USB_DBG & ISDN_DBG 51* use "modprobe debug=x" where x is bitfield of USB_DBG & ISDN_DBG
@@ -219,7 +219,7 @@ symbolic(struct hfcusb_symbolic_list list[], const int num)
219 for (i = 0; list[i].name != NULL; i++) 219 for (i = 0; list[i].name != NULL; i++)
220 if (list[i].num == num) 220 if (list[i].num == num)
221 return (list[i].name); 221 return (list[i].name);
222 return "<unkown ERROR>"; 222 return "<unknown ERROR>";
223} 223}
224 224
225 225
@@ -235,9 +235,9 @@ ctrl_start_transfer(hfcusb_data * hfc)
235 hfc->ctrl_urb->transfer_buffer = NULL; 235 hfc->ctrl_urb->transfer_buffer = NULL;
236 hfc->ctrl_urb->transfer_buffer_length = 0; 236 hfc->ctrl_urb->transfer_buffer_length = 0;
237 hfc->ctrl_write.wIndex = 237 hfc->ctrl_write.wIndex =
238 hfc->ctrl_buff[hfc->ctrl_out_idx].hfc_reg; 238 cpu_to_le16(hfc->ctrl_buff[hfc->ctrl_out_idx].hfc_reg);
239 hfc->ctrl_write.wValue = 239 hfc->ctrl_write.wValue =
240 hfc->ctrl_buff[hfc->ctrl_out_idx].reg_val; 240 cpu_to_le16(hfc->ctrl_buff[hfc->ctrl_out_idx].reg_val);
241 241
242 usb_submit_urb(hfc->ctrl_urb, GFP_ATOMIC); /* start transfer */ 242 usb_submit_urb(hfc->ctrl_urb, GFP_ATOMIC); /* start transfer */
243 } 243 }
@@ -1282,7 +1282,7 @@ usb_init(hfcusb_data * hfc)
1282 /* init the background machinery for control requests */ 1282 /* init the background machinery for control requests */
1283 hfc->ctrl_read.bRequestType = 0xc0; 1283 hfc->ctrl_read.bRequestType = 0xc0;
1284 hfc->ctrl_read.bRequest = 1; 1284 hfc->ctrl_read.bRequest = 1;
1285 hfc->ctrl_read.wLength = 1; 1285 hfc->ctrl_read.wLength = cpu_to_le16(1);
1286 hfc->ctrl_write.bRequestType = 0x40; 1286 hfc->ctrl_write.bRequestType = 0x40;
1287 hfc->ctrl_write.bRequest = 0; 1287 hfc->ctrl_write.bRequest = 0;
1288 hfc->ctrl_write.wLength = 0; 1288 hfc->ctrl_write.wLength = 0;
@@ -1373,9 +1373,8 @@ hfc_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
1373 1373
1374 vend_idx = 0xffff; 1374 vend_idx = 0xffff;
1375 for (i = 0; hfcusb_idtab[i].idVendor; i++) { 1375 for (i = 0; hfcusb_idtab[i].idVendor; i++) {
1376 if (dev->descriptor.idVendor == hfcusb_idtab[i].idVendor 1376 if ((le16_to_cpu(dev->descriptor.idVendor) == hfcusb_idtab[i].idVendor)
1377 && dev->descriptor.idProduct == 1377 && (le16_to_cpu(dev->descriptor.idProduct) == hfcusb_idtab[i].idProduct)) {
1378 hfcusb_idtab[i].idProduct) {
1379 vend_idx = i; 1378 vend_idx = i;
1380 continue; 1379 continue;
1381 } 1380 }
@@ -1516,8 +1515,7 @@ hfc_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
1516 usb_transfer_mode 1515 usb_transfer_mode
1517 = USB_INT; 1516 = USB_INT;
1518 packet_size = 1517 packet_size =
1519 ep->desc. 1518 le16_to_cpu(ep->desc.wMaxPacketSize);
1520 wMaxPacketSize;
1521 break; 1519 break;
1522 case USB_ENDPOINT_XFER_BULK: 1520 case USB_ENDPOINT_XFER_BULK:
1523 if (ep_addr & 0x80) 1521 if (ep_addr & 0x80)
@@ -1545,8 +1543,7 @@ hfc_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
1545 usb_transfer_mode 1543 usb_transfer_mode
1546 = USB_BULK; 1544 = USB_BULK;
1547 packet_size = 1545 packet_size =
1548 ep->desc. 1546 le16_to_cpu(ep->desc.wMaxPacketSize);
1549 wMaxPacketSize;
1550 break; 1547 break;
1551 case USB_ENDPOINT_XFER_ISOC: 1548 case USB_ENDPOINT_XFER_ISOC:
1552 if (ep_addr & 0x80) 1549 if (ep_addr & 0x80)
@@ -1574,8 +1571,7 @@ hfc_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
1574 usb_transfer_mode 1571 usb_transfer_mode
1575 = USB_ISOC; 1572 = USB_ISOC;
1576 iso_packet_size = 1573 iso_packet_size =
1577 ep->desc. 1574 le16_to_cpu(ep->desc.wMaxPacketSize);
1578 wMaxPacketSize;
1579 break; 1575 break;
1580 default: 1576 default:
1581 context-> 1577 context->
@@ -1588,10 +1584,8 @@ hfc_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
1588 fifonum = cidx; 1584 fifonum = cidx;
1589 context->fifos[cidx].hfc = 1585 context->fifos[cidx].hfc =
1590 context; 1586 context;
1591 context->fifos[cidx]. 1587 context->fifos[cidx].usb_packet_maxlen =
1592 usb_packet_maxlen = 1588 le16_to_cpu(ep->desc.wMaxPacketSize);
1593 ep->desc.
1594 wMaxPacketSize;
1595 context->fifos[cidx]. 1589 context->fifos[cidx].
1596 intervall = 1590 intervall =
1597 ep->desc.bInterval; 1591 ep->desc.bInterval;
diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c
index 393633681f49..aeaa1db74bd8 100644
--- a/drivers/isdn/i4l/isdn_tty.c
+++ b/drivers/isdn/i4l/isdn_tty.c
@@ -1682,6 +1682,7 @@ isdn_tty_close(struct tty_struct *tty, struct file *filp)
1682#ifdef ISDN_DEBUG_MODEM_OPEN 1682#ifdef ISDN_DEBUG_MODEM_OPEN
1683 printk(KERN_DEBUG "isdn_tty_close after info->count != 0\n"); 1683 printk(KERN_DEBUG "isdn_tty_close after info->count != 0\n");
1684#endif 1684#endif
1685 module_put(info->owner);
1685 return; 1686 return;
1686 } 1687 }
1687 info->flags |= ISDN_ASYNC_CLOSING; 1688 info->flags |= ISDN_ASYNC_CLOSING;
diff --git a/drivers/macintosh/windfarm_core.c b/drivers/macintosh/windfarm_core.c
index bb8d5efe19bf..6c0ba04bc57a 100644
--- a/drivers/macintosh/windfarm_core.c
+++ b/drivers/macintosh/windfarm_core.c
@@ -35,6 +35,8 @@
35#include <linux/platform_device.h> 35#include <linux/platform_device.h>
36#include <linux/mutex.h> 36#include <linux/mutex.h>
37 37
38#include <asm/prom.h>
39
38#include "windfarm.h" 40#include "windfarm.h"
39 41
40#define VERSION "0.2" 42#define VERSION "0.2"
@@ -465,6 +467,11 @@ static int __init windfarm_core_init(void)
465{ 467{
466 DBG("wf: core loaded\n"); 468 DBG("wf: core loaded\n");
467 469
470 /* Don't register on old machines that use therm_pm72 for now */
471 if (machine_is_compatible("PowerMac7,2") ||
472 machine_is_compatible("PowerMac7,3") ||
473 machine_is_compatible("RackMac3,1"))
474 return -ENODEV;
468 platform_device_register(&wf_platform_device); 475 platform_device_register(&wf_platform_device);
469 return 0; 476 return 0;
470} 477}
diff --git a/drivers/macintosh/windfarm_cpufreq_clamp.c b/drivers/macintosh/windfarm_cpufreq_clamp.c
index 607dbaca69c9..81337cd16e80 100644
--- a/drivers/macintosh/windfarm_cpufreq_clamp.c
+++ b/drivers/macintosh/windfarm_cpufreq_clamp.c
@@ -8,6 +8,8 @@
8#include <linux/wait.h> 8#include <linux/wait.h>
9#include <linux/cpufreq.h> 9#include <linux/cpufreq.h>
10 10
11#include <asm/prom.h>
12
11#include "windfarm.h" 13#include "windfarm.h"
12 14
13#define VERSION "0.3" 15#define VERSION "0.3"
@@ -74,6 +76,12 @@ static int __init wf_cpufreq_clamp_init(void)
74{ 76{
75 struct wf_control *clamp; 77 struct wf_control *clamp;
76 78
79 /* Don't register on old machines that use therm_pm72 for now */
80 if (machine_is_compatible("PowerMac7,2") ||
81 machine_is_compatible("PowerMac7,3") ||
82 machine_is_compatible("RackMac3,1"))
83 return -ENODEV;
84
77 clamp = kmalloc(sizeof(struct wf_control), GFP_KERNEL); 85 clamp = kmalloc(sizeof(struct wf_control), GFP_KERNEL);
78 if (clamp == NULL) 86 if (clamp == NULL)
79 return -ENOMEM; 87 return -ENOMEM;
diff --git a/drivers/macintosh/windfarm_lm75_sensor.c b/drivers/macintosh/windfarm_lm75_sensor.c
index 906d3ecae6e6..423bfa2432c0 100644
--- a/drivers/macintosh/windfarm_lm75_sensor.c
+++ b/drivers/macintosh/windfarm_lm75_sensor.c
@@ -25,7 +25,7 @@
25 25
26#include "windfarm.h" 26#include "windfarm.h"
27 27
28#define VERSION "0.1" 28#define VERSION "0.2"
29 29
30#undef DEBUG 30#undef DEBUG
31 31
@@ -113,6 +113,7 @@ static struct wf_lm75_sensor *wf_lm75_create(struct i2c_adapter *adapter,
113 const char *loc) 113 const char *loc)
114{ 114{
115 struct wf_lm75_sensor *lm; 115 struct wf_lm75_sensor *lm;
116 int rc;
116 117
117 DBG("wf_lm75: creating %s device at address 0x%02x\n", 118 DBG("wf_lm75: creating %s device at address 0x%02x\n",
118 ds1775 ? "ds1775" : "lm75", addr); 119 ds1775 ? "ds1775" : "lm75", addr);
@@ -139,9 +140,11 @@ static struct wf_lm75_sensor *wf_lm75_create(struct i2c_adapter *adapter,
139 lm->i2c.driver = &wf_lm75_driver; 140 lm->i2c.driver = &wf_lm75_driver;
140 strncpy(lm->i2c.name, lm->sens.name, I2C_NAME_SIZE-1); 141 strncpy(lm->i2c.name, lm->sens.name, I2C_NAME_SIZE-1);
141 142
142 if (i2c_attach_client(&lm->i2c)) { 143 rc = i2c_attach_client(&lm->i2c);
143 printk(KERN_ERR "windfarm: failed to attach %s %s to i2c\n", 144 if (rc) {
144 ds1775 ? "ds1775" : "lm75", lm->i2c.name); 145 printk(KERN_ERR "windfarm: failed to attach %s %s to i2c,"
146 " err %d\n", ds1775 ? "ds1775" : "lm75",
147 lm->i2c.name, rc);
145 goto fail; 148 goto fail;
146 } 149 }
147 150
@@ -175,16 +178,22 @@ static int wf_lm75_attach(struct i2c_adapter *adapter)
175 (dev = of_get_next_child(busnode, dev)) != NULL;) { 178 (dev = of_get_next_child(busnode, dev)) != NULL;) {
176 const char *loc = 179 const char *loc =
177 get_property(dev, "hwsensor-location", NULL); 180 get_property(dev, "hwsensor-location", NULL);
178 u32 *reg = (u32 *)get_property(dev, "reg", NULL); 181 u8 addr;
179 DBG(" dev: %s... (loc: %p, reg: %p)\n", dev->name, loc, reg); 182
180 if (loc == NULL || reg == NULL) 183 /* We must re-match the adapter in order to properly check
184 * the channel on multibus setups
185 */
186 if (!pmac_i2c_match_adapter(dev, adapter))
187 continue;
188 addr = pmac_i2c_get_dev_addr(dev);
189 if (loc == NULL || addr == 0)
181 continue; 190 continue;
182 /* real lm75 */ 191 /* real lm75 */
183 if (device_is_compatible(dev, "lm75")) 192 if (device_is_compatible(dev, "lm75"))
184 wf_lm75_create(adapter, *reg, 0, loc); 193 wf_lm75_create(adapter, addr, 0, loc);
185 /* ds1775 (compatible, better resolution */ 194 /* ds1775 (compatible, better resolution */
186 else if (device_is_compatible(dev, "ds1775")) 195 else if (device_is_compatible(dev, "ds1775"))
187 wf_lm75_create(adapter, *reg, 1, loc); 196 wf_lm75_create(adapter, addr, 1, loc);
188 } 197 }
189 return 0; 198 return 0;
190} 199}
@@ -206,6 +215,11 @@ static int wf_lm75_detach(struct i2c_client *client)
206 215
207static int __init wf_lm75_sensor_init(void) 216static int __init wf_lm75_sensor_init(void)
208{ 217{
218 /* Don't register on old machines that use therm_pm72 for now */
219 if (machine_is_compatible("PowerMac7,2") ||
220 machine_is_compatible("PowerMac7,3") ||
221 machine_is_compatible("RackMac3,1"))
222 return -ENODEV;
209 return i2c_add_driver(&wf_lm75_driver); 223 return i2c_add_driver(&wf_lm75_driver);
210} 224}
211 225
diff --git a/drivers/macintosh/windfarm_max6690_sensor.c b/drivers/macintosh/windfarm_max6690_sensor.c
index 5b9ad6ca7cba..8e99d408fddd 100644
--- a/drivers/macintosh/windfarm_max6690_sensor.c
+++ b/drivers/macintosh/windfarm_max6690_sensor.c
@@ -17,7 +17,7 @@
17 17
18#include "windfarm.h" 18#include "windfarm.h"
19 19
20#define VERSION "0.1" 20#define VERSION "0.2"
21 21
22/* This currently only exports the external temperature sensor, 22/* This currently only exports the external temperature sensor,
23 since that's all the control loops need. */ 23 since that's all the control loops need. */
@@ -81,7 +81,7 @@ static struct wf_sensor_ops wf_max6690_ops = {
81static void wf_max6690_create(struct i2c_adapter *adapter, u8 addr) 81static void wf_max6690_create(struct i2c_adapter *adapter, u8 addr)
82{ 82{
83 struct wf_6690_sensor *max; 83 struct wf_6690_sensor *max;
84 char *name = "u4-temp"; 84 char *name = "backside-temp";
85 85
86 max = kzalloc(sizeof(struct wf_6690_sensor), GFP_KERNEL); 86 max = kzalloc(sizeof(struct wf_6690_sensor), GFP_KERNEL);
87 if (max == NULL) { 87 if (max == NULL) {
@@ -118,7 +118,6 @@ static int wf_max6690_attach(struct i2c_adapter *adapter)
118 struct device_node *busnode, *dev = NULL; 118 struct device_node *busnode, *dev = NULL;
119 struct pmac_i2c_bus *bus; 119 struct pmac_i2c_bus *bus;
120 const char *loc; 120 const char *loc;
121 u32 *reg;
122 121
123 bus = pmac_i2c_adapter_to_bus(adapter); 122 bus = pmac_i2c_adapter_to_bus(adapter);
124 if (bus == NULL) 123 if (bus == NULL)
@@ -126,16 +125,23 @@ static int wf_max6690_attach(struct i2c_adapter *adapter)
126 busnode = pmac_i2c_get_bus_node(bus); 125 busnode = pmac_i2c_get_bus_node(bus);
127 126
128 while ((dev = of_get_next_child(busnode, dev)) != NULL) { 127 while ((dev = of_get_next_child(busnode, dev)) != NULL) {
128 u8 addr;
129
130 /* We must re-match the adapter in order to properly check
131 * the channel on multibus setups
132 */
133 if (!pmac_i2c_match_adapter(dev, adapter))
134 continue;
129 if (!device_is_compatible(dev, "max6690")) 135 if (!device_is_compatible(dev, "max6690"))
130 continue; 136 continue;
137 addr = pmac_i2c_get_dev_addr(dev);
131 loc = get_property(dev, "hwsensor-location", NULL); 138 loc = get_property(dev, "hwsensor-location", NULL);
132 reg = (u32 *) get_property(dev, "reg", NULL); 139 if (loc == NULL || addr == 0)
133 if (!loc || !reg)
134 continue; 140 continue;
135 printk("found max6690, loc=%s reg=%x\n", loc, *reg); 141 printk("found max6690, loc=%s addr=0x%02x\n", loc, addr);
136 if (strcmp(loc, "BACKSIDE")) 142 if (strcmp(loc, "BACKSIDE"))
137 continue; 143 continue;
138 wf_max6690_create(adapter, *reg); 144 wf_max6690_create(adapter, addr);
139 } 145 }
140 146
141 return 0; 147 return 0;
@@ -153,6 +159,11 @@ static int wf_max6690_detach(struct i2c_client *client)
153 159
154static int __init wf_max6690_sensor_init(void) 160static int __init wf_max6690_sensor_init(void)
155{ 161{
162 /* Don't register on old machines that use therm_pm72 for now */
163 if (machine_is_compatible("PowerMac7,2") ||
164 machine_is_compatible("PowerMac7,3") ||
165 machine_is_compatible("RackMac3,1"))
166 return -ENODEV;
156 return i2c_add_driver(&wf_max6690_driver); 167 return i2c_add_driver(&wf_max6690_driver);
157} 168}
158 169
diff --git a/drivers/macintosh/windfarm_pid.c b/drivers/macintosh/windfarm_pid.c
index 0842432e27ad..f10efb28cae4 100644
--- a/drivers/macintosh/windfarm_pid.c
+++ b/drivers/macintosh/windfarm_pid.c
@@ -143,3 +143,7 @@ s32 wf_cpu_pid_run(struct wf_cpu_pid_state *st, s32 new_power, s32 new_temp)
143 return st->target; 143 return st->target;
144} 144}
145EXPORT_SYMBOL_GPL(wf_cpu_pid_run); 145EXPORT_SYMBOL_GPL(wf_cpu_pid_run);
146
147MODULE_AUTHOR("Benjamin Herrenschmidt <benh@kernel.crashing.org>");
148MODULE_DESCRIPTION("PID algorithm for PowerMacs thermal control");
149MODULE_LICENSE("GPL");
diff --git a/drivers/macintosh/windfarm_pm112.c b/drivers/macintosh/windfarm_pm112.c
index c2a4e689c784..ef66bf2778ec 100644
--- a/drivers/macintosh/windfarm_pm112.c
+++ b/drivers/macintosh/windfarm_pm112.c
@@ -358,6 +358,7 @@ static void backside_fan_tick(void)
358 return; 358 return;
359 if (!backside_tick) { 359 if (!backside_tick) {
360 /* first time; initialize things */ 360 /* first time; initialize things */
361 printk(KERN_INFO "windfarm: Backside control loop started.\n");
361 backside_param.min = backside_fan->ops->get_min(backside_fan); 362 backside_param.min = backside_fan->ops->get_min(backside_fan);
362 backside_param.max = backside_fan->ops->get_max(backside_fan); 363 backside_param.max = backside_fan->ops->get_max(backside_fan);
363 wf_pid_init(&backside_pid, &backside_param); 364 wf_pid_init(&backside_pid, &backside_param);
@@ -407,6 +408,7 @@ static void drive_bay_fan_tick(void)
407 return; 408 return;
408 if (!drive_bay_tick) { 409 if (!drive_bay_tick) {
409 /* first time; initialize things */ 410 /* first time; initialize things */
411 printk(KERN_INFO "windfarm: Drive bay control loop started.\n");
410 drive_bay_prm.min = drive_bay_fan->ops->get_min(drive_bay_fan); 412 drive_bay_prm.min = drive_bay_fan->ops->get_min(drive_bay_fan);
411 drive_bay_prm.max = drive_bay_fan->ops->get_max(drive_bay_fan); 413 drive_bay_prm.max = drive_bay_fan->ops->get_max(drive_bay_fan);
412 wf_pid_init(&drive_bay_pid, &drive_bay_prm); 414 wf_pid_init(&drive_bay_pid, &drive_bay_prm);
@@ -458,6 +460,7 @@ static void slots_fan_tick(void)
458 return; 460 return;
459 if (!slots_started) { 461 if (!slots_started) {
460 /* first time; initialize things */ 462 /* first time; initialize things */
463 printk(KERN_INFO "windfarm: Slots control loop started.\n");
461 wf_pid_init(&slots_pid, &slots_param); 464 wf_pid_init(&slots_pid, &slots_param);
462 slots_started = 1; 465 slots_started = 1;
463 } 466 }
@@ -504,6 +507,7 @@ static void pm112_tick(void)
504 507
505 if (!started) { 508 if (!started) {
506 started = 1; 509 started = 1;
510 printk(KERN_INFO "windfarm: CPUs control loops started.\n");
507 for (i = 0; i < nr_cores; ++i) { 511 for (i = 0; i < nr_cores; ++i) {
508 if (create_cpu_loop(i) < 0) { 512 if (create_cpu_loop(i) < 0) {
509 failure_state = FAILURE_PERM; 513 failure_state = FAILURE_PERM;
@@ -594,8 +598,6 @@ static void pm112_new_sensor(struct wf_sensor *sr)
594{ 598{
595 unsigned int i; 599 unsigned int i;
596 600
597 if (have_all_sensors)
598 return;
599 if (!strncmp(sr->name, "cpu-temp-", 9)) { 601 if (!strncmp(sr->name, "cpu-temp-", 9)) {
600 i = sr->name[9] - '0'; 602 i = sr->name[9] - '0';
601 if (sr->name[10] == 0 && i < NR_CORES && 603 if (sr->name[10] == 0 && i < NR_CORES &&
@@ -613,7 +615,7 @@ static void pm112_new_sensor(struct wf_sensor *sr)
613 } else if (!strcmp(sr->name, "slots-power")) { 615 } else if (!strcmp(sr->name, "slots-power")) {
614 if (slots_power == NULL && wf_get_sensor(sr) == 0) 616 if (slots_power == NULL && wf_get_sensor(sr) == 0)
615 slots_power = sr; 617 slots_power = sr;
616 } else if (!strcmp(sr->name, "u4-temp")) { 618 } else if (!strcmp(sr->name, "backside-temp")) {
617 if (u4_temp == NULL && wf_get_sensor(sr) == 0) 619 if (u4_temp == NULL && wf_get_sensor(sr) == 0)
618 u4_temp = sr; 620 u4_temp = sr;
619 } else 621 } else
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index d39f584cd8b3..5d88329e3c7a 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -306,6 +306,7 @@ static int raid1_end_write_request(struct bio *bio, unsigned int bytes_done, int
306 r1bio_t * r1_bio = (r1bio_t *)(bio->bi_private); 306 r1bio_t * r1_bio = (r1bio_t *)(bio->bi_private);
307 int mirror, behind = test_bit(R1BIO_BehindIO, &r1_bio->state); 307 int mirror, behind = test_bit(R1BIO_BehindIO, &r1_bio->state);
308 conf_t *conf = mddev_to_conf(r1_bio->mddev); 308 conf_t *conf = mddev_to_conf(r1_bio->mddev);
309 struct bio *to_put = NULL;
309 310
310 if (bio->bi_size) 311 if (bio->bi_size)
311 return 1; 312 return 1;
@@ -323,6 +324,7 @@ static int raid1_end_write_request(struct bio *bio, unsigned int bytes_done, int
323 * this branch is our 'one mirror IO has finished' event handler: 324 * this branch is our 'one mirror IO has finished' event handler:
324 */ 325 */
325 r1_bio->bios[mirror] = NULL; 326 r1_bio->bios[mirror] = NULL;
327 to_put = bio;
326 if (!uptodate) { 328 if (!uptodate) {
327 md_error(r1_bio->mddev, conf->mirrors[mirror].rdev); 329 md_error(r1_bio->mddev, conf->mirrors[mirror].rdev);
328 /* an I/O failed, we can't clear the bitmap */ 330 /* an I/O failed, we can't clear the bitmap */
@@ -375,7 +377,7 @@ static int raid1_end_write_request(struct bio *bio, unsigned int bytes_done, int
375 /* Don't dec_pending yet, we want to hold 377 /* Don't dec_pending yet, we want to hold
376 * the reference over the retry 378 * the reference over the retry
377 */ 379 */
378 return 0; 380 goto out;
379 } 381 }
380 if (test_bit(R1BIO_BehindIO, &r1_bio->state)) { 382 if (test_bit(R1BIO_BehindIO, &r1_bio->state)) {
381 /* free extra copy of the data pages */ 383 /* free extra copy of the data pages */
@@ -392,10 +394,11 @@ static int raid1_end_write_request(struct bio *bio, unsigned int bytes_done, int
392 raid_end_bio_io(r1_bio); 394 raid_end_bio_io(r1_bio);
393 } 395 }
394 396
395 if (r1_bio->bios[mirror]==NULL)
396 bio_put(bio);
397
398 rdev_dec_pending(conf->mirrors[mirror].rdev, conf->mddev); 397 rdev_dec_pending(conf->mirrors[mirror].rdev, conf->mddev);
398 out:
399 if (to_put)
400 bio_put(to_put);
401
399 return 0; 402 return 0;
400} 403}
401 404
@@ -857,7 +860,7 @@ static int make_request(request_queue_t *q, struct bio * bio)
857 atomic_set(&r1_bio->remaining, 0); 860 atomic_set(&r1_bio->remaining, 0);
858 atomic_set(&r1_bio->behind_remaining, 0); 861 atomic_set(&r1_bio->behind_remaining, 0);
859 862
860 do_barriers = bio->bi_rw & BIO_RW_BARRIER; 863 do_barriers = bio_barrier(bio);
861 if (do_barriers) 864 if (do_barriers)
862 set_bit(R1BIO_Barrier, &r1_bio->state); 865 set_bit(R1BIO_Barrier, &r1_bio->state);
863 866
diff --git a/drivers/media/dvb/b2c2/flexcop-fe-tuner.c b/drivers/media/dvb/b2c2/flexcop-fe-tuner.c
index 390cc3a99ce6..9c7f122826e0 100644
--- a/drivers/media/dvb/b2c2/flexcop-fe-tuner.c
+++ b/drivers/media/dvb/b2c2/flexcop-fe-tuner.c
@@ -526,7 +526,7 @@ int flexcop_frontend_init(struct flexcop_device *fc)
526 info("found the stv0297 at i2c address: 0x%02x",alps_tdee4_stv0297_config.demod_address); 526 info("found the stv0297 at i2c address: 0x%02x",alps_tdee4_stv0297_config.demod_address);
527 } else 527 } else
528 /* try the sky v2.3 (vp310/Samsung tbdu18132(tsa5059)) */ 528 /* try the sky v2.3 (vp310/Samsung tbdu18132(tsa5059)) */
529 if ((fc->fe = vp310_attach(&skystar23_samsung_tbdu18132_config, &fc->i2c_adap)) != NULL) { 529 if ((fc->fe = vp310_mt312_attach(&skystar23_samsung_tbdu18132_config, &fc->i2c_adap)) != NULL) {
530 ops = fc->fe->ops; 530 ops = fc->fe->ops;
531 531
532 ops->diseqc_send_master_cmd = flexcop_diseqc_send_master_cmd; 532 ops->diseqc_send_master_cmd = flexcop_diseqc_send_master_cmd;
diff --git a/drivers/media/dvb/bt8xx/bt878.c b/drivers/media/dvb/bt8xx/bt878.c
index 34c3189a1a33..356f447ee2ab 100644
--- a/drivers/media/dvb/bt8xx/bt878.c
+++ b/drivers/media/dvb/bt8xx/bt878.c
@@ -382,7 +382,7 @@ bt878_device_control(struct bt878 *bt, unsigned int cmd, union dst_gpio_packet *
382EXPORT_SYMBOL(bt878_device_control); 382EXPORT_SYMBOL(bt878_device_control);
383 383
384 384
385struct cards card_list[] __devinitdata = { 385static struct cards card_list[] __devinitdata = {
386 386
387 { 0x01010071, BTTV_BOARD_NEBULA_DIGITV, "Nebula Electronics DigiTV" }, 387 { 0x01010071, BTTV_BOARD_NEBULA_DIGITV, "Nebula Electronics DigiTV" },
388 { 0x07611461, BTTV_BOARD_AVDVBT_761, "AverMedia AverTV DVB-T 761" }, 388 { 0x07611461, BTTV_BOARD_AVDVBT_761, "AverMedia AverTV DVB-T 761" },
diff --git a/drivers/media/dvb/bt8xx/dst.c b/drivers/media/dvb/bt8xx/dst.c
index 3a2ff1cc24b7..0310e3dd07e6 100644
--- a/drivers/media/dvb/bt8xx/dst.c
+++ b/drivers/media/dvb/bt8xx/dst.c
@@ -602,7 +602,7 @@ static int dst_type_print(u8 type)
602 602
603*/ 603*/
604 604
605struct dst_types dst_tlist[] = { 605static struct dst_types dst_tlist[] = {
606 { 606 {
607 .device_id = "200103A", 607 .device_id = "200103A",
608 .offset = 0, 608 .offset = 0,
diff --git a/drivers/media/dvb/dvb-core/demux.h b/drivers/media/dvb/dvb-core/demux.h
index 9f025825b2d2..0c1d87c5227a 100644
--- a/drivers/media/dvb/dvb-core/demux.h
+++ b/drivers/media/dvb/dvb-core/demux.h
@@ -216,7 +216,7 @@ struct dmx_frontend {
216/*--------------------------------------------------------------------------*/ 216/*--------------------------------------------------------------------------*/
217 217
218/* 218/*
219 * Flags OR'ed in the capabilites field of struct dmx_demux. 219 * Flags OR'ed in the capabilities field of struct dmx_demux.
220 */ 220 */
221 221
222#define DMX_TS_FILTERING 1 222#define DMX_TS_FILTERING 1
diff --git a/drivers/media/dvb/dvb-usb/cxusb.c b/drivers/media/dvb/dvb-usb/cxusb.c
index f327fac1688e..162f9795cd89 100644
--- a/drivers/media/dvb/dvb-usb/cxusb.c
+++ b/drivers/media/dvb/dvb-usb/cxusb.c
@@ -282,7 +282,7 @@ static struct cx22702_config cxusb_cx22702_config = {
282 .pll_set = dvb_usb_pll_set_i2c, 282 .pll_set = dvb_usb_pll_set_i2c,
283}; 283};
284 284
285static struct lgdt330x_config cxusb_lgdt330x_config = { 285static struct lgdt330x_config cxusb_lgdt3303_config = {
286 .demod_address = 0x0e, 286 .demod_address = 0x0e,
287 .demod_chip = LGDT3303, 287 .demod_chip = LGDT3303,
288 .pll_set = dvb_usb_pll_set_i2c, 288 .pll_set = dvb_usb_pll_set_i2c,
@@ -357,14 +357,14 @@ static int cxusb_cx22702_frontend_attach(struct dvb_usb_device *d)
357 return -EIO; 357 return -EIO;
358} 358}
359 359
360static int cxusb_lgdt330x_frontend_attach(struct dvb_usb_device *d) 360static int cxusb_lgdt3303_frontend_attach(struct dvb_usb_device *d)
361{ 361{
362 if (usb_set_interface(d->udev,0,7) < 0) 362 if (usb_set_interface(d->udev,0,7) < 0)
363 err("set interface failed"); 363 err("set interface failed");
364 364
365 cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, NULL, 0); 365 cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, NULL, 0);
366 366
367 if ((d->fe = lgdt330x_attach(&cxusb_lgdt330x_config, &d->i2c_adap)) != NULL) 367 if ((d->fe = lgdt330x_attach(&cxusb_lgdt3303_config, &d->i2c_adap)) != NULL)
368 return 0; 368 return 0;
369 369
370 return -EIO; 370 return -EIO;
@@ -506,7 +506,7 @@ static struct dvb_usb_properties cxusb_bluebird_lgh064f_properties = {
506 506
507 .streaming_ctrl = cxusb_streaming_ctrl, 507 .streaming_ctrl = cxusb_streaming_ctrl,
508 .power_ctrl = cxusb_power_ctrl, 508 .power_ctrl = cxusb_power_ctrl,
509 .frontend_attach = cxusb_lgdt330x_frontend_attach, 509 .frontend_attach = cxusb_lgdt3303_frontend_attach,
510 .tuner_attach = cxusb_lgh064f_tuner_attach, 510 .tuner_attach = cxusb_lgh064f_tuner_attach,
511 511
512 .i2c_algo = &cxusb_i2c_algo, 512 .i2c_algo = &cxusb_i2c_algo,
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-init.c b/drivers/media/dvb/dvb-usb/dvb-usb-init.c
index 716f8bf528cd..ce34a55e5c24 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb-init.c
+++ b/drivers/media/dvb/dvb-usb/dvb-usb-init.c
@@ -47,7 +47,7 @@ static int dvb_usb_init(struct dvb_usb_device *d)
47 47
48 d->state = DVB_USB_STATE_INIT; 48 d->state = DVB_USB_STATE_INIT;
49 49
50/* check the capabilites and set appropriate variables */ 50/* check the capabilities and set appropriate variables */
51 51
52/* speed - when running at FULL speed we need a HW PID filter */ 52/* speed - when running at FULL speed we need a HW PID filter */
53 if (d->udev->speed == USB_SPEED_FULL && !(d->props.caps & DVB_USB_HAS_PID_FILTER)) { 53 if (d->udev->speed == USB_SPEED_FULL && !(d->props.caps & DVB_USB_HAS_PID_FILTER)) {
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb.h b/drivers/media/dvb/dvb-usb/dvb-usb.h
index 5e5d21ad93c9..d4909e5c67e0 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb.h
+++ b/drivers/media/dvb/dvb-usb/dvb-usb.h
@@ -87,7 +87,7 @@ struct dvb_usb_device;
87 87
88/** 88/**
89 * struct dvb_usb_properties - properties of a dvb-usb-device 89 * struct dvb_usb_properties - properties of a dvb-usb-device
90 * @caps: capabilites of the DVB USB device. 90 * @caps: capabilities of the DVB USB device.
91 * @pid_filter_count: number of PID filter position in the optional hardware 91 * @pid_filter_count: number of PID filter position in the optional hardware
92 * PID-filter. 92 * PID-filter.
93 * 93 *
diff --git a/drivers/media/dvb/frontends/Kconfig b/drivers/media/dvb/frontends/Kconfig
index 76b6a2aef32f..c676b1e23ab0 100644
--- a/drivers/media/dvb/frontends/Kconfig
+++ b/drivers/media/dvb/frontends/Kconfig
@@ -29,7 +29,7 @@ config DVB_TDA8083
29 A DVB-S tuner module. Say Y when you want to support this frontend. 29 A DVB-S tuner module. Say Y when you want to support this frontend.
30 30
31config DVB_MT312 31config DVB_MT312
32 tristate "Zarlink MT312 based" 32 tristate "Zarlink VP310/MT312 based"
33 depends on DVB_CORE 33 depends on DVB_CORE
34 help 34 help
35 A DVB-S tuner module. Say Y when you want to support this frontend. 35 A DVB-S tuner module. Say Y when you want to support this frontend.
diff --git a/drivers/media/dvb/frontends/mt312.c b/drivers/media/dvb/frontends/mt312.c
index ec4e641acc64..d3aea83cf218 100644
--- a/drivers/media/dvb/frontends/mt312.c
+++ b/drivers/media/dvb/frontends/mt312.c
@@ -612,76 +612,6 @@ static void mt312_release(struct dvb_frontend* fe)
612 kfree(state); 612 kfree(state);
613} 613}
614 614
615static struct dvb_frontend_ops vp310_mt312_ops;
616
617struct dvb_frontend* vp310_attach(const struct mt312_config* config,
618 struct i2c_adapter* i2c)
619{
620 struct mt312_state* state = NULL;
621
622 /* allocate memory for the internal state */
623 state = kmalloc(sizeof(struct mt312_state), GFP_KERNEL);
624 if (state == NULL)
625 goto error;
626
627 /* setup the state */
628 state->config = config;
629 state->i2c = i2c;
630 memcpy(&state->ops, &vp310_mt312_ops, sizeof(struct dvb_frontend_ops));
631 strcpy(state->ops.info.name, "Zarlink VP310 DVB-S");
632
633 /* check if the demod is there */
634 if (mt312_readreg(state, ID, &state->id) < 0)
635 goto error;
636 if (state->id != ID_VP310) {
637 goto error;
638 }
639
640 /* create dvb_frontend */
641 state->frequency = 90;
642 state->frontend.ops = &state->ops;
643 state->frontend.demodulator_priv = state;
644 return &state->frontend;
645
646error:
647 kfree(state);
648 return NULL;
649}
650
651struct dvb_frontend* mt312_attach(const struct mt312_config* config,
652 struct i2c_adapter* i2c)
653{
654 struct mt312_state* state = NULL;
655
656 /* allocate memory for the internal state */
657 state = kmalloc(sizeof(struct mt312_state), GFP_KERNEL);
658 if (state == NULL)
659 goto error;
660
661 /* setup the state */
662 state->config = config;
663 state->i2c = i2c;
664 memcpy(&state->ops, &vp310_mt312_ops, sizeof(struct dvb_frontend_ops));
665 strcpy(state->ops.info.name, "Zarlink MT312 DVB-S");
666
667 /* check if the demod is there */
668 if (mt312_readreg(state, ID, &state->id) < 0)
669 goto error;
670 if (state->id != ID_MT312) {
671 goto error;
672 }
673
674 /* create dvb_frontend */
675 state->frequency = 60;
676 state->frontend.ops = &state->ops;
677 state->frontend.demodulator_priv = state;
678 return &state->frontend;
679
680error:
681 kfree(state);
682 return NULL;
683}
684
685static struct dvb_frontend_ops vp310_mt312_ops = { 615static struct dvb_frontend_ops vp310_mt312_ops = {
686 616
687 .info = { 617 .info = {
@@ -720,6 +650,49 @@ static struct dvb_frontend_ops vp310_mt312_ops = {
720 .set_voltage = mt312_set_voltage, 650 .set_voltage = mt312_set_voltage,
721}; 651};
722 652
653struct dvb_frontend* vp310_mt312_attach(const struct mt312_config* config,
654 struct i2c_adapter* i2c)
655{
656 struct mt312_state* state = NULL;
657
658 /* allocate memory for the internal state */
659 state = kmalloc(sizeof(struct mt312_state), GFP_KERNEL);
660 if (state == NULL)
661 goto error;
662
663 /* setup the state */
664 state->config = config;
665 state->i2c = i2c;
666 memcpy(&state->ops, &vp310_mt312_ops, sizeof(struct dvb_frontend_ops));
667
668 /* check if the demod is there */
669 if (mt312_readreg(state, ID, &state->id) < 0)
670 goto error;
671
672 switch (state->id) {
673 case ID_VP310:
674 strcpy(state->ops.info.name, "Zarlink VP310 DVB-S");
675 state->frequency = 90;
676 break;
677 case ID_MT312:
678 strcpy(state->ops.info.name, "Zarlink MT312 DVB-S");
679 state->frequency = 60;
680 break;
681 default:
682 printk (KERN_WARNING "Only Zarlink VP310/MT312 are supported chips.\n");
683 goto error;
684 }
685
686 /* create dvb_frontend */
687 state->frontend.ops = &state->ops;
688 state->frontend.demodulator_priv = state;
689 return &state->frontend;
690
691error:
692 kfree(state);
693 return NULL;
694}
695
723module_param(debug, int, 0644); 696module_param(debug, int, 0644);
724MODULE_PARM_DESC(debug, "Turn on/off frontend debugging (default:off)."); 697MODULE_PARM_DESC(debug, "Turn on/off frontend debugging (default:off).");
725 698
@@ -727,5 +700,4 @@ MODULE_DESCRIPTION("Zarlink VP310/MT312 DVB-S Demodulator driver");
727MODULE_AUTHOR("Andreas Oberritter <obi@linuxtv.org>"); 700MODULE_AUTHOR("Andreas Oberritter <obi@linuxtv.org>");
728MODULE_LICENSE("GPL"); 701MODULE_LICENSE("GPL");
729 702
730EXPORT_SYMBOL(mt312_attach); 703EXPORT_SYMBOL(vp310_mt312_attach);
731EXPORT_SYMBOL(vp310_attach);
diff --git a/drivers/media/dvb/frontends/mt312.h b/drivers/media/dvb/frontends/mt312.h
index b3a53a73a117..074d844f0139 100644
--- a/drivers/media/dvb/frontends/mt312.h
+++ b/drivers/media/dvb/frontends/mt312.h
@@ -38,10 +38,8 @@ struct mt312_config
38 int (*pll_set)(struct dvb_frontend* fe, struct dvb_frontend_parameters* params); 38 int (*pll_set)(struct dvb_frontend* fe, struct dvb_frontend_parameters* params);
39}; 39};
40 40
41extern struct dvb_frontend* mt312_attach(const struct mt312_config* config, 41struct dvb_frontend* vp310_mt312_attach(const struct mt312_config* config,
42 struct i2c_adapter* i2c); 42 struct i2c_adapter* i2c);
43 43
44extern struct dvb_frontend* vp310_attach(const struct mt312_config* config,
45 struct i2c_adapter* i2c);
46 44
47#endif // MT312_H 45#endif // MT312_H
diff --git a/drivers/media/dvb/frontends/stv0297.c b/drivers/media/dvb/frontends/stv0297.c
index 6122ba754bc5..eb15676d374f 100644
--- a/drivers/media/dvb/frontends/stv0297.c
+++ b/drivers/media/dvb/frontends/stv0297.c
@@ -393,10 +393,6 @@ static int stv0297_set_frontend(struct dvb_frontend *fe, struct dvb_frontend_par
393 break; 393 break;
394 394
395 case QAM_128: 395 case QAM_128:
396 delay = 150;
397 sweeprate = 1000;
398 break;
399
400 case QAM_256: 396 case QAM_256:
401 delay = 200; 397 delay = 200;
402 sweeprate = 500; 398 sweeprate = 500;
diff --git a/drivers/media/dvb/ttpci/av7110.c b/drivers/media/dvb/ttpci/av7110.c
index d36369e9e88f..7c6ccb96b157 100644
--- a/drivers/media/dvb/ttpci/av7110.c
+++ b/drivers/media/dvb/ttpci/av7110.c
@@ -1439,7 +1439,7 @@ static int check_firmware(struct av7110* av7110)
1439 len = ntohl(*(u32*) ptr); 1439 len = ntohl(*(u32*) ptr);
1440 ptr += 4; 1440 ptr += 4;
1441 if (len >= 512) { 1441 if (len >= 512) {
1442 printk("dvb-ttpci: dpram file is way to big.\n"); 1442 printk("dvb-ttpci: dpram file is way too big.\n");
1443 return -EINVAL; 1443 return -EINVAL;
1444 } 1444 }
1445 if (crc != crc32_le(0, ptr, len)) { 1445 if (crc != crc32_le(0, ptr, len)) {
@@ -2477,7 +2477,8 @@ static int frontend_init(struct av7110 *av7110)
2477 * The same behaviour of missing VSYNC can be duplicated on budget 2477 * The same behaviour of missing VSYNC can be duplicated on budget
2478 * cards, by seting DD1_INIT trigger mode 7 in 3rd nibble. 2478 * cards, by seting DD1_INIT trigger mode 7 in 3rd nibble.
2479 */ 2479 */
2480static int av7110_attach(struct saa7146_dev* dev, struct saa7146_pci_extension_data *pci_ext) 2480static int __devinit av7110_attach(struct saa7146_dev* dev,
2481 struct saa7146_pci_extension_data *pci_ext)
2481{ 2482{
2482 const int length = TS_WIDTH * TS_HEIGHT; 2483 const int length = TS_WIDTH * TS_HEIGHT;
2483 struct pci_dev *pdev = dev->pci; 2484 struct pci_dev *pdev = dev->pci;
@@ -2827,7 +2828,7 @@ err_kfree_0:
2827 goto out; 2828 goto out;
2828} 2829}
2829 2830
2830static int av7110_detach(struct saa7146_dev* saa) 2831static int __devexit av7110_detach(struct saa7146_dev* saa)
2831{ 2832{
2832 struct av7110 *av7110 = saa->ext_priv; 2833 struct av7110 *av7110 = saa->ext_priv;
2833 dprintk(4, "%p\n", av7110); 2834 dprintk(4, "%p\n", av7110);
@@ -2974,7 +2975,7 @@ static struct saa7146_extension av7110_extension = {
2974 .module = THIS_MODULE, 2975 .module = THIS_MODULE,
2975 .pci_tbl = &pci_tbl[0], 2976 .pci_tbl = &pci_tbl[0],
2976 .attach = av7110_attach, 2977 .attach = av7110_attach,
2977 .detach = av7110_detach, 2978 .detach = __devexit_p(av7110_detach),
2978 2979
2979 .irq_mask = MASK_19 | MASK_03 | MASK_10, 2980 .irq_mask = MASK_19 | MASK_03 | MASK_10,
2980 .irq_func = av7110_irq, 2981 .irq_func = av7110_irq,
diff --git a/drivers/media/dvb/ttpci/av7110_hw.c b/drivers/media/dvb/ttpci/av7110_hw.c
index b2e63e9fc053..0bb6e74ae7f0 100644
--- a/drivers/media/dvb/ttpci/av7110_hw.c
+++ b/drivers/media/dvb/ttpci/av7110_hw.c
@@ -245,6 +245,9 @@ int av7110_bootarm(struct av7110 *av7110)
245 245
246 /* test DEBI */ 246 /* test DEBI */
247 iwdebi(av7110, DEBISWAP, DPRAM_BASE, 0x76543210, 4); 247 iwdebi(av7110, DEBISWAP, DPRAM_BASE, 0x76543210, 4);
248 /* FIXME: Why does Nexus CA require 2x iwdebi for first init? */
249 iwdebi(av7110, DEBISWAP, DPRAM_BASE, 0x76543210, 4);
250
248 if ((ret=irdebi(av7110, DEBINOSWAP, DPRAM_BASE, 0, 4)) != 0x10325476) { 251 if ((ret=irdebi(av7110, DEBINOSWAP, DPRAM_BASE, 0, 4)) != 0x10325476) {
249 printk(KERN_ERR "dvb-ttpci: debi test in av7110_bootarm() failed: " 252 printk(KERN_ERR "dvb-ttpci: debi test in av7110_bootarm() failed: "
250 "%08x != %08x (check your BIOS 'Plug&Play OS' settings)\n", 253 "%08x != %08x (check your BIOS 'Plug&Play OS' settings)\n",
diff --git a/drivers/media/dvb/ttpci/av7110_ir.c b/drivers/media/dvb/ttpci/av7110_ir.c
index 617e4f6c0ed7..d54bbcdde2cc 100644
--- a/drivers/media/dvb/ttpci/av7110_ir.c
+++ b/drivers/media/dvb/ttpci/av7110_ir.c
@@ -208,7 +208,7 @@ static void ir_handler(struct av7110 *av7110, u32 ircom)
208} 208}
209 209
210 210
211int __init av7110_ir_init(struct av7110 *av7110) 211int __devinit av7110_ir_init(struct av7110 *av7110)
212{ 212{
213 static struct proc_dir_entry *e; 213 static struct proc_dir_entry *e;
214 214
@@ -248,7 +248,7 @@ int __init av7110_ir_init(struct av7110 *av7110)
248} 248}
249 249
250 250
251void __exit av7110_ir_exit(struct av7110 *av7110) 251void __devexit av7110_ir_exit(struct av7110 *av7110)
252{ 252{
253 int i; 253 int i;
254 254
diff --git a/drivers/media/video/cpia.c b/drivers/media/video/cpia.c
index 9f59541155d9..85d964b5b33c 100644
--- a/drivers/media/video/cpia.c
+++ b/drivers/media/video/cpia.c
@@ -3369,7 +3369,7 @@ static int cpia_do_ioctl(struct inode *inode, struct file *file,
3369 //DBG("cpia_ioctl: %u\n", ioctlnr); 3369 //DBG("cpia_ioctl: %u\n", ioctlnr);
3370 3370
3371 switch (ioctlnr) { 3371 switch (ioctlnr) {
3372 /* query capabilites */ 3372 /* query capabilities */
3373 case VIDIOCGCAP: 3373 case VIDIOCGCAP:
3374 { 3374 {
3375 struct video_capability *b = arg; 3375 struct video_capability *b = arg;
diff --git a/drivers/media/video/cx25840/cx25840-core.c b/drivers/media/video/cx25840/cx25840-core.c
index 08ffd1f325fc..5588b9a5c430 100644
--- a/drivers/media/video/cx25840/cx25840-core.c
+++ b/drivers/media/video/cx25840/cx25840-core.c
@@ -567,7 +567,7 @@ static struct v4l2_queryctrl cx25840_qctrl[] = {
567 .type = V4L2_CTRL_TYPE_INTEGER, 567 .type = V4L2_CTRL_TYPE_INTEGER,
568 .name = "Contrast", 568 .name = "Contrast",
569 .minimum = 0, 569 .minimum = 0,
570 .maximum = 255, 570 .maximum = 127,
571 .step = 1, 571 .step = 1,
572 .default_value = 64, 572 .default_value = 64,
573 .flags = 0, 573 .flags = 0,
@@ -576,7 +576,7 @@ static struct v4l2_queryctrl cx25840_qctrl[] = {
576 .type = V4L2_CTRL_TYPE_INTEGER, 576 .type = V4L2_CTRL_TYPE_INTEGER,
577 .name = "Saturation", 577 .name = "Saturation",
578 .minimum = 0, 578 .minimum = 0,
579 .maximum = 255, 579 .maximum = 127,
580 .step = 1, 580 .step = 1,
581 .default_value = 64, 581 .default_value = 64,
582 .flags = 0, 582 .flags = 0,
diff --git a/drivers/media/video/saa7115.c b/drivers/media/video/saa7115.c
index 048d000941c7..ffd87ce55556 100644
--- a/drivers/media/video/saa7115.c
+++ b/drivers/media/video/saa7115.c
@@ -1027,7 +1027,7 @@ static struct v4l2_queryctrl saa7115_qctrl[] = {
1027 .type = V4L2_CTRL_TYPE_INTEGER, 1027 .type = V4L2_CTRL_TYPE_INTEGER,
1028 .name = "Contrast", 1028 .name = "Contrast",
1029 .minimum = 0, 1029 .minimum = 0,
1030 .maximum = 255, 1030 .maximum = 127,
1031 .step = 1, 1031 .step = 1,
1032 .default_value = 64, 1032 .default_value = 64,
1033 .flags = 0, 1033 .flags = 0,
@@ -1036,7 +1036,7 @@ static struct v4l2_queryctrl saa7115_qctrl[] = {
1036 .type = V4L2_CTRL_TYPE_INTEGER, 1036 .type = V4L2_CTRL_TYPE_INTEGER,
1037 .name = "Saturation", 1037 .name = "Saturation",
1038 .minimum = 0, 1038 .minimum = 0,
1039 .maximum = 255, 1039 .maximum = 127,
1040 .step = 1, 1040 .step = 1,
1041 .default_value = 64, 1041 .default_value = 64,
1042 .flags = 0, 1042 .flags = 0,
diff --git a/drivers/media/video/saa7134/saa7134-alsa.c b/drivers/media/video/saa7134/saa7134-alsa.c
index a7a6ab9298a9..7df5e0826e12 100644
--- a/drivers/media/video/saa7134/saa7134-alsa.c
+++ b/drivers/media/video/saa7134/saa7134-alsa.c
@@ -54,10 +54,12 @@ MODULE_PARM_DESC(debug,"enable debug messages [alsa]");
54 54
55static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ 55static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
56static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ 56static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
57static int enable[SNDRV_CARDS] = {1, [1 ... (SNDRV_CARDS - 1)] = 0}; 57static int enable[SNDRV_CARDS] = {1, [1 ... (SNDRV_CARDS - 1)] = 1};
58 58
59module_param_array(index, int, NULL, 0444); 59module_param_array(index, int, NULL, 0444);
60module_param_array(enable, int, NULL, 0444);
60MODULE_PARM_DESC(index, "Index value for SAA7134 capture interface(s)."); 61MODULE_PARM_DESC(index, "Index value for SAA7134 capture interface(s).");
62MODULE_PARM_DESC(enable, "Enable (or not) the SAA7134 capture interface(s).");
61 63
62#define dprintk(fmt, arg...) if (debug) \ 64#define dprintk(fmt, arg...) if (debug) \
63 printk(KERN_DEBUG "%s/alsa: " fmt, dev->name , ##arg) 65 printk(KERN_DEBUG "%s/alsa: " fmt, dev->name , ##arg)
diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c
index 5a35d3b6550d..6bc63a4086c1 100644
--- a/drivers/media/video/saa7134/saa7134-cards.c
+++ b/drivers/media/video/saa7134/saa7134-cards.c
@@ -977,7 +977,7 @@ struct saa7134_board saa7134_boards[] = {
977 .radio_type = UNSET, 977 .radio_type = UNSET,
978 .tuner_addr = ADDR_UNSET, 978 .tuner_addr = ADDR_UNSET,
979 .radio_addr = ADDR_UNSET, 979 .radio_addr = ADDR_UNSET,
980 .tda9887_conf = TDA9887_PRESENT | TDA9887_INTERCARRIER | TDA9887_PORT2_ACTIVE, 980 .tda9887_conf = TDA9887_PRESENT | TDA9887_INTERCARRIER | TDA9887_PORT2_INACTIVE,
981 .inputs = {{ 981 .inputs = {{
982 .name = name_tv, 982 .name = name_tv,
983 .vmux = 3, 983 .vmux = 3,
@@ -1666,7 +1666,7 @@ struct saa7134_board saa7134_boards[] = {
1666 .radio_type = UNSET, 1666 .radio_type = UNSET,
1667 .tuner_addr = ADDR_UNSET, 1667 .tuner_addr = ADDR_UNSET,
1668 .radio_addr = ADDR_UNSET, 1668 .radio_addr = ADDR_UNSET,
1669 .tda9887_conf = TDA9887_PRESENT | TDA9887_INTERCARRIER | TDA9887_PORT2_ACTIVE, 1669 .tda9887_conf = TDA9887_PRESENT | TDA9887_INTERCARRIER | TDA9887_PORT2_INACTIVE,
1670 .mpeg = SAA7134_MPEG_DVB, 1670 .mpeg = SAA7134_MPEG_DVB,
1671 .inputs = {{ 1671 .inputs = {{
1672 .name = name_tv, 1672 .name = name_tv,
@@ -2187,7 +2187,7 @@ struct saa7134_board saa7134_boards[] = {
2187 .radio_type = UNSET, 2187 .radio_type = UNSET,
2188 .tuner_addr = 0x61, 2188 .tuner_addr = 0x61,
2189 .radio_addr = ADDR_UNSET, 2189 .radio_addr = ADDR_UNSET,
2190 .tda9887_conf = TDA9887_PRESENT, 2190 .tda9887_conf = TDA9887_PRESENT | TDA9887_PORT1_ACTIVE,
2191 .mpeg = SAA7134_MPEG_DVB, 2191 .mpeg = SAA7134_MPEG_DVB,
2192 .inputs = {{ 2192 .inputs = {{
2193 .name = name_tv, 2193 .name = name_tv,
@@ -2211,7 +2211,7 @@ struct saa7134_board saa7134_boards[] = {
2211 .radio_type = UNSET, 2211 .radio_type = UNSET,
2212 .tuner_addr = 0x61, 2212 .tuner_addr = 0x61,
2213 .radio_addr = ADDR_UNSET, 2213 .radio_addr = ADDR_UNSET,
2214 .tda9887_conf = TDA9887_PRESENT, 2214 .tda9887_conf = TDA9887_PRESENT | TDA9887_PORT1_ACTIVE,
2215 .mpeg = SAA7134_MPEG_DVB, 2215 .mpeg = SAA7134_MPEG_DVB,
2216 .inputs = {{ 2216 .inputs = {{
2217 .name = name_tv, 2217 .name = name_tv,
@@ -2392,7 +2392,7 @@ struct saa7134_board saa7134_boards[] = {
2392 }}, 2392 }},
2393 }, 2393 },
2394 [SAA7134_BOARD_PINNACLE_PCTV_110i] = { 2394 [SAA7134_BOARD_PINNACLE_PCTV_110i] = {
2395 .name = "Pinnacle PCTV 110i (saa7133)", 2395 .name = "Pinnacle PCTV 40i/50i/110i (saa7133)",
2396 .audio_clock = 0x00187de7, 2396 .audio_clock = 0x00187de7,
2397 .tuner_type = TUNER_PHILIPS_TDA8290, 2397 .tuner_type = TUNER_PHILIPS_TDA8290,
2398 .radio_type = UNSET, 2398 .radio_type = UNSET,
@@ -2407,6 +2407,10 @@ struct saa7134_board saa7134_boards[] = {
2407 },{ 2407 },{
2408 .name = name_comp1, 2408 .name = name_comp1,
2409 .vmux = 1, 2409 .vmux = 1,
2410 .amux = LINE2,
2411 },{
2412 .name = name_comp2,
2413 .vmux = 0,
2410 .amux = LINE2, 2414 .amux = LINE2,
2411 },{ 2415 },{
2412 .name = name_svideo, 2416 .name = name_svideo,
@@ -2745,7 +2749,7 @@ struct pci_device_id saa7134_pci_tbl[] = {
2745 .vendor = PCI_VENDOR_ID_PHILIPS, 2749 .vendor = PCI_VENDOR_ID_PHILIPS,
2746 .device = PCI_DEVICE_ID_PHILIPS_SAA7130, 2750 .device = PCI_DEVICE_ID_PHILIPS_SAA7130,
2747 .subvendor = 0x1048, 2751 .subvendor = 0x1048,
2748 .subdevice = 0x226b, 2752 .subdevice = 0x226a,
2749 .driver_data = SAA7134_BOARD_ELSA_500TV, 2753 .driver_data = SAA7134_BOARD_ELSA_500TV,
2750 },{ 2754 },{
2751 .vendor = PCI_VENDOR_ID_PHILIPS, 2755 .vendor = PCI_VENDOR_ID_PHILIPS,
@@ -3201,6 +3205,11 @@ int saa7134_board_init1(struct saa7134_dev *dev)
3201 /* power-up tuner chip */ 3205 /* power-up tuner chip */
3202 saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, 0x00040000, 0x00040000); 3206 saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, 0x00040000, 0x00040000);
3203 saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, 0x00040000, 0x00000000); 3207 saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, 0x00040000, 0x00000000);
3208 case SAA7134_BOARD_PINNACLE_300I_DVBT_PAL:
3209 /* this turns the remote control chip off to work around a bug in it */
3210 saa_writeb(SAA7134_GPIO_GPMODE1, 0x80);
3211 saa_writeb(SAA7134_GPIO_GPSTATUS1, 0x80);
3212 break;
3204 case SAA7134_BOARD_MONSTERTV_MOBILE: 3213 case SAA7134_BOARD_MONSTERTV_MOBILE:
3205 /* power-up tuner chip */ 3214 /* power-up tuner chip */
3206 saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, 0x00040000, 0x00040000); 3215 saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, 0x00040000, 0x00040000);
diff --git a/drivers/media/video/saa7134/saa7134-dvb.c b/drivers/media/video/saa7134/saa7134-dvb.c
index 1a536e865277..9db8e13f21c3 100644
--- a/drivers/media/video/saa7134/saa7134-dvb.c
+++ b/drivers/media/video/saa7134/saa7134-dvb.c
@@ -110,6 +110,7 @@ static int mt352_pinnacle_init(struct dvb_frontend* fe)
110 mt352_write(fe, fsm_ctl_cfg, sizeof(fsm_ctl_cfg)); 110 mt352_write(fe, fsm_ctl_cfg, sizeof(fsm_ctl_cfg));
111 mt352_write(fe, scan_ctl_cfg, sizeof(scan_ctl_cfg)); 111 mt352_write(fe, scan_ctl_cfg, sizeof(scan_ctl_cfg));
112 mt352_write(fe, irq_cfg, sizeof(irq_cfg)); 112 mt352_write(fe, irq_cfg, sizeof(irq_cfg));
113
113 return 0; 114 return 0;
114} 115}
115 116
@@ -117,8 +118,10 @@ static int mt352_pinnacle_pll_set(struct dvb_frontend* fe,
117 struct dvb_frontend_parameters* params, 118 struct dvb_frontend_parameters* params,
118 u8* pllbuf) 119 u8* pllbuf)
119{ 120{
120 static int on = TDA9887_PRESENT | TDA9887_PORT2_INACTIVE; 121 u8 off[] = { 0x00, 0xf1};
121 static int off = TDA9887_PRESENT | TDA9887_PORT2_ACTIVE; 122 u8 on[] = { 0x00, 0x71};
123 struct i2c_msg msg = {.addr=0x43, .flags=0, .buf=off, .len = sizeof(off)};
124
122 struct saa7134_dev *dev = fe->dvb->priv; 125 struct saa7134_dev *dev = fe->dvb->priv;
123 struct v4l2_frequency f; 126 struct v4l2_frequency f;
124 127
@@ -126,9 +129,10 @@ static int mt352_pinnacle_pll_set(struct dvb_frontend* fe,
126 f.tuner = 0; 129 f.tuner = 0;
127 f.type = V4L2_TUNER_DIGITAL_TV; 130 f.type = V4L2_TUNER_DIGITAL_TV;
128 f.frequency = params->frequency / 1000 * 16 / 1000; 131 f.frequency = params->frequency / 1000 * 16 / 1000;
129 saa7134_i2c_call_clients(dev,TDA9887_SET_CONFIG,&on); 132 i2c_transfer(&dev->i2c_adap, &msg, 1);
130 saa7134_i2c_call_clients(dev,VIDIOC_S_FREQUENCY,&f); 133 saa7134_i2c_call_clients(dev,VIDIOC_S_FREQUENCY,&f);
131 saa7134_i2c_call_clients(dev,TDA9887_SET_CONFIG,&off); 134 msg.buf = on;
135 i2c_transfer(&dev->i2c_adap, &msg, 1);
132 136
133 pinnacle_antenna_pwr(dev, antenna_pwr); 137 pinnacle_antenna_pwr(dev, antenna_pwr);
134 138
diff --git a/drivers/media/video/tda8290.c b/drivers/media/video/tda8290.c
index 7b4fb282ac82..a796a4e1917c 100644
--- a/drivers/media/video/tda8290.c
+++ b/drivers/media/video/tda8290.c
@@ -580,9 +580,10 @@ int tda8290_init(struct i2c_client *c)
580 580
581int tda8290_probe(struct i2c_client *c) 581int tda8290_probe(struct i2c_client *c)
582{ 582{
583 unsigned char soft_reset[] = { 0x00, 0x00 }; 583 unsigned char soft_reset[] = { 0x00, 0x00 };
584 unsigned char easy_mode_b[] = { 0x01, 0x02 }; 584 unsigned char easy_mode_b[] = { 0x01, 0x02 };
585 unsigned char easy_mode_g[] = { 0x01, 0x04 }; 585 unsigned char easy_mode_g[] = { 0x01, 0x04 };
586 unsigned char restore_9886[] = { 0x00, 0xd6, 0x30 };
586 unsigned char addr_dto_lsb = 0x07; 587 unsigned char addr_dto_lsb = 0x07;
587 unsigned char data; 588 unsigned char data;
588 589
@@ -599,6 +600,7 @@ int tda8290_probe(struct i2c_client *c)
599 return 0; 600 return 0;
600 } 601 }
601 } 602 }
603 i2c_master_send(c, restore_9886, 3);
602 return -1; 604 return -1;
603} 605}
604 606
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c
index e7ee619d62c5..b6101bf446d4 100644
--- a/drivers/media/video/tuner-core.c
+++ b/drivers/media/video/tuner-core.c
@@ -713,8 +713,9 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
713 struct v4l2_frequency *f = arg; 713 struct v4l2_frequency *f = arg;
714 714
715 switch_v4l2(); 715 switch_v4l2();
716 if (V4L2_TUNER_RADIO == f->type && 716 if ((V4L2_TUNER_RADIO == f->type && V4L2_TUNER_RADIO != t->mode)
717 V4L2_TUNER_RADIO != t->mode) { 717 || (V4L2_TUNER_DIGITAL_TV == f->type
718 && V4L2_TUNER_DIGITAL_TV != t->mode)) {
718 if (set_mode (client, t, f->type, "VIDIOC_S_FREQUENCY") 719 if (set_mode (client, t, f->type, "VIDIOC_S_FREQUENCY")
719 == EINVAL) 720 == EINVAL)
720 return 0; 721 return 0;
diff --git a/drivers/media/video/videocodec.h b/drivers/media/video/videocodec.h
index 156ae57096fe..b1239ac7f371 100644
--- a/drivers/media/video/videocodec.h
+++ b/drivers/media/video/videocodec.h
@@ -56,7 +56,7 @@
56 the slave is bound to it). Otherwise it doesn't need this functions and 56 the slave is bound to it). Otherwise it doesn't need this functions and
57 therfor they may not be initialized. 57 therfor they may not be initialized.
58 58
59 The other fuctions are just for convenience, as they are for shure used by 59 The other fuctions are just for convenience, as they are for sure used by
60 most/all of the codecs. The last ones may be ommited, too. 60 most/all of the codecs. The last ones may be ommited, too.
61 61
62 See the structure declaration below for more information and which data has 62 See the structure declaration below for more information and which data has
diff --git a/drivers/media/video/zr36050.c b/drivers/media/video/zr36050.c
index bd0cd28543ca..6699725be605 100644
--- a/drivers/media/video/zr36050.c
+++ b/drivers/media/video/zr36050.c
@@ -159,7 +159,7 @@ zr36050_wait_end (struct zr36050 *ptr)
159 159
160 while (!(zr36050_read_status1(ptr) & 0x4)) { 160 while (!(zr36050_read_status1(ptr) & 0x4)) {
161 udelay(1); 161 udelay(1);
162 if (i++ > 200000) { // 200ms, there is for shure something wrong!!! 162 if (i++ > 200000) { // 200ms, there is for sure something wrong!!!
163 dprintk(1, 163 dprintk(1,
164 "%s: timout at wait_end (last status: 0x%02x)\n", 164 "%s: timout at wait_end (last status: 0x%02x)\n",
165 ptr->name, ptr->status1); 165 ptr->name, ptr->status1);
diff --git a/drivers/media/video/zr36060.c b/drivers/media/video/zr36060.c
index 28fa31a5f150..d8dd003a7aad 100644
--- a/drivers/media/video/zr36060.c
+++ b/drivers/media/video/zr36060.c
@@ -161,7 +161,7 @@ zr36060_wait_end (struct zr36060 *ptr)
161 161
162 while (zr36060_read_status(ptr) & ZR060_CFSR_Busy) { 162 while (zr36060_read_status(ptr) & ZR060_CFSR_Busy) {
163 udelay(1); 163 udelay(1);
164 if (i++ > 200000) { // 200ms, there is for shure something wrong!!! 164 if (i++ > 200000) { // 200ms, there is for sure something wrong!!!
165 dprintk(1, 165 dprintk(1,
166 "%s: timout at wait_end (last status: 0x%02x)\n", 166 "%s: timout at wait_end (last status: 0x%02x)\n",
167 ptr->name, ptr->status); 167 ptr->name, ptr->status);
diff --git a/drivers/media/video/zr36120_i2c.c b/drivers/media/video/zr36120_i2c.c
index 6bfe84d657f1..21fde43a6aed 100644
--- a/drivers/media/video/zr36120_i2c.c
+++ b/drivers/media/video/zr36120_i2c.c
@@ -65,7 +65,7 @@ void attach_inform(struct i2c_bus *bus, int id)
65 case I2C_DRIVERID_VIDEODECODER: 65 case I2C_DRIVERID_VIDEODECODER:
66 DEBUG(printk(CARD_INFO "decoder attached\n",CARD)); 66 DEBUG(printk(CARD_INFO "decoder attached\n",CARD));
67 67
68 /* fetch the capabilites of the decoder */ 68 /* fetch the capabilities of the decoder */
69 rv = i2c_control_device(&ztv->i2c, I2C_DRIVERID_VIDEODECODER, DECODER_GET_CAPABILITIES, &dc); 69 rv = i2c_control_device(&ztv->i2c, I2C_DRIVERID_VIDEODECODER, DECODER_GET_CAPABILITIES, &dc);
70 if (rv) { 70 if (rv) {
71 DEBUG(printk(CARD_DEBUG "decoder is not V4L aware!\n",CARD)); 71 DEBUG(printk(CARD_DEBUG "decoder is not V4L aware!\n",CARD));
diff --git a/drivers/misc/ibmasm/ibmasm.h b/drivers/misc/ibmasm/ibmasm.h
index 1cef2387fa65..6aba41954448 100644
--- a/drivers/misc/ibmasm/ibmasm.h
+++ b/drivers/misc/ibmasm/ibmasm.h
@@ -101,15 +101,16 @@ struct command {
101static inline void command_put(struct command *cmd) 101static inline void command_put(struct command *cmd)
102{ 102{
103 unsigned long flags; 103 unsigned long flags;
104 spinlock_t *lock = cmd->lock;
104 105
105 spin_lock_irqsave(cmd->lock, flags); 106 spin_lock_irqsave(lock, flags);
106 kobject_put(&cmd->kobj); 107 kobject_put(&cmd->kobj);
107 spin_unlock_irqrestore(cmd->lock, flags); 108 spin_unlock_irqrestore(lock, flags);
108} 109}
109 110
110static inline void command_get(struct command *cmd) 111static inline void command_get(struct command *cmd)
111{ 112{
112 kobject_get(&cmd->kobj); 113 kobject_get(&cmd->kobj);
113} 114}
114 115
115 116
diff --git a/drivers/net/3c509.c b/drivers/net/3c509.c
index 824e430486c2..830528dce0ca 100644
--- a/drivers/net/3c509.c
+++ b/drivers/net/3c509.c
@@ -1574,6 +1574,7 @@ MODULE_LICENSE("GPL");
1574 1574
1575static int __init el3_init_module(void) 1575static int __init el3_init_module(void)
1576{ 1576{
1577 int ret = 0;
1577 el3_cards = 0; 1578 el3_cards = 0;
1578 1579
1579 if (debug >= 0) 1580 if (debug >= 0)
@@ -1589,14 +1590,16 @@ static int __init el3_init_module(void)
1589 } 1590 }
1590 1591
1591#ifdef CONFIG_EISA 1592#ifdef CONFIG_EISA
1592 if (eisa_driver_register (&el3_eisa_driver) < 0) { 1593 ret = eisa_driver_register(&el3_eisa_driver);
1593 eisa_driver_unregister (&el3_eisa_driver);
1594 }
1595#endif 1594#endif
1596#ifdef CONFIG_MCA 1595#ifdef CONFIG_MCA
1597 mca_register_driver(&el3_mca_driver); 1596 {
1597 int err = mca_register_driver(&el3_mca_driver);
1598 if (ret == 0)
1599 ret = err;
1600 }
1598#endif 1601#endif
1599 return 0; 1602 return ret;
1600} 1603}
1601 1604
1602static void __exit el3_cleanup_module(void) 1605static void __exit el3_cleanup_module(void)
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index bdf294d2df26..d4d8e5f9ebf1 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -1087,7 +1087,8 @@ config NE2000
1087 without a specific driver are compatible with NE2000. 1087 without a specific driver are compatible with NE2000.
1088 1088
1089 If you have a PCI NE2000 card however, say N here and Y to "PCI 1089 If you have a PCI NE2000 card however, say N here and Y to "PCI
1090 NE2000 support", above. If you have a NE2000 card and are running on 1090 NE2000 and clone support" under "EISA, VLB, PCI and on board
1091 controllers" below. If you have a NE2000 card and are running on
1091 an MCA system (a bus system used on some IBM PS/2 computers and 1092 an MCA system (a bus system used on some IBM PS/2 computers and
1092 laptops), say N here and Y to "NE/2 (ne2000 MCA version) support", 1093 laptops), say N here and Y to "NE/2 (ne2000 MCA version) support",
1093 below. 1094 below.
diff --git a/drivers/net/de620.c b/drivers/net/de620.c
index 0069f5fa973a..22fc5b869a60 100644
--- a/drivers/net/de620.c
+++ b/drivers/net/de620.c
@@ -1012,7 +1012,7 @@ static int __init read_eeprom(struct net_device *dev)
1012#ifdef MODULE 1012#ifdef MODULE
1013static struct net_device *de620_dev; 1013static struct net_device *de620_dev;
1014 1014
1015int init_module(void) 1015int __init init_module(void)
1016{ 1016{
1017 de620_dev = de620_probe(-1); 1017 de620_dev = de620_probe(-1);
1018 if (IS_ERR(de620_dev)) 1018 if (IS_ERR(de620_dev))
diff --git a/drivers/net/dl2k.c b/drivers/net/dl2k.c
index 6376b63d9b17..1f3627470c95 100644
--- a/drivers/net/dl2k.c
+++ b/drivers/net/dl2k.c
@@ -50,8 +50,8 @@
50 50
51*/ 51*/
52#define DRV_NAME "D-Link DL2000-based linux driver" 52#define DRV_NAME "D-Link DL2000-based linux driver"
53#define DRV_VERSION "v1.17a" 53#define DRV_VERSION "v1.17b"
54#define DRV_RELDATE "2002/10/04" 54#define DRV_RELDATE "2006/03/10"
55#include "dl2k.h" 55#include "dl2k.h"
56 56
57static char version[] __devinitdata = 57static char version[] __devinitdata =
@@ -765,7 +765,7 @@ rio_free_tx (struct net_device *dev, int irq)
765 break; 765 break;
766 skb = np->tx_skbuff[entry]; 766 skb = np->tx_skbuff[entry];
767 pci_unmap_single (np->pdev, 767 pci_unmap_single (np->pdev,
768 np->tx_ring[entry].fraginfo, 768 np->tx_ring[entry].fraginfo & 0xffffffffffff,
769 skb->len, PCI_DMA_TODEVICE); 769 skb->len, PCI_DMA_TODEVICE);
770 if (irq) 770 if (irq)
771 dev_kfree_skb_irq (skb); 771 dev_kfree_skb_irq (skb);
@@ -892,14 +892,16 @@ receive_packet (struct net_device *dev)
892 892
893 /* Small skbuffs for short packets */ 893 /* Small skbuffs for short packets */
894 if (pkt_len > copy_thresh) { 894 if (pkt_len > copy_thresh) {
895 pci_unmap_single (np->pdev, desc->fraginfo, 895 pci_unmap_single (np->pdev,
896 desc->fraginfo & 0xffffffffffff,
896 np->rx_buf_sz, 897 np->rx_buf_sz,
897 PCI_DMA_FROMDEVICE); 898 PCI_DMA_FROMDEVICE);
898 skb_put (skb = np->rx_skbuff[entry], pkt_len); 899 skb_put (skb = np->rx_skbuff[entry], pkt_len);
899 np->rx_skbuff[entry] = NULL; 900 np->rx_skbuff[entry] = NULL;
900 } else if ((skb = dev_alloc_skb (pkt_len + 2)) != NULL) { 901 } else if ((skb = dev_alloc_skb (pkt_len + 2)) != NULL) {
901 pci_dma_sync_single_for_cpu(np->pdev, 902 pci_dma_sync_single_for_cpu(np->pdev,
902 desc->fraginfo, 903 desc->fraginfo &
904 0xffffffffffff,
903 np->rx_buf_sz, 905 np->rx_buf_sz,
904 PCI_DMA_FROMDEVICE); 906 PCI_DMA_FROMDEVICE);
905 skb->dev = dev; 907 skb->dev = dev;
@@ -910,7 +912,8 @@ receive_packet (struct net_device *dev)
910 pkt_len, 0); 912 pkt_len, 0);
911 skb_put (skb, pkt_len); 913 skb_put (skb, pkt_len);
912 pci_dma_sync_single_for_device(np->pdev, 914 pci_dma_sync_single_for_device(np->pdev,
913 desc->fraginfo, 915 desc->fraginfo &
916 0xffffffffffff,
914 np->rx_buf_sz, 917 np->rx_buf_sz,
915 PCI_DMA_FROMDEVICE); 918 PCI_DMA_FROMDEVICE);
916 } 919 }
@@ -1796,8 +1799,9 @@ rio_close (struct net_device *dev)
1796 np->rx_ring[i].fraginfo = 0; 1799 np->rx_ring[i].fraginfo = 0;
1797 skb = np->rx_skbuff[i]; 1800 skb = np->rx_skbuff[i];
1798 if (skb) { 1801 if (skb) {
1799 pci_unmap_single (np->pdev, np->rx_ring[i].fraginfo, 1802 pci_unmap_single(np->pdev,
1800 skb->len, PCI_DMA_FROMDEVICE); 1803 np->rx_ring[i].fraginfo & 0xffffffffffff,
1804 skb->len, PCI_DMA_FROMDEVICE);
1801 dev_kfree_skb (skb); 1805 dev_kfree_skb (skb);
1802 np->rx_skbuff[i] = NULL; 1806 np->rx_skbuff[i] = NULL;
1803 } 1807 }
@@ -1805,8 +1809,9 @@ rio_close (struct net_device *dev)
1805 for (i = 0; i < TX_RING_SIZE; i++) { 1809 for (i = 0; i < TX_RING_SIZE; i++) {
1806 skb = np->tx_skbuff[i]; 1810 skb = np->tx_skbuff[i];
1807 if (skb) { 1811 if (skb) {
1808 pci_unmap_single (np->pdev, np->tx_ring[i].fraginfo, 1812 pci_unmap_single(np->pdev,
1809 skb->len, PCI_DMA_TODEVICE); 1813 np->tx_ring[i].fraginfo & 0xffffffffffff,
1814 skb->len, PCI_DMA_TODEVICE);
1810 dev_kfree_skb (skb); 1815 dev_kfree_skb (skb);
1811 np->tx_skbuff[i] = NULL; 1816 np->tx_skbuff[i] = NULL;
1812 } 1817 }
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 9adaf5fa9d48..0c631a77ccf6 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -2815,7 +2815,7 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
2815 printk(KERN_ERR 2815 printk(KERN_ERR
2816 "__pskb_pull_tail failed.\n"); 2816 "__pskb_pull_tail failed.\n");
2817 dev_kfree_skb_any(skb); 2817 dev_kfree_skb_any(skb);
2818 return -EFAULT; 2818 return NETDEV_TX_OK;
2819 } 2819 }
2820 len = skb->len - skb->data_len; 2820 len = skb->len - skb->data_len;
2821 break; 2821 break;
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 72c1630977d6..73260364cba3 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -74,7 +74,7 @@
74#define TX_RING_SIZE 512 74#define TX_RING_SIZE 512
75#define TX_DEF_PENDING (TX_RING_SIZE - 1) 75#define TX_DEF_PENDING (TX_RING_SIZE - 1)
76#define TX_MIN_PENDING 64 76#define TX_MIN_PENDING 64
77#define MAX_SKB_TX_LE (4 + 2*MAX_SKB_FRAGS) 77#define MAX_SKB_TX_LE (4 + (sizeof(dma_addr_t)/sizeof(u32))*MAX_SKB_FRAGS)
78 78
79#define STATUS_RING_SIZE 2048 /* 2 ports * (TX + 2*RX) */ 79#define STATUS_RING_SIZE 2048 /* 2 ports * (TX + 2*RX) */
80#define STATUS_LE_BYTES (STATUS_RING_SIZE*sizeof(struct sky2_status_le)) 80#define STATUS_LE_BYTES (STATUS_RING_SIZE*sizeof(struct sky2_status_le))
@@ -622,8 +622,8 @@ static void sky2_mac_init(struct sky2_hw *hw, unsigned port)
622 622
623 /* Configure Rx MAC FIFO */ 623 /* Configure Rx MAC FIFO */
624 sky2_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_RST_CLR); 624 sky2_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_RST_CLR);
625 sky2_write16(hw, SK_REG(port, RX_GMF_CTRL_T), 625 sky2_write32(hw, SK_REG(port, RX_GMF_CTRL_T),
626 GMF_RX_CTRL_DEF); 626 GMF_OPER_ON | GMF_RX_F_FL_ON);
627 627
628 /* Flush Rx MAC FIFO on any flow control or error */ 628 /* Flush Rx MAC FIFO on any flow control or error */
629 sky2_write16(hw, SK_REG(port, RX_GMF_FL_MSK), GMR_FS_ANY_ERR); 629 sky2_write16(hw, SK_REG(port, RX_GMF_FL_MSK), GMR_FS_ANY_ERR);
@@ -995,6 +995,10 @@ static int sky2_rx_start(struct sky2_port *sky2)
995 sky2_rx_add(sky2, re->mapaddr); 995 sky2_rx_add(sky2, re->mapaddr);
996 } 996 }
997 997
998 /* Truncate oversize frames */
999 sky2_write16(hw, SK_REG(sky2->port, RX_GMF_TR_THR), sky2->rx_bufsize - 8);
1000 sky2_write32(hw, SK_REG(sky2->port, RX_GMF_CTRL_T), RX_TRUNC_ON);
1001
998 /* Tell chip about available buffers */ 1002 /* Tell chip about available buffers */
999 sky2_write16(hw, Y2_QADDR(rxq, PREF_UNIT_PUT_IDX), sky2->rx_put); 1003 sky2_write16(hw, Y2_QADDR(rxq, PREF_UNIT_PUT_IDX), sky2->rx_put);
1000 sky2->rx_last_put = sky2_read16(hw, Y2_QADDR(rxq, PREF_UNIT_PUT_IDX)); 1004 sky2->rx_last_put = sky2_read16(hw, Y2_QADDR(rxq, PREF_UNIT_PUT_IDX));
@@ -1145,6 +1149,7 @@ static int sky2_xmit_frame(struct sk_buff *skb, struct net_device *dev)
1145 struct sky2_tx_le *le = NULL; 1149 struct sky2_tx_le *le = NULL;
1146 struct tx_ring_info *re; 1150 struct tx_ring_info *re;
1147 unsigned i, len; 1151 unsigned i, len;
1152 int avail;
1148 dma_addr_t mapping; 1153 dma_addr_t mapping;
1149 u32 addr64; 1154 u32 addr64;
1150 u16 mss; 1155 u16 mss;
@@ -1287,12 +1292,16 @@ static int sky2_xmit_frame(struct sk_buff *skb, struct net_device *dev)
1287 re->idx = sky2->tx_prod; 1292 re->idx = sky2->tx_prod;
1288 le->ctrl |= EOP; 1293 le->ctrl |= EOP;
1289 1294
1295 avail = tx_avail(sky2);
1296 if (mss != 0 || avail < TX_MIN_PENDING) {
1297 le->ctrl |= FRC_STAT;
1298 if (avail <= MAX_SKB_TX_LE)
1299 netif_stop_queue(dev);
1300 }
1301
1290 sky2_put_idx(hw, txqaddr[sky2->port], sky2->tx_prod, 1302 sky2_put_idx(hw, txqaddr[sky2->port], sky2->tx_prod,
1291 &sky2->tx_last_put, TX_RING_SIZE); 1303 &sky2->tx_last_put, TX_RING_SIZE);
1292 1304
1293 if (tx_avail(sky2) <= MAX_SKB_TX_LE)
1294 netif_stop_queue(dev);
1295
1296out_unlock: 1305out_unlock:
1297 spin_unlock(&sky2->tx_lock); 1306 spin_unlock(&sky2->tx_lock);
1298 1307
@@ -1707,10 +1716,12 @@ static void sky2_tx_timeout(struct net_device *dev)
1707 1716
1708 1717
1709#define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) 1718#define roundup(x, y) ((((x)+((y)-1))/(y))*(y))
1710/* Want receive buffer size to be multiple of 64 bits, and incl room for vlan */ 1719/* Want receive buffer size to be multiple of 64 bits
1720 * and incl room for vlan and truncation
1721 */
1711static inline unsigned sky2_buf_size(int mtu) 1722static inline unsigned sky2_buf_size(int mtu)
1712{ 1723{
1713 return roundup(mtu + ETH_HLEN + 4, 8); 1724 return roundup(mtu + ETH_HLEN + VLAN_HLEN, 8) + 8;
1714} 1725}
1715 1726
1716static int sky2_change_mtu(struct net_device *dev, int new_mtu) 1727static int sky2_change_mtu(struct net_device *dev, int new_mtu)
@@ -1793,7 +1804,7 @@ static struct sk_buff *sky2_receive(struct sky2_port *sky2,
1793 if (!(status & GMR_FS_RX_OK)) 1804 if (!(status & GMR_FS_RX_OK))
1794 goto resubmit; 1805 goto resubmit;
1795 1806
1796 if ((status >> 16) != length || length > sky2->rx_bufsize) 1807 if (length > sky2->netdev->mtu + ETH_HLEN)
1797 goto oversize; 1808 goto oversize;
1798 1809
1799 if (length < copybreak) { 1810 if (length < copybreak) {
@@ -3243,8 +3254,7 @@ static int __devinit sky2_probe(struct pci_dev *pdev,
3243 } 3254 }
3244 } 3255 }
3245 3256
3246 err = request_irq(pdev->irq, sky2_intr, SA_SHIRQ | SA_SAMPLE_RANDOM, 3257 err = request_irq(pdev->irq, sky2_intr, SA_SHIRQ, DRV_NAME, hw);
3247 DRV_NAME, hw);
3248 if (err) { 3258 if (err) {
3249 printk(KERN_ERR PFX "%s: cannot assign irq %d\n", 3259 printk(KERN_ERR PFX "%s: cannot assign irq %d\n",
3250 pci_name(pdev), pdev->irq); 3260 pci_name(pdev), pdev->irq);
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 83ff5994a8d5..0f3798f81883 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -3532,9 +3532,23 @@ static inline int tg3_4g_overflow_test(dma_addr_t mapping, int len)
3532 (base + len + 8 < base)); 3532 (base + len + 8 < base));
3533} 3533}
3534 3534
3535/* Test for DMA addresses > 40-bit */
3536static inline int tg3_40bit_overflow_test(struct tg3 *tp, dma_addr_t mapping,
3537 int len)
3538{
3539#if defined(CONFIG_HIGHMEM) && (BITS_PER_LONG == 64)
3540 if (tp->tg3_flags2 & TG3_FLG2_5780_CLASS)
3541 return (((u64) mapping + len) > DMA_40BIT_MASK);
3542 return 0;
3543#else
3544 return 0;
3545#endif
3546}
3547
3535static void tg3_set_txd(struct tg3 *, int, dma_addr_t, int, u32, u32); 3548static void tg3_set_txd(struct tg3 *, int, dma_addr_t, int, u32, u32);
3536 3549
3537static int tigon3_4gb_hwbug_workaround(struct tg3 *tp, struct sk_buff *skb, 3550/* Workaround 4GB and 40-bit hardware DMA bugs. */
3551static int tigon3_dma_hwbug_workaround(struct tg3 *tp, struct sk_buff *skb,
3538 u32 last_plus_one, u32 *start, 3552 u32 last_plus_one, u32 *start,
3539 u32 base_flags, u32 mss) 3553 u32 base_flags, u32 mss)
3540{ 3554{
@@ -3742,6 +3756,9 @@ static int tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
3742 if (tg3_4g_overflow_test(mapping, len)) 3756 if (tg3_4g_overflow_test(mapping, len))
3743 would_hit_hwbug = 1; 3757 would_hit_hwbug = 1;
3744 3758
3759 if (tg3_40bit_overflow_test(tp, mapping, len))
3760 would_hit_hwbug = 1;
3761
3745 if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) 3762 if (tp->tg3_flags2 & TG3_FLG2_HW_TSO)
3746 tg3_set_txd(tp, entry, mapping, len, 3763 tg3_set_txd(tp, entry, mapping, len,
3747 base_flags, (i == last)|(mss << 1)); 3764 base_flags, (i == last)|(mss << 1));
@@ -3763,7 +3780,7 @@ static int tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
3763 /* If the workaround fails due to memory/mapping 3780 /* If the workaround fails due to memory/mapping
3764 * failure, silently drop this packet. 3781 * failure, silently drop this packet.
3765 */ 3782 */
3766 if (tigon3_4gb_hwbug_workaround(tp, skb, last_plus_one, 3783 if (tigon3_dma_hwbug_workaround(tp, skb, last_plus_one,
3767 &start, base_flags, mss)) 3784 &start, base_flags, mss))
3768 goto out_unlock; 3785 goto out_unlock;
3769 3786
@@ -10608,8 +10625,9 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
10608 unsigned long tg3reg_base, tg3reg_len; 10625 unsigned long tg3reg_base, tg3reg_len;
10609 struct net_device *dev; 10626 struct net_device *dev;
10610 struct tg3 *tp; 10627 struct tg3 *tp;
10611 int i, err, pci_using_dac, pm_cap; 10628 int i, err, pm_cap;
10612 char str[40]; 10629 char str[40];
10630 u64 dma_mask, persist_dma_mask;
10613 10631
10614 if (tg3_version_printed++ == 0) 10632 if (tg3_version_printed++ == 0)
10615 printk(KERN_INFO "%s", version); 10633 printk(KERN_INFO "%s", version);
@@ -10646,26 +10664,6 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
10646 goto err_out_free_res; 10664 goto err_out_free_res;
10647 } 10665 }
10648 10666
10649 /* Configure DMA attributes. */
10650 err = pci_set_dma_mask(pdev, DMA_64BIT_MASK);
10651 if (!err) {
10652 pci_using_dac = 1;
10653 err = pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK);
10654 if (err < 0) {
10655 printk(KERN_ERR PFX "Unable to obtain 64 bit DMA "
10656 "for consistent allocations\n");
10657 goto err_out_free_res;
10658 }
10659 } else {
10660 err = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
10661 if (err) {
10662 printk(KERN_ERR PFX "No usable DMA configuration, "
10663 "aborting.\n");
10664 goto err_out_free_res;
10665 }
10666 pci_using_dac = 0;
10667 }
10668
10669 tg3reg_base = pci_resource_start(pdev, 0); 10667 tg3reg_base = pci_resource_start(pdev, 0);
10670 tg3reg_len = pci_resource_len(pdev, 0); 10668 tg3reg_len = pci_resource_len(pdev, 0);
10671 10669
@@ -10679,8 +10677,6 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
10679 SET_MODULE_OWNER(dev); 10677 SET_MODULE_OWNER(dev);
10680 SET_NETDEV_DEV(dev, &pdev->dev); 10678 SET_NETDEV_DEV(dev, &pdev->dev);
10681 10679
10682 if (pci_using_dac)
10683 dev->features |= NETIF_F_HIGHDMA;
10684 dev->features |= NETIF_F_LLTX; 10680 dev->features |= NETIF_F_LLTX;
10685#if TG3_VLAN_TAG_USED 10681#if TG3_VLAN_TAG_USED
10686 dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; 10682 dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
@@ -10765,6 +10761,44 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
10765 goto err_out_iounmap; 10761 goto err_out_iounmap;
10766 } 10762 }
10767 10763
10764 /* 5714, 5715 and 5780 cannot support DMA addresses > 40-bit.
10765 * On 64-bit systems with IOMMU, use 40-bit dma_mask.
10766 * On 64-bit systems without IOMMU, use 64-bit dma_mask and
10767 * do DMA address check in tg3_start_xmit().
10768 */
10769 if (tp->tg3_flags2 & TG3_FLG2_5780_CLASS) {
10770 persist_dma_mask = dma_mask = DMA_40BIT_MASK;
10771#ifdef CONFIG_HIGHMEM
10772 dma_mask = DMA_64BIT_MASK;
10773#endif
10774 } else if (tp->tg3_flags2 & TG3_FLG2_IS_5788)
10775 persist_dma_mask = dma_mask = DMA_32BIT_MASK;
10776 else
10777 persist_dma_mask = dma_mask = DMA_64BIT_MASK;
10778
10779 /* Configure DMA attributes. */
10780 if (dma_mask > DMA_32BIT_MASK) {
10781 err = pci_set_dma_mask(pdev, dma_mask);
10782 if (!err) {
10783 dev->features |= NETIF_F_HIGHDMA;
10784 err = pci_set_consistent_dma_mask(pdev,
10785 persist_dma_mask);
10786 if (err < 0) {
10787 printk(KERN_ERR PFX "Unable to obtain 64 bit "
10788 "DMA for consistent allocations\n");
10789 goto err_out_iounmap;
10790 }
10791 }
10792 }
10793 if (err || dma_mask == DMA_32BIT_MASK) {
10794 err = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
10795 if (err) {
10796 printk(KERN_ERR PFX "No usable DMA configuration, "
10797 "aborting.\n");
10798 goto err_out_iounmap;
10799 }
10800 }
10801
10768 tg3_init_bufmgr_config(tp); 10802 tg3_init_bufmgr_config(tp);
10769 10803
10770#if TG3_TSO_SUPPORT != 0 10804#if TG3_TSO_SUPPORT != 0
@@ -10833,9 +10867,6 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
10833 } else 10867 } else
10834 tp->tg3_flags &= ~TG3_FLAG_RX_CHECKSUMS; 10868 tp->tg3_flags &= ~TG3_FLAG_RX_CHECKSUMS;
10835 10869
10836 if (tp->tg3_flags2 & TG3_FLG2_IS_5788)
10837 dev->features &= ~NETIF_F_HIGHDMA;
10838
10839 /* flow control autonegotiation is default behavior */ 10870 /* flow control autonegotiation is default behavior */
10840 tp->tg3_flags |= TG3_FLAG_PAUSE_AUTONEG; 10871 tp->tg3_flags |= TG3_FLAG_PAUSE_AUTONEG;
10841 10872
diff --git a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c
index d6c3d52d2e86..6299e186c73f 100644
--- a/drivers/net/tulip/de2104x.c
+++ b/drivers/net/tulip/de2104x.c
@@ -1357,7 +1357,6 @@ static int de_open (struct net_device *dev)
1357{ 1357{
1358 struct de_private *de = dev->priv; 1358 struct de_private *de = dev->priv;
1359 int rc; 1359 int rc;
1360 unsigned long flags;
1361 1360
1362 if (netif_msg_ifup(de)) 1361 if (netif_msg_ifup(de))
1363 printk(KERN_DEBUG "%s: enabling interface\n", dev->name); 1362 printk(KERN_DEBUG "%s: enabling interface\n", dev->name);
@@ -1371,18 +1370,20 @@ static int de_open (struct net_device *dev)
1371 return rc; 1370 return rc;
1372 } 1371 }
1373 1372
1374 rc = de_init_hw(de); 1373 dw32(IntrMask, 0);
1375 if (rc) {
1376 printk(KERN_ERR "%s: h/w init failure, err=%d\n",
1377 dev->name, rc);
1378 goto err_out_free;
1379 }
1380 1374
1381 rc = request_irq(dev->irq, de_interrupt, SA_SHIRQ, dev->name, dev); 1375 rc = request_irq(dev->irq, de_interrupt, SA_SHIRQ, dev->name, dev);
1382 if (rc) { 1376 if (rc) {
1383 printk(KERN_ERR "%s: IRQ %d request failure, err=%d\n", 1377 printk(KERN_ERR "%s: IRQ %d request failure, err=%d\n",
1384 dev->name, dev->irq, rc); 1378 dev->name, dev->irq, rc);
1385 goto err_out_hw; 1379 goto err_out_free;
1380 }
1381
1382 rc = de_init_hw(de);
1383 if (rc) {
1384 printk(KERN_ERR "%s: h/w init failure, err=%d\n",
1385 dev->name, rc);
1386 goto err_out_free_irq;
1386 } 1387 }
1387 1388
1388 netif_start_queue(dev); 1389 netif_start_queue(dev);
@@ -1390,11 +1391,8 @@ static int de_open (struct net_device *dev)
1390 1391
1391 return 0; 1392 return 0;
1392 1393
1393err_out_hw: 1394err_out_free_irq:
1394 spin_lock_irqsave(&de->lock, flags); 1395 free_irq(dev->irq, dev);
1395 de_stop_hw(de);
1396 spin_unlock_irqrestore(&de->lock, flags);
1397
1398err_out_free: 1396err_out_free:
1399 de_free_rings(de); 1397 de_free_rings(de);
1400 return rc; 1398 return rc;
@@ -1450,6 +1448,8 @@ static void de_tx_timeout (struct net_device *dev)
1450 synchronize_irq(dev->irq); 1448 synchronize_irq(dev->irq);
1451 de_clean_rings(de); 1449 de_clean_rings(de);
1452 1450
1451 de_init_rings(de);
1452
1453 de_init_hw(de); 1453 de_init_hw(de);
1454 1454
1455 netif_wake_queue(dev); 1455 netif_wake_queue(dev);
diff --git a/drivers/parport/parport_serial.c b/drivers/parport/parport_serial.c
index 166de3507780..10845253c9e0 100644
--- a/drivers/parport/parport_serial.c
+++ b/drivers/parport/parport_serial.c
@@ -312,8 +312,7 @@ static int __devinit parport_register (struct pci_dev *dev,
312{ 312{
313 struct parport_pc_pci *card; 313 struct parport_pc_pci *card;
314 struct parport_serial_private *priv = pci_get_drvdata (dev); 314 struct parport_serial_private *priv = pci_get_drvdata (dev);
315 int i = id->driver_data, n; 315 int n, success = 0;
316 int success = 0;
317 316
318 priv->par = cards[id->driver_data]; 317 priv->par = cards[id->driver_data];
319 card = &priv->par; 318 card = &priv->par;
@@ -344,10 +343,8 @@ static int __devinit parport_register (struct pci_dev *dev,
344 "hi" as an offset (see SYBA 343 "hi" as an offset (see SYBA
345 def.) */ 344 def.) */
346 /* TODO: test if sharing interrupts works */ 345 /* TODO: test if sharing interrupts works */
347 printk (KERN_DEBUG "PCI parallel port detected: %04x:%04x, " 346 dev_dbg(&dev->dev, "PCI parallel port detected: I/O at "
348 "I/O at %#lx(%#lx)\n", 347 "%#lx(%#lx)\n", io_lo, io_hi);
349 parport_serial_pci_tbl[i].vendor,
350 parport_serial_pci_tbl[i].device, io_lo, io_hi);
351 port = parport_pc_probe_port (io_lo, io_hi, PARPORT_IRQ_NONE, 348 port = parport_pc_probe_port (io_lo, io_hi, PARPORT_IRQ_NONE,
352 PARPORT_DMA_NONE, dev); 349 PARPORT_DMA_NONE, dev);
353 if (port) { 350 if (port) {
@@ -359,7 +356,7 @@ static int __devinit parport_register (struct pci_dev *dev,
359 if (card->postinit_hook) 356 if (card->postinit_hook)
360 card->postinit_hook (dev, card, !success); 357 card->postinit_hook (dev, card, !success);
361 358
362 return success ? 0 : 1; 359 return 0;
363} 360}
364 361
365static int __devinit parport_serial_pci_probe (struct pci_dev *dev, 362static int __devinit parport_serial_pci_probe (struct pci_dev *dev,
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index 54ad93daca3c..bb96ce1db08c 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -411,7 +411,7 @@ static int pcmcia_device_probe(struct device * dev)
411 * pseudo devices, and if not, add the second one. 411 * pseudo devices, and if not, add the second one.
412 */ 412 */
413 did = (struct pcmcia_device_id *) p_dev->dev.driver_data; 413 did = (struct pcmcia_device_id *) p_dev->dev.driver_data;
414 if ((did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) && 414 if (did && (did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) &&
415 (p_dev->socket->device_count == 1) && (p_dev->device_no == 0)) 415 (p_dev->socket->device_count == 1) && (p_dev->device_no == 0))
416 pcmcia_add_pseudo_device(p_dev->socket); 416 pcmcia_add_pseudo_device(p_dev->socket);
417 417
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
index af1d5b404cee..33157c84d1d3 100644
--- a/drivers/s390/block/dasd.c
+++ b/drivers/s390/block/dasd.c
@@ -215,9 +215,10 @@ dasd_state_basic_to_known(struct dasd_device * device)
215 * interrupt for this detection ccw uses the kernel event daemon to 215 * interrupt for this detection ccw uses the kernel event daemon to
216 * trigger the call to dasd_change_state. All this is done in the 216 * trigger the call to dasd_change_state. All this is done in the
217 * discipline code, see dasd_eckd.c. 217 * discipline code, see dasd_eckd.c.
218 * After the analysis ccw is done (do_analysis returned 0 or error) 218 * After the analysis ccw is done (do_analysis returned 0) the block
219 * the block device is setup. Either a fake disk is added to allow 219 * device is setup.
220 * formatting or a proper device request queue is created. 220 * In case the analysis returns an error, the device setup is stopped
221 * (a fake disk was already added to allow formatting).
221 */ 222 */
222static inline int 223static inline int
223dasd_state_basic_to_ready(struct dasd_device * device) 224dasd_state_basic_to_ready(struct dasd_device * device)
@@ -227,13 +228,19 @@ dasd_state_basic_to_ready(struct dasd_device * device)
227 rc = 0; 228 rc = 0;
228 if (device->discipline->do_analysis != NULL) 229 if (device->discipline->do_analysis != NULL)
229 rc = device->discipline->do_analysis(device); 230 rc = device->discipline->do_analysis(device);
230 if (rc) 231 if (rc) {
232 if (rc != -EAGAIN)
233 device->state = DASD_STATE_UNFMT;
231 return rc; 234 return rc;
235 }
236 /* make disk known with correct capacity */
232 dasd_setup_queue(device); 237 dasd_setup_queue(device);
238 set_capacity(device->gdp, device->blocks << device->s2b_shift);
233 device->state = DASD_STATE_READY; 239 device->state = DASD_STATE_READY;
234 if (dasd_scan_partitions(device) != 0) 240 rc = dasd_scan_partitions(device);
241 if (rc)
235 device->state = DASD_STATE_BASIC; 242 device->state = DASD_STATE_BASIC;
236 return 0; 243 return rc;
237} 244}
238 245
239/* 246/*
@@ -254,6 +261,15 @@ dasd_state_ready_to_basic(struct dasd_device * device)
254} 261}
255 262
256/* 263/*
264 * Back to basic.
265 */
266static inline void
267dasd_state_unfmt_to_basic(struct dasd_device * device)
268{
269 device->state = DASD_STATE_BASIC;
270}
271
272/*
257 * Make the device online and schedule the bottom half to start 273 * Make the device online and schedule the bottom half to start
258 * the requeueing of requests from the linux request queue to the 274 * the requeueing of requests from the linux request queue to the
259 * ccw queue. 275 * ccw queue.
@@ -319,8 +335,12 @@ dasd_decrease_state(struct dasd_device *device)
319 if (device->state == DASD_STATE_READY && 335 if (device->state == DASD_STATE_READY &&
320 device->target <= DASD_STATE_BASIC) 336 device->target <= DASD_STATE_BASIC)
321 dasd_state_ready_to_basic(device); 337 dasd_state_ready_to_basic(device);
322 338
323 if (device->state == DASD_STATE_BASIC && 339 if (device->state == DASD_STATE_UNFMT &&
340 device->target <= DASD_STATE_BASIC)
341 dasd_state_unfmt_to_basic(device);
342
343 if (device->state == DASD_STATE_BASIC &&
324 device->target <= DASD_STATE_KNOWN) 344 device->target <= DASD_STATE_KNOWN)
325 dasd_state_basic_to_known(device); 345 dasd_state_basic_to_known(device);
326 346
@@ -1722,7 +1742,7 @@ dasd_open(struct inode *inp, struct file *filp)
1722 goto out; 1742 goto out;
1723 } 1743 }
1724 1744
1725 if (device->state < DASD_STATE_BASIC) { 1745 if (device->state <= DASD_STATE_BASIC) {
1726 DBF_DEV_EVENT(DBF_ERR, device, " %s", 1746 DBF_DEV_EVENT(DBF_ERR, device, " %s",
1727 " Cannot open unrecognized device"); 1747 " Cannot open unrecognized device");
1728 rc = -ENODEV; 1748 rc = -ENODEV;
diff --git a/drivers/s390/block/dasd_genhd.c b/drivers/s390/block/dasd_genhd.c
index 65dc844b975c..fce2835e7d19 100644
--- a/drivers/s390/block/dasd_genhd.c
+++ b/drivers/s390/block/dasd_genhd.c
@@ -100,8 +100,6 @@ dasd_scan_partitions(struct dasd_device * device)
100{ 100{
101 struct block_device *bdev; 101 struct block_device *bdev;
102 102
103 /* Make the disk known. */
104 set_capacity(device->gdp, device->blocks << device->s2b_shift);
105 bdev = bdget_disk(device->gdp, 0); 103 bdev = bdget_disk(device->gdp, 0);
106 if (!bdev || blkdev_get(bdev, FMODE_READ, 1) < 0) 104 if (!bdev || blkdev_get(bdev, FMODE_READ, 1) < 0)
107 return -ENODEV; 105 return -ENODEV;
diff --git a/drivers/s390/block/dasd_int.h b/drivers/s390/block/dasd_int.h
index 0592354cc604..7cb0b9e78a6a 100644
--- a/drivers/s390/block/dasd_int.h
+++ b/drivers/s390/block/dasd_int.h
@@ -26,7 +26,7 @@
26 * new: the dasd_device structure is allocated. 26 * new: the dasd_device structure is allocated.
27 * known: the discipline for the device is identified. 27 * known: the discipline for the device is identified.
28 * basic: the device can do basic i/o. 28 * basic: the device can do basic i/o.
29 * accept: the device is analysed (format is known). 29 * unfmt: the device could not be analyzed (format is unknown).
30 * ready: partition detection is done and the device is can do block io. 30 * ready: partition detection is done and the device is can do block io.
31 * online: the device accepts requests from the block device queue. 31 * online: the device accepts requests from the block device queue.
32 * 32 *
@@ -47,8 +47,9 @@
47#define DASD_STATE_NEW 0 47#define DASD_STATE_NEW 0
48#define DASD_STATE_KNOWN 1 48#define DASD_STATE_KNOWN 1
49#define DASD_STATE_BASIC 2 49#define DASD_STATE_BASIC 2
50#define DASD_STATE_READY 3 50#define DASD_STATE_UNFMT 3
51#define DASD_STATE_ONLINE 4 51#define DASD_STATE_READY 4
52#define DASD_STATE_ONLINE 5
52 53
53#include <linux/module.h> 54#include <linux/module.h>
54#include <linux/wait.h> 55#include <linux/wait.h>
diff --git a/drivers/s390/block/dasd_proc.c b/drivers/s390/block/dasd_proc.c
index 2d5da3c75ca7..1aa3c261718a 100644
--- a/drivers/s390/block/dasd_proc.c
+++ b/drivers/s390/block/dasd_proc.c
@@ -93,6 +93,9 @@ dasd_devices_show(struct seq_file *m, void *v)
93 case DASD_STATE_BASIC: 93 case DASD_STATE_BASIC:
94 seq_printf(m, "basic"); 94 seq_printf(m, "basic");
95 break; 95 break;
96 case DASD_STATE_UNFMT:
97 seq_printf(m, "unformatted");
98 break;
96 case DASD_STATE_READY: 99 case DASD_STATE_READY:
97 case DASD_STATE_ONLINE: 100 case DASD_STATE_ONLINE:
98 seq_printf(m, "active "); 101 seq_printf(m, "active ");
diff --git a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c
index 8cf9905d484b..f4183d660258 100644
--- a/drivers/s390/cio/chsc.c
+++ b/drivers/s390/cio/chsc.c
@@ -1115,6 +1115,9 @@ chsc_enable_facility(int operation_code)
1115 goto out; 1115 goto out;
1116 } 1116 }
1117 switch (sda_area->response.code) { 1117 switch (sda_area->response.code) {
1118 case 0x0001: /* everything ok */
1119 ret = 0;
1120 break;
1118 case 0x0003: /* invalid request block */ 1121 case 0x0003: /* invalid request block */
1119 case 0x0007: 1122 case 0x0007:
1120 ret = -EINVAL; 1123 ret = -EINVAL;
@@ -1123,6 +1126,8 @@ chsc_enable_facility(int operation_code)
1123 case 0x0101: /* facility not provided */ 1126 case 0x0101: /* facility not provided */
1124 ret = -EOPNOTSUPP; 1127 ret = -EOPNOTSUPP;
1125 break; 1128 break;
1129 default: /* something went wrong */
1130 ret = -EIO;
1126 } 1131 }
1127 out: 1132 out:
1128 free_page((unsigned long)sda_area); 1133 free_page((unsigned long)sda_area);
diff --git a/drivers/s390/net/smsgiucv.c b/drivers/s390/net/smsgiucv.c
index d6469baa7e16..72118ee68954 100644
--- a/drivers/s390/net/smsgiucv.c
+++ b/drivers/s390/net/smsgiucv.c
@@ -168,7 +168,7 @@ smsg_init(void)
168 driver_unregister(&smsg_driver); 168 driver_unregister(&smsg_driver);
169 return -EIO; /* better errno ? */ 169 return -EIO; /* better errno ? */
170 } 170 }
171 rc = iucv_connect (&smsg_pathid, 1, 0, "*MSG ", 0, 0, 0, 0, 171 rc = iucv_connect (&smsg_pathid, 255, 0, "*MSG ", 0, 0, 0, 0,
172 smsg_handle, 0); 172 smsg_handle, 0);
173 if (rc) { 173 if (rc) {
174 printk(KERN_ERR "SMSGIUCV: failed to connect to *MSG"); 174 printk(KERN_ERR "SMSGIUCV: failed to connect to *MSG");
diff --git a/drivers/scsi/sr_ioctl.c b/drivers/scsi/sr_ioctl.c
index 5d02ff4db6cc..b65462f76484 100644
--- a/drivers/scsi/sr_ioctl.c
+++ b/drivers/scsi/sr_ioctl.c
@@ -192,7 +192,7 @@ int sr_do_ioctl(Scsi_CD *cd, struct packet_command *cgc)
192 SDev = cd->device; 192 SDev = cd->device;
193 193
194 if (!sense) { 194 if (!sense) {
195 sense = kmalloc(sizeof(*sense), GFP_KERNEL); 195 sense = kmalloc(SCSI_SENSE_BUFFERSIZE, GFP_KERNEL);
196 if (!sense) { 196 if (!sense) {
197 err = -ENOMEM; 197 err = -ENOMEM;
198 goto out; 198 goto out;
diff --git a/drivers/serial/ioc4_serial.c b/drivers/serial/ioc4_serial.c
index f3763d2ccb86..a37579ce6d76 100644
--- a/drivers/serial/ioc4_serial.c
+++ b/drivers/serial/ioc4_serial.c
@@ -2301,7 +2301,6 @@ static void receive_chars(struct uart_port *the_port)
2301 int read_count, request_count = IOC4_MAX_CHARS; 2301 int read_count, request_count = IOC4_MAX_CHARS;
2302 struct uart_icount *icount; 2302 struct uart_icount *icount;
2303 struct uart_info *info = the_port->info; 2303 struct uart_info *info = the_port->info;
2304 int flip = 0;
2305 unsigned long pflags; 2304 unsigned long pflags;
2306 2305
2307 /* Make sure all the pointers are "good" ones */ 2306 /* Make sure all the pointers are "good" ones */
@@ -2313,7 +2312,7 @@ static void receive_chars(struct uart_port *the_port)
2313 spin_lock_irqsave(&the_port->lock, pflags); 2312 spin_lock_irqsave(&the_port->lock, pflags);
2314 tty = info->tty; 2313 tty = info->tty;
2315 2314
2316 request_count = tty_buffer_request_room(tty, IOC4_MAX_CHARS - 2); 2315 request_count = tty_buffer_request_room(tty, IOC4_MAX_CHARS);
2317 2316
2318 if (request_count > 0) { 2317 if (request_count > 0) {
2319 icount = &the_port->icount; 2318 icount = &the_port->icount;
@@ -2326,8 +2325,7 @@ static void receive_chars(struct uart_port *the_port)
2326 2325
2327 spin_unlock_irqrestore(&the_port->lock, pflags); 2326 spin_unlock_irqrestore(&the_port->lock, pflags);
2328 2327
2329 if (flip) 2328 tty_flip_buffer_push(tty);
2330 tty_flip_buffer_push(tty);
2331} 2329}
2332 2330
2333/** 2331/**
diff --git a/drivers/serial/ip22zilog.c b/drivers/serial/ip22zilog.c
index 419dd3cd7862..193722d680cf 100644
--- a/drivers/serial/ip22zilog.c
+++ b/drivers/serial/ip22zilog.c
@@ -420,10 +420,8 @@ static void ip22zilog_transmit_chars(struct uart_ip22zilog_port *up,
420 if (up->port.info == NULL) 420 if (up->port.info == NULL)
421 goto ack_tx_int; 421 goto ack_tx_int;
422 xmit = &up->port.info->xmit; 422 xmit = &up->port.info->xmit;
423 if (uart_circ_empty(xmit)) { 423 if (uart_circ_empty(xmit))
424 uart_write_wakeup(&up->port);
425 goto ack_tx_int; 424 goto ack_tx_int;
426 }
427 if (uart_tx_stopped(&up->port)) 425 if (uart_tx_stopped(&up->port))
428 goto ack_tx_int; 426 goto ack_tx_int;
429 427
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c
index 95fb4939c675..cc1faa31d124 100644
--- a/drivers/serial/serial_core.c
+++ b/drivers/serial/serial_core.c
@@ -71,6 +71,11 @@ static void uart_change_pm(struct uart_state *state, int pm_state);
71void uart_write_wakeup(struct uart_port *port) 71void uart_write_wakeup(struct uart_port *port)
72{ 72{
73 struct uart_info *info = port->info; 73 struct uart_info *info = port->info;
74 /*
75 * This means you called this function _after_ the port was
76 * closed. No cookie for you.
77 */
78 BUG_ON(!info);
74 tasklet_schedule(&info->tlet); 79 tasklet_schedule(&info->tlet);
75} 80}
76 81
@@ -471,14 +476,26 @@ static void uart_flush_chars(struct tty_struct *tty)
471} 476}
472 477
473static int 478static int
474uart_write(struct tty_struct *tty, const unsigned char * buf, int count) 479uart_write(struct tty_struct *tty, const unsigned char *buf, int count)
475{ 480{
476 struct uart_state *state = tty->driver_data; 481 struct uart_state *state = tty->driver_data;
477 struct uart_port *port = state->port; 482 struct uart_port *port;
478 struct circ_buf *circ = &state->info->xmit; 483 struct circ_buf *circ;
479 unsigned long flags; 484 unsigned long flags;
480 int c, ret = 0; 485 int c, ret = 0;
481 486
487 /*
488 * This means you called this function _after_ the port was
489 * closed. No cookie for you.
490 */
491 if (!state || !state->info) {
492 WARN_ON(1);
493 return -EL3HLT;
494 }
495
496 port = state->port;
497 circ = &state->info->xmit;
498
482 if (!circ->buf) 499 if (!circ->buf)
483 return 0; 500 return 0;
484 501
@@ -521,6 +538,15 @@ static void uart_flush_buffer(struct tty_struct *tty)
521 struct uart_port *port = state->port; 538 struct uart_port *port = state->port;
522 unsigned long flags; 539 unsigned long flags;
523 540
541 /*
542 * This means you called this function _after_ the port was
543 * closed. No cookie for you.
544 */
545 if (!state || !state->info) {
546 WARN_ON(1);
547 return;
548 }
549
524 DPRINTK("uart_flush_buffer(%d) called\n", tty->index); 550 DPRINTK("uart_flush_buffer(%d) called\n", tty->index);
525 551
526 spin_lock_irqsave(&port->lock, flags); 552 spin_lock_irqsave(&port->lock, flags);
diff --git a/drivers/serial/sn_console.c b/drivers/serial/sn_console.c
index 43e67d6c29d4..60ea4a3f0713 100644
--- a/drivers/serial/sn_console.c
+++ b/drivers/serial/sn_console.c
@@ -820,7 +820,7 @@ static int __init sn_sal_module_init(void)
820 int retval; 820 int retval;
821 821
822 if (!ia64_platform_is("sn2")) 822 if (!ia64_platform_is("sn2"))
823 return -ENODEV; 823 return 0;
824 824
825 printk(KERN_INFO "sn_console: Console driver init\n"); 825 printk(KERN_INFO "sn_console: Console driver init\n");
826 826
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index 4dd6865d32b0..b5c96e74a903 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -242,8 +242,10 @@ static void serial_close(struct tty_struct *tty, struct file * filp)
242 242
243 down(&port->sem); 243 down(&port->sem);
244 244
245 if (port->open_count == 0) 245 if (port->open_count == 0) {
246 goto out; 246 up(&port->sem);
247 return;
248 }
247 249
248 --port->open_count; 250 --port->open_count;
249 if (port->open_count == 0) { 251 if (port->open_count == 0) {
@@ -260,10 +262,8 @@ static void serial_close(struct tty_struct *tty, struct file * filp)
260 module_put(port->serial->type->driver.owner); 262 module_put(port->serial->type->driver.owner);
261 } 263 }
262 264
263 kref_put(&port->serial->kref, destroy_serial);
264
265out:
266 up(&port->sem); 265 up(&port->sem);
266 kref_put(&port->serial->kref, destroy_serial);
267} 267}
268 268
269static int serial_write (struct tty_struct * tty, const unsigned char *buf, int count) 269static int serial_write (struct tty_struct * tty, const unsigned char *buf, int count)
diff --git a/drivers/video/arcfb.c b/drivers/video/arcfb.c
index df8e5667b348..466042808daf 100644
--- a/drivers/video/arcfb.c
+++ b/drivers/video/arcfb.c
@@ -253,7 +253,7 @@ static void arcfb_lcd_update_page(struct arcfb_par *par, unsigned int upper,
253{ 253{
254 unsigned char *src; 254 unsigned char *src;
255 unsigned int xindex, yindex, chipindex, linesize; 255 unsigned int xindex, yindex, chipindex, linesize;
256 int i, count; 256 int i;
257 unsigned char val; 257 unsigned char val;
258 unsigned char bitmask, rightshift; 258 unsigned char bitmask, rightshift;
259 259
@@ -282,7 +282,6 @@ static void arcfb_lcd_update_page(struct arcfb_par *par, unsigned int upper,
282 } 282 }
283 ks108_writeb_data(par, chipindex, val); 283 ks108_writeb_data(par, chipindex, val);
284 left++; 284 left++;
285 count++;
286 if (bitmask == 0x80) { 285 if (bitmask == 0x80) {
287 bitmask = 1; 286 bitmask = 1;
288 src++; 287 src++;
@@ -460,11 +459,11 @@ static ssize_t arcfb_write(struct file *file, const char __user *buf, size_t cou
460 inode = file->f_dentry->d_inode; 459 inode = file->f_dentry->d_inode;
461 fbidx = iminor(inode); 460 fbidx = iminor(inode);
462 info = registered_fb[fbidx]; 461 info = registered_fb[fbidx];
463 par = info->par;
464 462
465 if (!info || !info->screen_base) 463 if (!info || !info->screen_base)
466 return -ENODEV; 464 return -ENODEV;
467 465
466 par = info->par;
468 xres = info->var.xres; 467 xres = info->var.xres;
469 fbmemlength = (xres * info->var.yres)/8; 468 fbmemlength = (xres * info->var.yres)/8;
470 469
diff --git a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c
index bfc8a93b2c73..620c9a934e0e 100644
--- a/drivers/video/aty/aty128fb.c
+++ b/drivers/video/aty/aty128fb.c
@@ -1326,7 +1326,7 @@ static int aty128_var_to_pll(u32 period_in_ps, struct aty128_pll *pll,
1326 unsigned char post_dividers[] = {1,2,4,8,3,6,12}; 1326 unsigned char post_dividers[] = {1,2,4,8,3,6,12};
1327 u32 output_freq; 1327 u32 output_freq;
1328 u32 vclk; /* in .01 MHz */ 1328 u32 vclk; /* in .01 MHz */
1329 int i; 1329 int i = 0;
1330 u32 n, d; 1330 u32 n, d;
1331 1331
1332 vclk = 100000000 / period_in_ps; /* convert units to 10 kHz */ 1332 vclk = 100000000 / period_in_ps; /* convert units to 10 kHz */
@@ -1340,15 +1340,16 @@ static int aty128_var_to_pll(u32 period_in_ps, struct aty128_pll *pll,
1340 /* now, find an acceptable divider */ 1340 /* now, find an acceptable divider */
1341 for (i = 0; i < sizeof(post_dividers); i++) { 1341 for (i = 0; i < sizeof(post_dividers); i++) {
1342 output_freq = post_dividers[i] * vclk; 1342 output_freq = post_dividers[i] * vclk;
1343 if (output_freq >= c.ppll_min && output_freq <= c.ppll_max) 1343 if (output_freq >= c.ppll_min && output_freq <= c.ppll_max) {
1344 pll->post_divider = post_dividers[i];
1344 break; 1345 break;
1346 }
1345 } 1347 }
1346 1348
1347 /* calculate feedback divider */ 1349 /* calculate feedback divider */
1348 n = c.ref_divider * output_freq; 1350 n = c.ref_divider * output_freq;
1349 d = c.ref_clk; 1351 d = c.ref_clk;
1350 1352
1351 pll->post_divider = post_dividers[i];
1352 pll->feedback_divider = round_div(n, d); 1353 pll->feedback_divider = round_div(n, d);
1353 pll->vclk = vclk; 1354 pll->vclk = vclk;
1354 1355
diff --git a/drivers/video/aty/radeon_monitor.c b/drivers/video/aty/radeon_monitor.c
index 7f9838dceab5..98c05bc0de44 100644
--- a/drivers/video/aty/radeon_monitor.c
+++ b/drivers/video/aty/radeon_monitor.c
@@ -396,6 +396,10 @@ static int __devinit radeon_parse_monitor_layout(struct radeonfb_info *rinfo,
396 s1[i] = *s; 396 s1[i] = *s;
397 i++; 397 i++;
398 } 398 }
399
400 if (i > 4)
401 i = 4;
402
399 } while (*s++); 403 } while (*s++);
400 if (second) 404 if (second)
401 s2[i] = 0; 405 s2[i] = 0;
diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c
index bd39bbd88d41..151fda8dded0 100644
--- a/drivers/video/backlight/backlight.c
+++ b/drivers/video/backlight/backlight.c
@@ -172,7 +172,7 @@ struct backlight_device *backlight_device_register(const char *name, void *devda
172 172
173 new_bd = kmalloc(sizeof(struct backlight_device), GFP_KERNEL); 173 new_bd = kmalloc(sizeof(struct backlight_device), GFP_KERNEL);
174 if (unlikely(!new_bd)) 174 if (unlikely(!new_bd))
175 return ERR_PTR(ENOMEM); 175 return ERR_PTR(-ENOMEM);
176 176
177 init_MUTEX(&new_bd->sem); 177 init_MUTEX(&new_bd->sem);
178 new_bd->props = bp; 178 new_bd->props = bp;
diff --git a/drivers/video/backlight/lcd.c b/drivers/video/backlight/lcd.c
index 9e32485ee7bb..86908a60c630 100644
--- a/drivers/video/backlight/lcd.c
+++ b/drivers/video/backlight/lcd.c
@@ -171,7 +171,7 @@ struct lcd_device *lcd_device_register(const char *name, void *devdata,
171 171
172 new_ld = kmalloc(sizeof(struct lcd_device), GFP_KERNEL); 172 new_ld = kmalloc(sizeof(struct lcd_device), GFP_KERNEL);
173 if (unlikely(!new_ld)) 173 if (unlikely(!new_ld))
174 return ERR_PTR(ENOMEM); 174 return ERR_PTR(-ENOMEM);
175 175
176 init_MUTEX(&new_ld->sem); 176 init_MUTEX(&new_ld->sem);
177 new_ld->props = lp; 177 new_ld->props = lp;
diff --git a/drivers/video/imsttfb.c b/drivers/video/imsttfb.c
index ad416ae47596..7db42542eb19 100644
--- a/drivers/video/imsttfb.c
+++ b/drivers/video/imsttfb.c
@@ -1510,6 +1510,8 @@ imsttfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1510 default: 1510 default:
1511 printk(KERN_INFO "imsttfb: Device 0x%x unknown, " 1511 printk(KERN_INFO "imsttfb: Device 0x%x unknown, "
1512 "contact maintainer.\n", pdev->device); 1512 "contact maintainer.\n", pdev->device);
1513 release_mem_region(addr, size);
1514 framebuffer_release(info);
1513 return -ENODEV; 1515 return -ENODEV;
1514 } 1516 }
1515 1517
diff --git a/drivers/video/intelfb/intelfbdrv.c b/drivers/video/intelfb/intelfbdrv.c
index 6b8bd3cdf9c0..995b47c165a7 100644
--- a/drivers/video/intelfb/intelfbdrv.c
+++ b/drivers/video/intelfb/intelfbdrv.c
@@ -1333,33 +1333,35 @@ intelfb_setcolreg(unsigned regno, unsigned red, unsigned green,
1333 if (regno > 255) 1333 if (regno > 255)
1334 return 1; 1334 return 1;
1335 1335
1336 switch (dinfo->depth) { 1336 if (dinfo->depth == 8) {
1337 case 8: 1337 red >>= 8;
1338 { 1338 green >>= 8;
1339 red >>= 8; 1339 blue >>= 8;
1340 green >>= 8; 1340
1341 blue >>= 8; 1341 intelfbhw_setcolreg(dinfo, regno, red, green, blue,
1342 transp);
1343 }
1342 1344
1343 intelfbhw_setcolreg(dinfo, regno, red, green, blue, 1345 if (regno < 16) {
1344 transp); 1346 switch (dinfo->depth) {
1347 case 15:
1348 dinfo->pseudo_palette[regno] = ((red & 0xf800) >> 1) |
1349 ((green & 0xf800) >> 6) |
1350 ((blue & 0xf800) >> 11);
1351 break;
1352 case 16:
1353 dinfo->pseudo_palette[regno] = (red & 0xf800) |
1354 ((green & 0xfc00) >> 5) |
1355 ((blue & 0xf800) >> 11);
1356 break;
1357 case 24:
1358 dinfo->pseudo_palette[regno] = ((red & 0xff00) << 8) |
1359 (green & 0xff00) |
1360 ((blue & 0xff00) >> 8);
1361 break;
1345 } 1362 }
1346 break;
1347 case 15:
1348 dinfo->pseudo_palette[regno] = ((red & 0xf800) >> 1) |
1349 ((green & 0xf800) >> 6) |
1350 ((blue & 0xf800) >> 11);
1351 break;
1352 case 16:
1353 dinfo->pseudo_palette[regno] = (red & 0xf800) |
1354 ((green & 0xfc00) >> 5) |
1355 ((blue & 0xf800) >> 11);
1356 break;
1357 case 24:
1358 dinfo->pseudo_palette[regno] = ((red & 0xff00) << 8) |
1359 (green & 0xff00) |
1360 ((blue & 0xff00) >> 8);
1361 break;
1362 } 1363 }
1364
1363 return 0; 1365 return 0;
1364} 1366}
1365 1367
diff --git a/drivers/video/kyro/STG4000VTG.c b/drivers/video/kyro/STG4000VTG.c
index 3690b04190af..bd389709d234 100644
--- a/drivers/video/kyro/STG4000VTG.c
+++ b/drivers/video/kyro/STG4000VTG.c
@@ -17,7 +17,7 @@
17void DisableVGA(volatile STG4000REG __iomem *pSTGReg) 17void DisableVGA(volatile STG4000REG __iomem *pSTGReg)
18{ 18{
19 u32 tmp; 19 u32 tmp;
20 volatile u32 count, i; 20 volatile u32 count = 0, i;
21 21
22 /* Reset the VGA registers */ 22 /* Reset the VGA registers */
23 tmp = STG_READ_REG(SoftwareReset); 23 tmp = STG_READ_REG(SoftwareReset);
diff --git a/drivers/video/neofb.c b/drivers/video/neofb.c
index a2e201dc40f7..b961d5601bd9 100644
--- a/drivers/video/neofb.c
+++ b/drivers/video/neofb.c
@@ -486,10 +486,8 @@ static void vgaHWRestore(const struct fb_info *info,
486static inline int neo2200_sync(struct fb_info *info) 486static inline int neo2200_sync(struct fb_info *info)
487{ 487{
488 struct neofb_par *par = info->par; 488 struct neofb_par *par = info->par;
489 int waitcycles;
490 489
491 while (readl(&par->neo2200->bltStat) & 1) 490 while (readl(&par->neo2200->bltStat) & 1);
492 waitcycles++;
493 return 0; 491 return 0;
494} 492}
495 493
diff --git a/drivers/video/s1d13xxxfb.c b/drivers/video/s1d13xxxfb.c
index e5d0f92eeae3..feec47bdd479 100644
--- a/drivers/video/s1d13xxxfb.c
+++ b/drivers/video/s1d13xxxfb.c
@@ -588,6 +588,7 @@ s1d13xxxfb_probe(struct platform_device *pdev)
588 goto bail; 588 goto bail;
589 } 589 }
590 590
591 platform_set_drvdata(pdev, info);
591 default_par = info->par; 592 default_par = info->par;
592 default_par->regs = ioremap_nocache(pdev->resource[1].start, 593 default_par->regs = ioremap_nocache(pdev->resource[1].start,
593 pdev->resource[1].end - pdev->resource[1].start +1); 594 pdev->resource[1].end - pdev->resource[1].start +1);
@@ -638,8 +639,6 @@ s1d13xxxfb_probe(struct platform_device *pdev)
638 goto bail; 639 goto bail;
639 } 640 }
640 641
641 platform_set_drvdata(pdev, info);
642
643 printk(KERN_INFO "fb%d: %s frame buffer device\n", 642 printk(KERN_INFO "fb%d: %s frame buffer device\n",
644 info->node, info->fix.id); 643 info->node, info->fix.id);
645 644
diff --git a/drivers/video/savage/savagefb_driver.c b/drivers/video/savage/savagefb_driver.c
index ab727eaa7f43..10e6b3aab9ea 100644
--- a/drivers/video/savage/savagefb_driver.c
+++ b/drivers/video/savage/savagefb_driver.c
@@ -2021,8 +2021,8 @@ static int __devinit savagefb_probe (struct pci_dev* dev,
2021#if defined(CONFIG_FB_SAVAGE_I2C) 2021#if defined(CONFIG_FB_SAVAGE_I2C)
2022 savagefb_create_i2c_busses(info); 2022 savagefb_create_i2c_busses(info);
2023 savagefb_probe_i2c_connector(info, &par->edid); 2023 savagefb_probe_i2c_connector(info, &par->edid);
2024 kfree(par->edid);
2025 fb_edid_to_monspecs(par->edid, &info->monspecs); 2024 fb_edid_to_monspecs(par->edid, &info->monspecs);
2025 kfree(par->edid);
2026 fb_videomode_to_modelist(info->monspecs.modedb, 2026 fb_videomode_to_modelist(info->monspecs.modedb,
2027 info->monspecs.modedb_len, 2027 info->monspecs.modedb_len,
2028 &info->modelist); 2028 &info->modelist);
diff --git a/drivers/video/tdfxfb.c b/drivers/video/tdfxfb.c
index 3e7baf4c9fa8..5e5328d682db 100644
--- a/drivers/video/tdfxfb.c
+++ b/drivers/video/tdfxfb.c
@@ -786,28 +786,32 @@ static int tdfxfb_setcolreg(unsigned regno, unsigned red, unsigned green,
786 if (regno >= info->cmap.len || regno > 255) return 1; 786 if (regno >= info->cmap.len || regno > 255) return 1;
787 787
788 switch (info->fix.visual) { 788 switch (info->fix.visual) {
789 case FB_VISUAL_PSEUDOCOLOR: 789 case FB_VISUAL_PSEUDOCOLOR:
790 rgbcol =(((u32)red & 0xff00) << 8) | 790 rgbcol =(((u32)red & 0xff00) << 8) |
791 (((u32)green & 0xff00) << 0) | 791 (((u32)green & 0xff00) << 0) |
792 (((u32)blue & 0xff00) >> 8); 792 (((u32)blue & 0xff00) >> 8);
793 do_setpalentry(par, regno, rgbcol); 793 do_setpalentry(par, regno, rgbcol);
794 break; 794 break;
795 /* Truecolor has no hardware color palettes. */ 795 /* Truecolor has no hardware color palettes. */
796 case FB_VISUAL_TRUECOLOR: 796 case FB_VISUAL_TRUECOLOR:
797 if (regno < 16) {
797 rgbcol = (CNVT_TOHW( red, info->var.red.length) << 798 rgbcol = (CNVT_TOHW( red, info->var.red.length) <<
798 info->var.red.offset) | 799 info->var.red.offset) |
799 (CNVT_TOHW( green, info->var.green.length) << 800 (CNVT_TOHW( green, info->var.green.length) <<
800 info->var.green.offset) | 801 info->var.green.offset) |
801 (CNVT_TOHW( blue, info->var.blue.length) << 802 (CNVT_TOHW( blue, info->var.blue.length) <<
802 info->var.blue.offset) | 803 info->var.blue.offset) |
803 (CNVT_TOHW( transp, info->var.transp.length) << 804 (CNVT_TOHW( transp, info->var.transp.length) <<
804 info->var.transp.offset); 805 info->var.transp.offset);
805 par->palette[regno] = rgbcol; 806 par->palette[regno] = rgbcol;
806 break; 807 }
807 default: 808
808 DPRINTK("bad depth %u\n", info->var.bits_per_pixel); 809 break;
809 break; 810 default:
811 DPRINTK("bad depth %u\n", info->var.bits_per_pixel);
812 break;
810 } 813 }
814
811 return 0; 815 return 0;
812} 816}
813 817