diff options
Diffstat (limited to 'drivers')
46 files changed, 240 insertions, 227 deletions
diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c index 6fe417429977..e38dfed41d80 100644 --- a/drivers/base/cpu.c +++ b/drivers/base/cpu.c | |||
@@ -18,7 +18,7 @@ struct sysdev_class cpu_sysdev_class = { | |||
18 | }; | 18 | }; |
19 | EXPORT_SYMBOL(cpu_sysdev_class); | 19 | EXPORT_SYMBOL(cpu_sysdev_class); |
20 | 20 | ||
21 | static struct sys_device *cpu_sys_devices[NR_CPUS]; | 21 | static DEFINE_PER_CPU(struct sys_device *, cpu_sys_devices); |
22 | 22 | ||
23 | #ifdef CONFIG_HOTPLUG_CPU | 23 | #ifdef CONFIG_HOTPLUG_CPU |
24 | static ssize_t show_online(struct sys_device *dev, char *buf) | 24 | static ssize_t show_online(struct sys_device *dev, char *buf) |
@@ -68,7 +68,7 @@ void unregister_cpu(struct cpu *cpu) | |||
68 | sysdev_remove_file(&cpu->sysdev, &attr_online); | 68 | sysdev_remove_file(&cpu->sysdev, &attr_online); |
69 | 69 | ||
70 | sysdev_unregister(&cpu->sysdev); | 70 | sysdev_unregister(&cpu->sysdev); |
71 | cpu_sys_devices[logical_cpu] = NULL; | 71 | per_cpu(cpu_sys_devices, logical_cpu) = NULL; |
72 | return; | 72 | return; |
73 | } | 73 | } |
74 | #else /* ... !CONFIG_HOTPLUG_CPU */ | 74 | #else /* ... !CONFIG_HOTPLUG_CPU */ |
@@ -167,7 +167,7 @@ int __cpuinit register_cpu(struct cpu *cpu, int num) | |||
167 | if (!error && cpu->hotpluggable) | 167 | if (!error && cpu->hotpluggable) |
168 | register_cpu_control(cpu); | 168 | register_cpu_control(cpu); |
169 | if (!error) | 169 | if (!error) |
170 | cpu_sys_devices[num] = &cpu->sysdev; | 170 | per_cpu(cpu_sys_devices, num) = &cpu->sysdev; |
171 | if (!error) | 171 | if (!error) |
172 | register_cpu_under_node(num, cpu_to_node(num)); | 172 | register_cpu_under_node(num, cpu_to_node(num)); |
173 | 173 | ||
@@ -180,8 +180,8 @@ int __cpuinit register_cpu(struct cpu *cpu, int num) | |||
180 | 180 | ||
181 | struct sys_device *get_cpu_sysdev(unsigned cpu) | 181 | struct sys_device *get_cpu_sysdev(unsigned cpu) |
182 | { | 182 | { |
183 | if (cpu < NR_CPUS) | 183 | if (cpu < nr_cpu_ids && cpu_possible(cpu)) |
184 | return cpu_sys_devices[cpu]; | 184 | return per_cpu(cpu_sys_devices, cpu); |
185 | else | 185 | else |
186 | return NULL; | 186 | return NULL; |
187 | } | 187 | } |
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index e539be5750dc..e336b05fe4a7 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c | |||
@@ -428,13 +428,9 @@ static void __devinit cciss_procinit(int i) | |||
428 | proc_cciss = proc_mkdir("driver/cciss", NULL); | 428 | proc_cciss = proc_mkdir("driver/cciss", NULL); |
429 | if (!proc_cciss) | 429 | if (!proc_cciss) |
430 | return; | 430 | return; |
431 | pde = proc_create(hba[i]->devname, S_IWUSR | S_IRUSR | S_IRGRP | | 431 | pde = proc_create_data(hba[i]->devname, S_IWUSR | S_IRUSR | S_IRGRP | |
432 | S_IROTH, proc_cciss, | 432 | S_IROTH, proc_cciss, |
433 | &cciss_proc_fops); | 433 | &cciss_proc_fops, hba[i]); |
434 | if (!pde) | ||
435 | return; | ||
436 | |||
437 | pde->data = hba[i]; | ||
438 | } | 434 | } |
439 | #endif /* CONFIG_PROC_FS */ | 435 | #endif /* CONFIG_PROC_FS */ |
440 | 436 | ||
diff --git a/drivers/char/i8k.c b/drivers/char/i8k.c index f49037b744f9..b60d425ce8d1 100644 --- a/drivers/char/i8k.c +++ b/drivers/char/i8k.c | |||
@@ -77,6 +77,10 @@ static int power_status; | |||
77 | module_param(power_status, bool, 0600); | 77 | module_param(power_status, bool, 0600); |
78 | MODULE_PARM_DESC(power_status, "Report power status in /proc/i8k"); | 78 | MODULE_PARM_DESC(power_status, "Report power status in /proc/i8k"); |
79 | 79 | ||
80 | static int fan_mult = I8K_FAN_MULT; | ||
81 | module_param(fan_mult, int, 0); | ||
82 | MODULE_PARM_DESC(fan_mult, "Factor to multiply fan speed with"); | ||
83 | |||
80 | static int i8k_open_fs(struct inode *inode, struct file *file); | 84 | static int i8k_open_fs(struct inode *inode, struct file *file); |
81 | static int i8k_ioctl(struct inode *, struct file *, unsigned int, | 85 | static int i8k_ioctl(struct inode *, struct file *, unsigned int, |
82 | unsigned long); | 86 | unsigned long); |
@@ -239,7 +243,7 @@ static int i8k_get_fan_speed(int fan) | |||
239 | struct smm_regs regs = { .eax = I8K_SMM_GET_SPEED, }; | 243 | struct smm_regs regs = { .eax = I8K_SMM_GET_SPEED, }; |
240 | 244 | ||
241 | regs.ebx = fan & 0xff; | 245 | regs.ebx = fan & 0xff; |
242 | return i8k_smm(®s) ? : (regs.eax & 0xffff) * I8K_FAN_MULT; | 246 | return i8k_smm(®s) ? : (regs.eax & 0xffff) * fan_mult; |
243 | } | 247 | } |
244 | 248 | ||
245 | /* | 249 | /* |
diff --git a/drivers/char/mmtimer.c b/drivers/char/mmtimer.c index d83db5d880e0..192961fd7173 100644 --- a/drivers/char/mmtimer.c +++ b/drivers/char/mmtimer.c | |||
@@ -30,6 +30,8 @@ | |||
30 | #include <linux/miscdevice.h> | 30 | #include <linux/miscdevice.h> |
31 | #include <linux/posix-timers.h> | 31 | #include <linux/posix-timers.h> |
32 | #include <linux/interrupt.h> | 32 | #include <linux/interrupt.h> |
33 | #include <linux/time.h> | ||
34 | #include <linux/math64.h> | ||
33 | 35 | ||
34 | #include <asm/uaccess.h> | 36 | #include <asm/uaccess.h> |
35 | #include <asm/sn/addrs.h> | 37 | #include <asm/sn/addrs.h> |
@@ -472,8 +474,8 @@ static int sgi_clock_get(clockid_t clockid, struct timespec *tp) | |||
472 | 474 | ||
473 | nsec = rtc_time() * sgi_clock_period | 475 | nsec = rtc_time() * sgi_clock_period |
474 | + sgi_clock_offset.tv_nsec; | 476 | + sgi_clock_offset.tv_nsec; |
475 | tp->tv_sec = div_long_long_rem(nsec, NSEC_PER_SEC, &tp->tv_nsec) | 477 | *tp = ns_to_timespec(nsec); |
476 | + sgi_clock_offset.tv_sec; | 478 | tp->tv_sec += sgi_clock_offset.tv_sec; |
477 | return 0; | 479 | return 0; |
478 | }; | 480 | }; |
479 | 481 | ||
@@ -481,11 +483,11 @@ static int sgi_clock_set(clockid_t clockid, struct timespec *tp) | |||
481 | { | 483 | { |
482 | 484 | ||
483 | u64 nsec; | 485 | u64 nsec; |
484 | u64 rem; | 486 | u32 rem; |
485 | 487 | ||
486 | nsec = rtc_time() * sgi_clock_period; | 488 | nsec = rtc_time() * sgi_clock_period; |
487 | 489 | ||
488 | sgi_clock_offset.tv_sec = tp->tv_sec - div_long_long_rem(nsec, NSEC_PER_SEC, &rem); | 490 | sgi_clock_offset.tv_sec = tp->tv_sec - div_u64_rem(nsec, NSEC_PER_SEC, &rem); |
489 | 491 | ||
490 | if (rem <= tp->tv_nsec) | 492 | if (rem <= tp->tv_nsec) |
491 | sgi_clock_offset.tv_nsec = tp->tv_sec - rem; | 493 | sgi_clock_offset.tv_nsec = tp->tv_sec - rem; |
@@ -644,9 +646,6 @@ static int sgi_timer_del(struct k_itimer *timr) | |||
644 | return 0; | 646 | return 0; |
645 | } | 647 | } |
646 | 648 | ||
647 | #define timespec_to_ns(x) ((x).tv_nsec + (x).tv_sec * NSEC_PER_SEC) | ||
648 | #define ns_to_timespec(ts, nsec) (ts).tv_sec = div_long_long_rem(nsec, NSEC_PER_SEC, &(ts).tv_nsec) | ||
649 | |||
650 | /* Assumption: it_lock is already held with irq's disabled */ | 649 | /* Assumption: it_lock is already held with irq's disabled */ |
651 | static void sgi_timer_get(struct k_itimer *timr, struct itimerspec *cur_setting) | 650 | static void sgi_timer_get(struct k_itimer *timr, struct itimerspec *cur_setting) |
652 | { | 651 | { |
@@ -659,9 +658,8 @@ static void sgi_timer_get(struct k_itimer *timr, struct itimerspec *cur_setting) | |||
659 | return; | 658 | return; |
660 | } | 659 | } |
661 | 660 | ||
662 | ns_to_timespec(cur_setting->it_interval, timr->it.mmtimer.incr * sgi_clock_period); | 661 | cur_setting->it_interval = ns_to_timespec(timr->it.mmtimer.incr * sgi_clock_period); |
663 | ns_to_timespec(cur_setting->it_value, (timr->it.mmtimer.expires - rtc_time())* sgi_clock_period); | 662 | cur_setting->it_value = ns_to_timespec((timr->it.mmtimer.expires - rtc_time()) * sgi_clock_period); |
664 | return; | ||
665 | } | 663 | } |
666 | 664 | ||
667 | 665 | ||
@@ -679,8 +677,8 @@ static int sgi_timer_set(struct k_itimer *timr, int flags, | |||
679 | sgi_timer_get(timr, old_setting); | 677 | sgi_timer_get(timr, old_setting); |
680 | 678 | ||
681 | sgi_timer_del(timr); | 679 | sgi_timer_del(timr); |
682 | when = timespec_to_ns(new_setting->it_value); | 680 | when = timespec_to_ns(&new_setting->it_value); |
683 | period = timespec_to_ns(new_setting->it_interval); | 681 | period = timespec_to_ns(&new_setting->it_interval); |
684 | 682 | ||
685 | if (when == 0) | 683 | if (when == 0) |
686 | /* Clear timer */ | 684 | /* Clear timer */ |
@@ -695,7 +693,7 @@ static int sgi_timer_set(struct k_itimer *timr, int flags, | |||
695 | unsigned long now; | 693 | unsigned long now; |
696 | 694 | ||
697 | getnstimeofday(&n); | 695 | getnstimeofday(&n); |
698 | now = timespec_to_ns(n); | 696 | now = timespec_to_ns(&n); |
699 | if (when > now) | 697 | if (when > now) |
700 | when -= now; | 698 | when -= now; |
701 | else | 699 | else |
diff --git a/drivers/char/synclink.c b/drivers/char/synclink.c index 513b7c2f3e26..ac5080df2565 100644 --- a/drivers/char/synclink.c +++ b/drivers/char/synclink.c | |||
@@ -2028,13 +2028,13 @@ static void mgsl_change_params(struct mgsl_struct *info) | |||
2028 | */ | 2028 | */ |
2029 | static int mgsl_put_char(struct tty_struct *tty, unsigned char ch) | 2029 | static int mgsl_put_char(struct tty_struct *tty, unsigned char ch) |
2030 | { | 2030 | { |
2031 | struct mgsl_struct *info = (struct mgsl_struct *)tty->driver_data; | 2031 | struct mgsl_struct *info = tty->driver_data; |
2032 | unsigned long flags; | 2032 | unsigned long flags; |
2033 | int ret; | 2033 | int ret = 0; |
2034 | 2034 | ||
2035 | if ( debug_level >= DEBUG_LEVEL_INFO ) { | 2035 | if (debug_level >= DEBUG_LEVEL_INFO) { |
2036 | printk( "%s(%d):mgsl_put_char(%d) on %s\n", | 2036 | printk(KERN_DEBUG "%s(%d):mgsl_put_char(%d) on %s\n", |
2037 | __FILE__,__LINE__,ch,info->device_name); | 2037 | __FILE__, __LINE__, ch, info->device_name); |
2038 | } | 2038 | } |
2039 | 2039 | ||
2040 | if (mgsl_paranoia_check(info, tty->name, "mgsl_put_char")) | 2040 | if (mgsl_paranoia_check(info, tty->name, "mgsl_put_char")) |
@@ -2043,9 +2043,9 @@ static int mgsl_put_char(struct tty_struct *tty, unsigned char ch) | |||
2043 | if (!tty || !info->xmit_buf) | 2043 | if (!tty || !info->xmit_buf) |
2044 | return 0; | 2044 | return 0; |
2045 | 2045 | ||
2046 | spin_lock_irqsave(&info->irq_spinlock,flags); | 2046 | spin_lock_irqsave(&info->irq_spinlock, flags); |
2047 | 2047 | ||
2048 | if ( (info->params.mode == MGSL_MODE_ASYNC ) || !info->tx_active ) { | 2048 | if ((info->params.mode == MGSL_MODE_ASYNC ) || !info->tx_active) { |
2049 | if (info->xmit_cnt < SERIAL_XMIT_SIZE - 1) { | 2049 | if (info->xmit_cnt < SERIAL_XMIT_SIZE - 1) { |
2050 | info->xmit_buf[info->xmit_head++] = ch; | 2050 | info->xmit_buf[info->xmit_head++] = ch; |
2051 | info->xmit_head &= SERIAL_XMIT_SIZE-1; | 2051 | info->xmit_head &= SERIAL_XMIT_SIZE-1; |
@@ -2053,7 +2053,7 @@ static int mgsl_put_char(struct tty_struct *tty, unsigned char ch) | |||
2053 | ret = 1; | 2053 | ret = 1; |
2054 | } | 2054 | } |
2055 | } | 2055 | } |
2056 | spin_unlock_irqrestore(&info->irq_spinlock,flags); | 2056 | spin_unlock_irqrestore(&info->irq_spinlock, flags); |
2057 | return ret; | 2057 | return ret; |
2058 | 2058 | ||
2059 | } /* end of mgsl_put_char() */ | 2059 | } /* end of mgsl_put_char() */ |
diff --git a/drivers/gpio/pca953x.c b/drivers/gpio/pca953x.c index 5a99e81d2784..93f916720b13 100644 --- a/drivers/gpio/pca953x.c +++ b/drivers/gpio/pca953x.c | |||
@@ -30,6 +30,8 @@ static const struct i2c_device_id pca953x_id[] = { | |||
30 | { "pca9537", 4, }, | 30 | { "pca9537", 4, }, |
31 | { "pca9538", 8, }, | 31 | { "pca9538", 8, }, |
32 | { "pca9539", 16, }, | 32 | { "pca9539", 16, }, |
33 | { "pca9555", 16, }, | ||
34 | { "pca9557", 8, }, | ||
33 | /* REVISIT several pca955x parts should work here too */ | 35 | /* REVISIT several pca955x parts should work here too */ |
34 | { } | 36 | { } |
35 | }; | 37 | }; |
@@ -193,7 +195,7 @@ static int __devinit pca953x_probe(struct i2c_client *client, | |||
193 | { | 195 | { |
194 | struct pca953x_platform_data *pdata; | 196 | struct pca953x_platform_data *pdata; |
195 | struct pca953x_chip *chip; | 197 | struct pca953x_chip *chip; |
196 | int ret, i; | 198 | int ret; |
197 | 199 | ||
198 | pdata = client->dev.platform_data; | 200 | pdata = client->dev.platform_data; |
199 | if (pdata == NULL) | 201 | if (pdata == NULL) |
diff --git a/drivers/hwmon/adt7473.c b/drivers/hwmon/adt7473.c index 9587869bdba0..c1009d6f9796 100644 --- a/drivers/hwmon/adt7473.c +++ b/drivers/hwmon/adt7473.c | |||
@@ -422,18 +422,14 @@ static ssize_t show_volt(struct device *dev, struct device_attribute *devattr, | |||
422 | * number in the range -128 to 127, or as an unsigned number that must | 422 | * number in the range -128 to 127, or as an unsigned number that must |
423 | * be offset by 64. | 423 | * be offset by 64. |
424 | */ | 424 | */ |
425 | static int decode_temp(struct adt7473_data *data, u8 raw) | 425 | static int decode_temp(u8 twos_complement, u8 raw) |
426 | { | 426 | { |
427 | if (data->temp_twos_complement) | 427 | return twos_complement ? (s8)raw : raw - 64; |
428 | return (s8)raw; | ||
429 | return raw - 64; | ||
430 | } | 428 | } |
431 | 429 | ||
432 | static u8 encode_temp(struct adt7473_data *data, int cooked) | 430 | static u8 encode_temp(u8 twos_complement, int cooked) |
433 | { | 431 | { |
434 | if (data->temp_twos_complement) | 432 | return twos_complement ? cooked & 0xFF : cooked + 64; |
435 | return (cooked & 0xFF); | ||
436 | return cooked + 64; | ||
437 | } | 433 | } |
438 | 434 | ||
439 | static ssize_t show_temp_min(struct device *dev, | 435 | static ssize_t show_temp_min(struct device *dev, |
@@ -442,8 +438,9 @@ static ssize_t show_temp_min(struct device *dev, | |||
442 | { | 438 | { |
443 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); | 439 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); |
444 | struct adt7473_data *data = adt7473_update_device(dev); | 440 | struct adt7473_data *data = adt7473_update_device(dev); |
445 | return sprintf(buf, "%d\n", | 441 | return sprintf(buf, "%d\n", 1000 * decode_temp( |
446 | 1000 * decode_temp(data, data->temp_min[attr->index])); | 442 | data->temp_twos_complement, |
443 | data->temp_min[attr->index])); | ||
447 | } | 444 | } |
448 | 445 | ||
449 | static ssize_t set_temp_min(struct device *dev, | 446 | static ssize_t set_temp_min(struct device *dev, |
@@ -455,7 +452,7 @@ static ssize_t set_temp_min(struct device *dev, | |||
455 | struct i2c_client *client = to_i2c_client(dev); | 452 | struct i2c_client *client = to_i2c_client(dev); |
456 | struct adt7473_data *data = i2c_get_clientdata(client); | 453 | struct adt7473_data *data = i2c_get_clientdata(client); |
457 | int temp = simple_strtol(buf, NULL, 10) / 1000; | 454 | int temp = simple_strtol(buf, NULL, 10) / 1000; |
458 | temp = encode_temp(data, temp); | 455 | temp = encode_temp(data->temp_twos_complement, temp); |
459 | 456 | ||
460 | mutex_lock(&data->lock); | 457 | mutex_lock(&data->lock); |
461 | data->temp_min[attr->index] = temp; | 458 | data->temp_min[attr->index] = temp; |
@@ -472,8 +469,9 @@ static ssize_t show_temp_max(struct device *dev, | |||
472 | { | 469 | { |
473 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); | 470 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); |
474 | struct adt7473_data *data = adt7473_update_device(dev); | 471 | struct adt7473_data *data = adt7473_update_device(dev); |
475 | return sprintf(buf, "%d\n", | 472 | return sprintf(buf, "%d\n", 1000 * decode_temp( |
476 | 1000 * decode_temp(data, data->temp_max[attr->index])); | 473 | data->temp_twos_complement, |
474 | data->temp_max[attr->index])); | ||
477 | } | 475 | } |
478 | 476 | ||
479 | static ssize_t set_temp_max(struct device *dev, | 477 | static ssize_t set_temp_max(struct device *dev, |
@@ -485,7 +483,7 @@ static ssize_t set_temp_max(struct device *dev, | |||
485 | struct i2c_client *client = to_i2c_client(dev); | 483 | struct i2c_client *client = to_i2c_client(dev); |
486 | struct adt7473_data *data = i2c_get_clientdata(client); | 484 | struct adt7473_data *data = i2c_get_clientdata(client); |
487 | int temp = simple_strtol(buf, NULL, 10) / 1000; | 485 | int temp = simple_strtol(buf, NULL, 10) / 1000; |
488 | temp = encode_temp(data, temp); | 486 | temp = encode_temp(data->temp_twos_complement, temp); |
489 | 487 | ||
490 | mutex_lock(&data->lock); | 488 | mutex_lock(&data->lock); |
491 | data->temp_max[attr->index] = temp; | 489 | data->temp_max[attr->index] = temp; |
@@ -501,8 +499,9 @@ static ssize_t show_temp(struct device *dev, struct device_attribute *devattr, | |||
501 | { | 499 | { |
502 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); | 500 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); |
503 | struct adt7473_data *data = adt7473_update_device(dev); | 501 | struct adt7473_data *data = adt7473_update_device(dev); |
504 | return sprintf(buf, "%d\n", | 502 | return sprintf(buf, "%d\n", 1000 * decode_temp( |
505 | 1000 * decode_temp(data, data->temp[attr->index])); | 503 | data->temp_twos_complement, |
504 | data->temp[attr->index])); | ||
506 | } | 505 | } |
507 | 506 | ||
508 | static ssize_t show_fan_min(struct device *dev, | 507 | static ssize_t show_fan_min(struct device *dev, |
@@ -671,8 +670,9 @@ static ssize_t show_temp_tmax(struct device *dev, | |||
671 | { | 670 | { |
672 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); | 671 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); |
673 | struct adt7473_data *data = adt7473_update_device(dev); | 672 | struct adt7473_data *data = adt7473_update_device(dev); |
674 | return sprintf(buf, "%d\n", | 673 | return sprintf(buf, "%d\n", 1000 * decode_temp( |
675 | 1000 * decode_temp(data, data->temp_tmax[attr->index])); | 674 | data->temp_twos_complement, |
675 | data->temp_tmax[attr->index])); | ||
676 | } | 676 | } |
677 | 677 | ||
678 | static ssize_t set_temp_tmax(struct device *dev, | 678 | static ssize_t set_temp_tmax(struct device *dev, |
@@ -684,7 +684,7 @@ static ssize_t set_temp_tmax(struct device *dev, | |||
684 | struct i2c_client *client = to_i2c_client(dev); | 684 | struct i2c_client *client = to_i2c_client(dev); |
685 | struct adt7473_data *data = i2c_get_clientdata(client); | 685 | struct adt7473_data *data = i2c_get_clientdata(client); |
686 | int temp = simple_strtol(buf, NULL, 10) / 1000; | 686 | int temp = simple_strtol(buf, NULL, 10) / 1000; |
687 | temp = encode_temp(data, temp); | 687 | temp = encode_temp(data->temp_twos_complement, temp); |
688 | 688 | ||
689 | mutex_lock(&data->lock); | 689 | mutex_lock(&data->lock); |
690 | data->temp_tmax[attr->index] = temp; | 690 | data->temp_tmax[attr->index] = temp; |
@@ -701,8 +701,9 @@ static ssize_t show_temp_tmin(struct device *dev, | |||
701 | { | 701 | { |
702 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); | 702 | struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); |
703 | struct adt7473_data *data = adt7473_update_device(dev); | 703 | struct adt7473_data *data = adt7473_update_device(dev); |
704 | return sprintf(buf, "%d\n", | 704 | return sprintf(buf, "%d\n", 1000 * decode_temp( |
705 | 1000 * decode_temp(data, data->temp_tmin[attr->index])); | 705 | data->temp_twos_complement, |
706 | data->temp_tmin[attr->index])); | ||
706 | } | 707 | } |
707 | 708 | ||
708 | static ssize_t set_temp_tmin(struct device *dev, | 709 | static ssize_t set_temp_tmin(struct device *dev, |
@@ -714,7 +715,7 @@ static ssize_t set_temp_tmin(struct device *dev, | |||
714 | struct i2c_client *client = to_i2c_client(dev); | 715 | struct i2c_client *client = to_i2c_client(dev); |
715 | struct adt7473_data *data = i2c_get_clientdata(client); | 716 | struct adt7473_data *data = i2c_get_clientdata(client); |
716 | int temp = simple_strtol(buf, NULL, 10) / 1000; | 717 | int temp = simple_strtol(buf, NULL, 10) / 1000; |
717 | temp = encode_temp(data, temp); | 718 | temp = encode_temp(data->temp_twos_complement, temp); |
718 | 719 | ||
719 | mutex_lock(&data->lock); | 720 | mutex_lock(&data->lock); |
720 | data->temp_tmin[attr->index] = temp; | 721 | data->temp_tmin[attr->index] = temp; |
diff --git a/drivers/hwmon/asb100.c b/drivers/hwmon/asb100.c index 84712a22acea..fe2eea4d799b 100644 --- a/drivers/hwmon/asb100.c +++ b/drivers/hwmon/asb100.c | |||
@@ -953,12 +953,8 @@ static void asb100_write_value(struct i2c_client *client, u16 reg, u16 value) | |||
953 | static void asb100_init_client(struct i2c_client *client) | 953 | static void asb100_init_client(struct i2c_client *client) |
954 | { | 954 | { |
955 | struct asb100_data *data = i2c_get_clientdata(client); | 955 | struct asb100_data *data = i2c_get_clientdata(client); |
956 | int vid = 0; | ||
957 | 956 | ||
958 | vid = asb100_read_value(client, ASB100_REG_VID_FANDIV) & 0x0f; | ||
959 | vid |= (asb100_read_value(client, ASB100_REG_CHIPID) & 0x01) << 4; | ||
960 | data->vrm = vid_which_vrm(); | 957 | data->vrm = vid_which_vrm(); |
961 | vid = vid_from_reg(vid, data->vrm); | ||
962 | 958 | ||
963 | /* Start monitoring */ | 959 | /* Start monitoring */ |
964 | asb100_write_value(client, ASB100_REG_CONFIG, | 960 | asb100_write_value(client, ASB100_REG_CONFIG, |
diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c index 115f4090b98e..fa7696905154 100644 --- a/drivers/hwmon/lm75.c +++ b/drivers/hwmon/lm75.c | |||
@@ -248,7 +248,7 @@ static int lm75_detach_client(struct i2c_client *client) | |||
248 | 248 | ||
249 | /* All registers are word-sized, except for the configuration register. | 249 | /* All registers are word-sized, except for the configuration register. |
250 | LM75 uses a high-byte first convention, which is exactly opposite to | 250 | LM75 uses a high-byte first convention, which is exactly opposite to |
251 | the usual practice. */ | 251 | the SMBus standard. */ |
252 | static int lm75_read_value(struct i2c_client *client, u8 reg) | 252 | static int lm75_read_value(struct i2c_client *client, u8 reg) |
253 | { | 253 | { |
254 | if (reg == LM75_REG_CONF) | 254 | if (reg == LM75_REG_CONF) |
@@ -257,9 +257,6 @@ static int lm75_read_value(struct i2c_client *client, u8 reg) | |||
257 | return swab16(i2c_smbus_read_word_data(client, reg)); | 257 | return swab16(i2c_smbus_read_word_data(client, reg)); |
258 | } | 258 | } |
259 | 259 | ||
260 | /* All registers are word-sized, except for the configuration register. | ||
261 | LM75 uses a high-byte first convention, which is exactly opposite to | ||
262 | the usual practice. */ | ||
263 | static int lm75_write_value(struct i2c_client *client, u8 reg, u16 value) | 260 | static int lm75_write_value(struct i2c_client *client, u8 reg, u16 value) |
264 | { | 261 | { |
265 | if (reg == LM75_REG_CONF) | 262 | if (reg == LM75_REG_CONF) |
diff --git a/drivers/hwmon/smsc47b397.c b/drivers/hwmon/smsc47b397.c index f61d8f4185b2..eb03544c731c 100644 --- a/drivers/hwmon/smsc47b397.c +++ b/drivers/hwmon/smsc47b397.c | |||
@@ -335,11 +335,23 @@ exit: | |||
335 | static int __init smsc47b397_find(unsigned short *addr) | 335 | static int __init smsc47b397_find(unsigned short *addr) |
336 | { | 336 | { |
337 | u8 id, rev; | 337 | u8 id, rev; |
338 | char *name; | ||
338 | 339 | ||
339 | superio_enter(); | 340 | superio_enter(); |
340 | id = force_id ? force_id : superio_inb(SUPERIO_REG_DEVID); | 341 | id = force_id ? force_id : superio_inb(SUPERIO_REG_DEVID); |
341 | 342 | ||
342 | if ((id != 0x6f) && (id != 0x81) && (id != 0x85)) { | 343 | switch(id) { |
344 | case 0x81: | ||
345 | name = "SCH5307-NS"; | ||
346 | break; | ||
347 | case 0x6f: | ||
348 | name = "LPC47B397-NC"; | ||
349 | break; | ||
350 | case 0x85: | ||
351 | case 0x8c: | ||
352 | name = "SCH5317"; | ||
353 | break; | ||
354 | default: | ||
343 | superio_exit(); | 355 | superio_exit(); |
344 | return -ENODEV; | 356 | return -ENODEV; |
345 | } | 357 | } |
@@ -352,8 +364,7 @@ static int __init smsc47b397_find(unsigned short *addr) | |||
352 | 364 | ||
353 | printk(KERN_INFO DRVNAME ": found SMSC %s " | 365 | printk(KERN_INFO DRVNAME ": found SMSC %s " |
354 | "(base address 0x%04x, revision %u)\n", | 366 | "(base address 0x%04x, revision %u)\n", |
355 | id == 0x81 ? "SCH5307-NS" : id == 0x85 ? "SCH5317" : | 367 | name, *addr, rev); |
356 | "LPC47B397-NC", *addr, rev); | ||
357 | 368 | ||
358 | superio_exit(); | 369 | superio_exit(); |
359 | return 0; | 370 | return 0; |
diff --git a/drivers/hwmon/w83793.c b/drivers/hwmon/w83793.c index ee35af93b574..ed3c019b78c7 100644 --- a/drivers/hwmon/w83793.c +++ b/drivers/hwmon/w83793.c | |||
@@ -1024,10 +1024,9 @@ static struct sensor_device_attribute_2 w83793_vid[] = { | |||
1024 | SENSOR_ATTR_2(cpu0_vid, S_IRUGO, show_vid, NULL, NOT_USED, 0), | 1024 | SENSOR_ATTR_2(cpu0_vid, S_IRUGO, show_vid, NULL, NOT_USED, 0), |
1025 | SENSOR_ATTR_2(cpu1_vid, S_IRUGO, show_vid, NULL, NOT_USED, 1), | 1025 | SENSOR_ATTR_2(cpu1_vid, S_IRUGO, show_vid, NULL, NOT_USED, 1), |
1026 | }; | 1026 | }; |
1027 | static DEVICE_ATTR(vrm, S_IWUSR | S_IRUGO, show_vrm, store_vrm); | ||
1027 | 1028 | ||
1028 | static struct sensor_device_attribute_2 sda_single_files[] = { | 1029 | static struct sensor_device_attribute_2 sda_single_files[] = { |
1029 | SENSOR_ATTR_2(vrm, S_IWUSR | S_IRUGO, show_vrm, store_vrm, | ||
1030 | NOT_USED, NOT_USED), | ||
1031 | SENSOR_ATTR_2(chassis, S_IWUSR | S_IRUGO, show_alarm_beep, | 1030 | SENSOR_ATTR_2(chassis, S_IWUSR | S_IRUGO, show_alarm_beep, |
1032 | store_chassis_clear, ALARM_STATUS, 30), | 1031 | store_chassis_clear, ALARM_STATUS, 30), |
1033 | SENSOR_ATTR_2(beep_enable, S_IWUSR | S_IRUGO, show_beep_enable, | 1032 | SENSOR_ATTR_2(beep_enable, S_IWUSR | S_IRUGO, show_beep_enable, |
@@ -1080,6 +1079,7 @@ static int w83793_detach_client(struct i2c_client *client) | |||
1080 | 1079 | ||
1081 | for (i = 0; i < ARRAY_SIZE(w83793_vid); i++) | 1080 | for (i = 0; i < ARRAY_SIZE(w83793_vid); i++) |
1082 | device_remove_file(dev, &w83793_vid[i].dev_attr); | 1081 | device_remove_file(dev, &w83793_vid[i].dev_attr); |
1082 | device_remove_file(dev, &dev_attr_vrm); | ||
1083 | 1083 | ||
1084 | for (i = 0; i < ARRAY_SIZE(w83793_left_fan); i++) | 1084 | for (i = 0; i < ARRAY_SIZE(w83793_left_fan); i++) |
1085 | device_remove_file(dev, &w83793_left_fan[i].dev_attr); | 1085 | device_remove_file(dev, &w83793_left_fan[i].dev_attr); |
@@ -1282,7 +1282,6 @@ static int w83793_detect(struct i2c_adapter *adapter, int address, int kind) | |||
1282 | /* Initialize the chip */ | 1282 | /* Initialize the chip */ |
1283 | w83793_init_client(client); | 1283 | w83793_init_client(client); |
1284 | 1284 | ||
1285 | data->vrm = vid_which_vrm(); | ||
1286 | /* | 1285 | /* |
1287 | Only fan 1-5 has their own input pins, | 1286 | Only fan 1-5 has their own input pins, |
1288 | Pwm 1-3 has their own pins | 1287 | Pwm 1-3 has their own pins |
@@ -1293,7 +1292,9 @@ static int w83793_detect(struct i2c_adapter *adapter, int address, int kind) | |||
1293 | val = w83793_read_value(client, W83793_REG_FANIN_CTRL); | 1292 | val = w83793_read_value(client, W83793_REG_FANIN_CTRL); |
1294 | 1293 | ||
1295 | /* check the function of pins 49-56 */ | 1294 | /* check the function of pins 49-56 */ |
1296 | if (!(tmp & 0x80)) { | 1295 | if (tmp & 0x80) { |
1296 | data->has_vid |= 0x2; /* has VIDB */ | ||
1297 | } else { | ||
1297 | data->has_pwm |= 0x18; /* pwm 4,5 */ | 1298 | data->has_pwm |= 0x18; /* pwm 4,5 */ |
1298 | if (val & 0x01) { /* fan 6 */ | 1299 | if (val & 0x01) { /* fan 6 */ |
1299 | data->has_fan |= 0x20; | 1300 | data->has_fan |= 0x20; |
@@ -1309,13 +1310,15 @@ static int w83793_detect(struct i2c_adapter *adapter, int address, int kind) | |||
1309 | } | 1310 | } |
1310 | } | 1311 | } |
1311 | 1312 | ||
1313 | /* check the function of pins 37-40 */ | ||
1314 | if (!(tmp & 0x29)) | ||
1315 | data->has_vid |= 0x1; /* has VIDA */ | ||
1312 | if (0x08 == (tmp & 0x0c)) { | 1316 | if (0x08 == (tmp & 0x0c)) { |
1313 | if (val & 0x08) /* fan 9 */ | 1317 | if (val & 0x08) /* fan 9 */ |
1314 | data->has_fan |= 0x100; | 1318 | data->has_fan |= 0x100; |
1315 | if (val & 0x10) /* fan 10 */ | 1319 | if (val & 0x10) /* fan 10 */ |
1316 | data->has_fan |= 0x200; | 1320 | data->has_fan |= 0x200; |
1317 | } | 1321 | } |
1318 | |||
1319 | if (0x20 == (tmp & 0x30)) { | 1322 | if (0x20 == (tmp & 0x30)) { |
1320 | if (val & 0x20) /* fan 11 */ | 1323 | if (val & 0x20) /* fan 11 */ |
1321 | data->has_fan |= 0x400; | 1324 | data->has_fan |= 0x400; |
@@ -1359,13 +1362,6 @@ static int w83793_detect(struct i2c_adapter *adapter, int address, int kind) | |||
1359 | if (tmp & 0x02) | 1362 | if (tmp & 0x02) |
1360 | data->has_temp |= 0x20; | 1363 | data->has_temp |= 0x20; |
1361 | 1364 | ||
1362 | /* Detect the VID usage and ignore unused input */ | ||
1363 | tmp = w83793_read_value(client, W83793_REG_MFC); | ||
1364 | if (!(tmp & 0x29)) | ||
1365 | data->has_vid |= 0x1; /* has VIDA */ | ||
1366 | if (tmp & 0x80) | ||
1367 | data->has_vid |= 0x2; /* has VIDB */ | ||
1368 | |||
1369 | /* Register sysfs hooks */ | 1365 | /* Register sysfs hooks */ |
1370 | for (i = 0; i < ARRAY_SIZE(w83793_sensor_attr_2); i++) { | 1366 | for (i = 0; i < ARRAY_SIZE(w83793_sensor_attr_2); i++) { |
1371 | err = device_create_file(dev, | 1367 | err = device_create_file(dev, |
@@ -1381,6 +1377,12 @@ static int w83793_detect(struct i2c_adapter *adapter, int address, int kind) | |||
1381 | if (err) | 1377 | if (err) |
1382 | goto exit_remove; | 1378 | goto exit_remove; |
1383 | } | 1379 | } |
1380 | if (data->has_vid) { | ||
1381 | data->vrm = vid_which_vrm(); | ||
1382 | err = device_create_file(dev, &dev_attr_vrm); | ||
1383 | if (err) | ||
1384 | goto exit_remove; | ||
1385 | } | ||
1384 | 1386 | ||
1385 | for (i = 0; i < ARRAY_SIZE(sda_single_files); i++) { | 1387 | for (i = 0; i < ARRAY_SIZE(sda_single_files); i++) { |
1386 | err = device_create_file(dev, &sda_single_files[i].dev_attr); | 1388 | err = device_create_file(dev, &sda_single_files[i].dev_attr); |
diff --git a/drivers/hwmon/w83l785ts.c b/drivers/hwmon/w83l785ts.c index 77f2d482888b..52e268e25dab 100644 --- a/drivers/hwmon/w83l785ts.c +++ b/drivers/hwmon/w83l785ts.c | |||
@@ -301,8 +301,8 @@ static u8 w83l785ts_read_value(struct i2c_client *client, u8 reg, u8 defval) | |||
301 | msleep(i); | 301 | msleep(i); |
302 | } | 302 | } |
303 | 303 | ||
304 | dev_err(&client->dev, "Couldn't read value from register 0x%02x. " | 304 | dev_err(&client->dev, "Couldn't read value from register 0x%02x.\n", |
305 | "Please report.\n", reg); | 305 | reg); |
306 | return defval; | 306 | return defval; |
307 | } | 307 | } |
308 | 308 | ||
diff --git a/drivers/isdn/hysdn/hysdn_procconf.c b/drivers/isdn/hysdn/hysdn_procconf.c index 877be9922c3d..15906d005b05 100644 --- a/drivers/isdn/hysdn/hysdn_procconf.c +++ b/drivers/isdn/hysdn/hysdn_procconf.c | |||
@@ -405,7 +405,8 @@ hysdn_procconf_init(void) | |||
405 | sprintf(conf_name, "%s%d", PROC_CONF_BASENAME, card->myid); | 405 | sprintf(conf_name, "%s%d", PROC_CONF_BASENAME, card->myid); |
406 | if ((card->procconf = (void *) proc_create(conf_name, | 406 | if ((card->procconf = (void *) proc_create(conf_name, |
407 | S_IFREG | S_IRUGO | S_IWUSR, | 407 | S_IFREG | S_IRUGO | S_IWUSR, |
408 | hysdn_proc_entry)) != NULL) { | 408 | hysdn_proc_entry, |
409 | &conf_fops)) != NULL) { | ||
409 | hysdn_proclog_init(card); /* init the log file entry */ | 410 | hysdn_proclog_init(card); /* init the log file entry */ |
410 | } | 411 | } |
411 | card = card->next; /* next entry */ | 412 | card = card->next; /* next entry */ |
diff --git a/drivers/net/fec.c b/drivers/net/fec.c index d7a3ea88eddb..32a4f17d35fc 100644 --- a/drivers/net/fec.c +++ b/drivers/net/fec.c | |||
@@ -67,6 +67,10 @@ | |||
67 | #define FEC_MAX_PORTS 1 | 67 | #define FEC_MAX_PORTS 1 |
68 | #endif | 68 | #endif |
69 | 69 | ||
70 | #if defined(CONFIG_FADS) || defined(CONFIG_RPXCLASSIC) || defined(CONFIG_M5272) | ||
71 | #define HAVE_mii_link_interrupt | ||
72 | #endif | ||
73 | |||
70 | /* | 74 | /* |
71 | * Define the fixed address of the FEC hardware. | 75 | * Define the fixed address of the FEC hardware. |
72 | */ | 76 | */ |
@@ -205,7 +209,10 @@ struct fec_enet_private { | |||
205 | cbd_t *cur_rx, *cur_tx; /* The next free ring entry */ | 209 | cbd_t *cur_rx, *cur_tx; /* The next free ring entry */ |
206 | cbd_t *dirty_tx; /* The ring entries to be free()ed. */ | 210 | cbd_t *dirty_tx; /* The ring entries to be free()ed. */ |
207 | uint tx_full; | 211 | uint tx_full; |
208 | spinlock_t lock; | 212 | /* hold while accessing the HW like ringbuffer for tx/rx but not MAC */ |
213 | spinlock_t hw_lock; | ||
214 | /* hold while accessing the mii_list_t() elements */ | ||
215 | spinlock_t mii_lock; | ||
209 | 216 | ||
210 | uint phy_id; | 217 | uint phy_id; |
211 | uint phy_id_done; | 218 | uint phy_id_done; |
@@ -309,6 +316,7 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
309 | volatile fec_t *fecp; | 316 | volatile fec_t *fecp; |
310 | volatile cbd_t *bdp; | 317 | volatile cbd_t *bdp; |
311 | unsigned short status; | 318 | unsigned short status; |
319 | unsigned long flags; | ||
312 | 320 | ||
313 | fep = netdev_priv(dev); | 321 | fep = netdev_priv(dev); |
314 | fecp = (volatile fec_t*)dev->base_addr; | 322 | fecp = (volatile fec_t*)dev->base_addr; |
@@ -318,6 +326,7 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
318 | return 1; | 326 | return 1; |
319 | } | 327 | } |
320 | 328 | ||
329 | spin_lock_irqsave(&fep->hw_lock, flags); | ||
321 | /* Fill in a Tx ring entry */ | 330 | /* Fill in a Tx ring entry */ |
322 | bdp = fep->cur_tx; | 331 | bdp = fep->cur_tx; |
323 | 332 | ||
@@ -328,6 +337,7 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
328 | * This should not happen, since dev->tbusy should be set. | 337 | * This should not happen, since dev->tbusy should be set. |
329 | */ | 338 | */ |
330 | printk("%s: tx queue full!.\n", dev->name); | 339 | printk("%s: tx queue full!.\n", dev->name); |
340 | spin_unlock_irqrestore(&fep->hw_lock, flags); | ||
331 | return 1; | 341 | return 1; |
332 | } | 342 | } |
333 | #endif | 343 | #endif |
@@ -366,8 +376,6 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
366 | flush_dcache_range((unsigned long)skb->data, | 376 | flush_dcache_range((unsigned long)skb->data, |
367 | (unsigned long)skb->data + skb->len); | 377 | (unsigned long)skb->data + skb->len); |
368 | 378 | ||
369 | spin_lock_irq(&fep->lock); | ||
370 | |||
371 | /* Send it on its way. Tell FEC it's ready, interrupt when done, | 379 | /* Send it on its way. Tell FEC it's ready, interrupt when done, |
372 | * it's the last BD of the frame, and to put the CRC on the end. | 380 | * it's the last BD of the frame, and to put the CRC on the end. |
373 | */ | 381 | */ |
@@ -396,7 +404,7 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
396 | 404 | ||
397 | fep->cur_tx = (cbd_t *)bdp; | 405 | fep->cur_tx = (cbd_t *)bdp; |
398 | 406 | ||
399 | spin_unlock_irq(&fep->lock); | 407 | spin_unlock_irqrestore(&fep->hw_lock, flags); |
400 | 408 | ||
401 | return 0; | 409 | return 0; |
402 | } | 410 | } |
@@ -454,19 +462,20 @@ fec_enet_interrupt(int irq, void * dev_id) | |||
454 | struct net_device *dev = dev_id; | 462 | struct net_device *dev = dev_id; |
455 | volatile fec_t *fecp; | 463 | volatile fec_t *fecp; |
456 | uint int_events; | 464 | uint int_events; |
457 | int handled = 0; | 465 | irqreturn_t ret = IRQ_NONE; |
458 | 466 | ||
459 | fecp = (volatile fec_t*)dev->base_addr; | 467 | fecp = (volatile fec_t*)dev->base_addr; |
460 | 468 | ||
461 | /* Get the interrupt events that caused us to be here. | 469 | /* Get the interrupt events that caused us to be here. |
462 | */ | 470 | */ |
463 | while ((int_events = fecp->fec_ievent) != 0) { | 471 | do { |
472 | int_events = fecp->fec_ievent; | ||
464 | fecp->fec_ievent = int_events; | 473 | fecp->fec_ievent = int_events; |
465 | 474 | ||
466 | /* Handle receive event in its own function. | 475 | /* Handle receive event in its own function. |
467 | */ | 476 | */ |
468 | if (int_events & FEC_ENET_RXF) { | 477 | if (int_events & FEC_ENET_RXF) { |
469 | handled = 1; | 478 | ret = IRQ_HANDLED; |
470 | fec_enet_rx(dev); | 479 | fec_enet_rx(dev); |
471 | } | 480 | } |
472 | 481 | ||
@@ -475,17 +484,18 @@ fec_enet_interrupt(int irq, void * dev_id) | |||
475 | them as part of the transmit process. | 484 | them as part of the transmit process. |
476 | */ | 485 | */ |
477 | if (int_events & FEC_ENET_TXF) { | 486 | if (int_events & FEC_ENET_TXF) { |
478 | handled = 1; | 487 | ret = IRQ_HANDLED; |
479 | fec_enet_tx(dev); | 488 | fec_enet_tx(dev); |
480 | } | 489 | } |
481 | 490 | ||
482 | if (int_events & FEC_ENET_MII) { | 491 | if (int_events & FEC_ENET_MII) { |
483 | handled = 1; | 492 | ret = IRQ_HANDLED; |
484 | fec_enet_mii(dev); | 493 | fec_enet_mii(dev); |
485 | } | 494 | } |
486 | 495 | ||
487 | } | 496 | } while (int_events); |
488 | return IRQ_RETVAL(handled); | 497 | |
498 | return ret; | ||
489 | } | 499 | } |
490 | 500 | ||
491 | 501 | ||
@@ -498,7 +508,7 @@ fec_enet_tx(struct net_device *dev) | |||
498 | struct sk_buff *skb; | 508 | struct sk_buff *skb; |
499 | 509 | ||
500 | fep = netdev_priv(dev); | 510 | fep = netdev_priv(dev); |
501 | spin_lock(&fep->lock); | 511 | spin_lock_irq(&fep->hw_lock); |
502 | bdp = fep->dirty_tx; | 512 | bdp = fep->dirty_tx; |
503 | 513 | ||
504 | while (((status = bdp->cbd_sc) & BD_ENET_TX_READY) == 0) { | 514 | while (((status = bdp->cbd_sc) & BD_ENET_TX_READY) == 0) { |
@@ -557,7 +567,7 @@ fec_enet_tx(struct net_device *dev) | |||
557 | } | 567 | } |
558 | } | 568 | } |
559 | fep->dirty_tx = (cbd_t *)bdp; | 569 | fep->dirty_tx = (cbd_t *)bdp; |
560 | spin_unlock(&fep->lock); | 570 | spin_unlock_irq(&fep->hw_lock); |
561 | } | 571 | } |
562 | 572 | ||
563 | 573 | ||
@@ -584,6 +594,8 @@ fec_enet_rx(struct net_device *dev) | |||
584 | fep = netdev_priv(dev); | 594 | fep = netdev_priv(dev); |
585 | fecp = (volatile fec_t*)dev->base_addr; | 595 | fecp = (volatile fec_t*)dev->base_addr; |
586 | 596 | ||
597 | spin_lock_irq(&fep->hw_lock); | ||
598 | |||
587 | /* First, grab all of the stats for the incoming packet. | 599 | /* First, grab all of the stats for the incoming packet. |
588 | * These get messed up if we get called due to a busy condition. | 600 | * These get messed up if we get called due to a busy condition. |
589 | */ | 601 | */ |
@@ -689,6 +701,8 @@ while (!((status = bdp->cbd_sc) & BD_ENET_RX_EMPTY)) { | |||
689 | */ | 701 | */ |
690 | fecp->fec_r_des_active = 0; | 702 | fecp->fec_r_des_active = 0; |
691 | #endif | 703 | #endif |
704 | |||
705 | spin_unlock_irq(&fep->hw_lock); | ||
692 | } | 706 | } |
693 | 707 | ||
694 | 708 | ||
@@ -702,11 +716,11 @@ fec_enet_mii(struct net_device *dev) | |||
702 | uint mii_reg; | 716 | uint mii_reg; |
703 | 717 | ||
704 | fep = netdev_priv(dev); | 718 | fep = netdev_priv(dev); |
719 | spin_lock_irq(&fep->mii_lock); | ||
720 | |||
705 | ep = fep->hwp; | 721 | ep = fep->hwp; |
706 | mii_reg = ep->fec_mii_data; | 722 | mii_reg = ep->fec_mii_data; |
707 | 723 | ||
708 | spin_lock(&fep->lock); | ||
709 | |||
710 | if ((mip = mii_head) == NULL) { | 724 | if ((mip = mii_head) == NULL) { |
711 | printk("MII and no head!\n"); | 725 | printk("MII and no head!\n"); |
712 | goto unlock; | 726 | goto unlock; |
@@ -723,7 +737,7 @@ fec_enet_mii(struct net_device *dev) | |||
723 | ep->fec_mii_data = mip->mii_regval; | 737 | ep->fec_mii_data = mip->mii_regval; |
724 | 738 | ||
725 | unlock: | 739 | unlock: |
726 | spin_unlock(&fep->lock); | 740 | spin_unlock_irq(&fep->mii_lock); |
727 | } | 741 | } |
728 | 742 | ||
729 | static int | 743 | static int |
@@ -737,12 +751,11 @@ mii_queue(struct net_device *dev, int regval, void (*func)(uint, struct net_devi | |||
737 | /* Add PHY address to register command. | 751 | /* Add PHY address to register command. |
738 | */ | 752 | */ |
739 | fep = netdev_priv(dev); | 753 | fep = netdev_priv(dev); |
740 | regval |= fep->phy_addr << 23; | 754 | spin_lock_irqsave(&fep->mii_lock, flags); |
741 | 755 | ||
756 | regval |= fep->phy_addr << 23; | ||
742 | retval = 0; | 757 | retval = 0; |
743 | 758 | ||
744 | spin_lock_irqsave(&fep->lock,flags); | ||
745 | |||
746 | if ((mip = mii_free) != NULL) { | 759 | if ((mip = mii_free) != NULL) { |
747 | mii_free = mip->mii_next; | 760 | mii_free = mip->mii_next; |
748 | mip->mii_regval = regval; | 761 | mip->mii_regval = regval; |
@@ -759,9 +772,8 @@ mii_queue(struct net_device *dev, int regval, void (*func)(uint, struct net_devi | |||
759 | retval = 1; | 772 | retval = 1; |
760 | } | 773 | } |
761 | 774 | ||
762 | spin_unlock_irqrestore(&fep->lock,flags); | 775 | spin_unlock_irqrestore(&fep->mii_lock, flags); |
763 | 776 | return retval; | |
764 | return(retval); | ||
765 | } | 777 | } |
766 | 778 | ||
767 | static void mii_do_cmd(struct net_device *dev, const phy_cmd_t *c) | 779 | static void mii_do_cmd(struct net_device *dev, const phy_cmd_t *c) |
@@ -1222,7 +1234,7 @@ static phy_info_t const * const phy_info[] = { | |||
1222 | }; | 1234 | }; |
1223 | 1235 | ||
1224 | /* ------------------------------------------------------------------------- */ | 1236 | /* ------------------------------------------------------------------------- */ |
1225 | #if !defined(CONFIG_M532x) | 1237 | #ifdef HAVE_mii_link_interrupt |
1226 | #ifdef CONFIG_RPXCLASSIC | 1238 | #ifdef CONFIG_RPXCLASSIC |
1227 | static void | 1239 | static void |
1228 | mii_link_interrupt(void *dev_id); | 1240 | mii_link_interrupt(void *dev_id); |
@@ -1362,18 +1374,8 @@ static void __inline__ fec_request_intrs(struct net_device *dev) | |||
1362 | unsigned short irq; | 1374 | unsigned short irq; |
1363 | } *idp, id[] = { | 1375 | } *idp, id[] = { |
1364 | { "fec(TXF)", 23 }, | 1376 | { "fec(TXF)", 23 }, |
1365 | { "fec(TXB)", 24 }, | ||
1366 | { "fec(TXFIFO)", 25 }, | ||
1367 | { "fec(TXCR)", 26 }, | ||
1368 | { "fec(RXF)", 27 }, | 1377 | { "fec(RXF)", 27 }, |
1369 | { "fec(RXB)", 28 }, | ||
1370 | { "fec(MII)", 29 }, | 1378 | { "fec(MII)", 29 }, |
1371 | { "fec(LC)", 30 }, | ||
1372 | { "fec(HBERR)", 31 }, | ||
1373 | { "fec(GRA)", 32 }, | ||
1374 | { "fec(EBERR)", 33 }, | ||
1375 | { "fec(BABT)", 34 }, | ||
1376 | { "fec(BABR)", 35 }, | ||
1377 | { NULL }, | 1379 | { NULL }, |
1378 | }; | 1380 | }; |
1379 | 1381 | ||
@@ -1533,18 +1535,8 @@ static void __inline__ fec_request_intrs(struct net_device *dev) | |||
1533 | unsigned short irq; | 1535 | unsigned short irq; |
1534 | } *idp, id[] = { | 1536 | } *idp, id[] = { |
1535 | { "fec(TXF)", 23 }, | 1537 | { "fec(TXF)", 23 }, |
1536 | { "fec(TXB)", 24 }, | ||
1537 | { "fec(TXFIFO)", 25 }, | ||
1538 | { "fec(TXCR)", 26 }, | ||
1539 | { "fec(RXF)", 27 }, | 1538 | { "fec(RXF)", 27 }, |
1540 | { "fec(RXB)", 28 }, | ||
1541 | { "fec(MII)", 29 }, | 1539 | { "fec(MII)", 29 }, |
1542 | { "fec(LC)", 30 }, | ||
1543 | { "fec(HBERR)", 31 }, | ||
1544 | { "fec(GRA)", 32 }, | ||
1545 | { "fec(EBERR)", 33 }, | ||
1546 | { "fec(BABT)", 34 }, | ||
1547 | { "fec(BABR)", 35 }, | ||
1548 | { NULL }, | 1540 | { NULL }, |
1549 | }; | 1541 | }; |
1550 | 1542 | ||
@@ -1660,18 +1652,8 @@ static void __inline__ fec_request_intrs(struct net_device *dev) | |||
1660 | unsigned short irq; | 1652 | unsigned short irq; |
1661 | } *idp, id[] = { | 1653 | } *idp, id[] = { |
1662 | { "fec(TXF)", 36 }, | 1654 | { "fec(TXF)", 36 }, |
1663 | { "fec(TXB)", 37 }, | ||
1664 | { "fec(TXFIFO)", 38 }, | ||
1665 | { "fec(TXCR)", 39 }, | ||
1666 | { "fec(RXF)", 40 }, | 1655 | { "fec(RXF)", 40 }, |
1667 | { "fec(RXB)", 41 }, | ||
1668 | { "fec(MII)", 42 }, | 1656 | { "fec(MII)", 42 }, |
1669 | { "fec(LC)", 43 }, | ||
1670 | { "fec(HBERR)", 44 }, | ||
1671 | { "fec(GRA)", 45 }, | ||
1672 | { "fec(EBERR)", 46 }, | ||
1673 | { "fec(BABT)", 47 }, | ||
1674 | { "fec(BABR)", 48 }, | ||
1675 | { NULL }, | 1657 | { NULL }, |
1676 | }; | 1658 | }; |
1677 | 1659 | ||
@@ -2126,6 +2108,7 @@ mii_discover_phy(uint mii_reg, struct net_device *dev) | |||
2126 | 2108 | ||
2127 | /* This interrupt occurs when the PHY detects a link change. | 2109 | /* This interrupt occurs when the PHY detects a link change. |
2128 | */ | 2110 | */ |
2111 | #ifdef HAVE_mii_link_interrupt | ||
2129 | #ifdef CONFIG_RPXCLASSIC | 2112 | #ifdef CONFIG_RPXCLASSIC |
2130 | static void | 2113 | static void |
2131 | mii_link_interrupt(void *dev_id) | 2114 | mii_link_interrupt(void *dev_id) |
@@ -2148,6 +2131,7 @@ mii_link_interrupt(int irq, void * dev_id) | |||
2148 | 2131 | ||
2149 | return IRQ_HANDLED; | 2132 | return IRQ_HANDLED; |
2150 | } | 2133 | } |
2134 | #endif | ||
2151 | 2135 | ||
2152 | static int | 2136 | static int |
2153 | fec_enet_open(struct net_device *dev) | 2137 | fec_enet_open(struct net_device *dev) |
@@ -2243,13 +2227,13 @@ static void set_multicast_list(struct net_device *dev) | |||
2243 | /* Catch all multicast addresses, so set the | 2227 | /* Catch all multicast addresses, so set the |
2244 | * filter to all 1's. | 2228 | * filter to all 1's. |
2245 | */ | 2229 | */ |
2246 | ep->fec_hash_table_high = 0xffffffff; | 2230 | ep->fec_grp_hash_table_high = 0xffffffff; |
2247 | ep->fec_hash_table_low = 0xffffffff; | 2231 | ep->fec_grp_hash_table_low = 0xffffffff; |
2248 | } else { | 2232 | } else { |
2249 | /* Clear filter and add the addresses in hash register. | 2233 | /* Clear filter and add the addresses in hash register. |
2250 | */ | 2234 | */ |
2251 | ep->fec_hash_table_high = 0; | 2235 | ep->fec_grp_hash_table_high = 0; |
2252 | ep->fec_hash_table_low = 0; | 2236 | ep->fec_grp_hash_table_low = 0; |
2253 | 2237 | ||
2254 | dmi = dev->mc_list; | 2238 | dmi = dev->mc_list; |
2255 | 2239 | ||
@@ -2280,9 +2264,9 @@ static void set_multicast_list(struct net_device *dev) | |||
2280 | hash = (crc >> (32 - HASH_BITS)) & 0x3f; | 2264 | hash = (crc >> (32 - HASH_BITS)) & 0x3f; |
2281 | 2265 | ||
2282 | if (hash > 31) | 2266 | if (hash > 31) |
2283 | ep->fec_hash_table_high |= 1 << (hash - 32); | 2267 | ep->fec_grp_hash_table_high |= 1 << (hash - 32); |
2284 | else | 2268 | else |
2285 | ep->fec_hash_table_low |= 1 << hash; | 2269 | ep->fec_grp_hash_table_low |= 1 << hash; |
2286 | } | 2270 | } |
2287 | } | 2271 | } |
2288 | } | 2272 | } |
@@ -2332,6 +2316,9 @@ int __init fec_enet_init(struct net_device *dev) | |||
2332 | return -ENOMEM; | 2316 | return -ENOMEM; |
2333 | } | 2317 | } |
2334 | 2318 | ||
2319 | spin_lock_init(&fep->hw_lock); | ||
2320 | spin_lock_init(&fep->mii_lock); | ||
2321 | |||
2335 | /* Create an Ethernet device instance. | 2322 | /* Create an Ethernet device instance. |
2336 | */ | 2323 | */ |
2337 | fecp = (volatile fec_t *) fec_hw[index]; | 2324 | fecp = (volatile fec_t *) fec_hw[index]; |
@@ -2430,11 +2417,15 @@ int __init fec_enet_init(struct net_device *dev) | |||
2430 | */ | 2417 | */ |
2431 | fec_request_intrs(dev); | 2418 | fec_request_intrs(dev); |
2432 | 2419 | ||
2433 | fecp->fec_hash_table_high = 0; | 2420 | fecp->fec_grp_hash_table_high = 0; |
2434 | fecp->fec_hash_table_low = 0; | 2421 | fecp->fec_grp_hash_table_low = 0; |
2435 | fecp->fec_r_buff_size = PKT_MAXBLR_SIZE; | 2422 | fecp->fec_r_buff_size = PKT_MAXBLR_SIZE; |
2436 | fecp->fec_ecntrl = 2; | 2423 | fecp->fec_ecntrl = 2; |
2437 | fecp->fec_r_des_active = 0; | 2424 | fecp->fec_r_des_active = 0; |
2425 | #ifndef CONFIG_M5272 | ||
2426 | fecp->fec_hash_table_high = 0; | ||
2427 | fecp->fec_hash_table_low = 0; | ||
2428 | #endif | ||
2438 | 2429 | ||
2439 | dev->base_addr = (unsigned long)fecp; | 2430 | dev->base_addr = (unsigned long)fecp; |
2440 | 2431 | ||
@@ -2455,8 +2446,7 @@ int __init fec_enet_init(struct net_device *dev) | |||
2455 | 2446 | ||
2456 | /* Clear and enable interrupts */ | 2447 | /* Clear and enable interrupts */ |
2457 | fecp->fec_ievent = 0xffc00000; | 2448 | fecp->fec_ievent = 0xffc00000; |
2458 | fecp->fec_imask = (FEC_ENET_TXF | FEC_ENET_TXB | | 2449 | fecp->fec_imask = (FEC_ENET_TXF | FEC_ENET_RXF | FEC_ENET_MII); |
2459 | FEC_ENET_RXF | FEC_ENET_RXB | FEC_ENET_MII); | ||
2460 | 2450 | ||
2461 | /* Queue up command to detect the PHY and initialize the | 2451 | /* Queue up command to detect the PHY and initialize the |
2462 | * remainder of the interface. | 2452 | * remainder of the interface. |
@@ -2500,8 +2490,8 @@ fec_restart(struct net_device *dev, int duplex) | |||
2500 | 2490 | ||
2501 | /* Reset all multicast. | 2491 | /* Reset all multicast. |
2502 | */ | 2492 | */ |
2503 | fecp->fec_hash_table_high = 0; | 2493 | fecp->fec_grp_hash_table_high = 0; |
2504 | fecp->fec_hash_table_low = 0; | 2494 | fecp->fec_grp_hash_table_low = 0; |
2505 | 2495 | ||
2506 | /* Set maximum receive buffer size. | 2496 | /* Set maximum receive buffer size. |
2507 | */ | 2497 | */ |
@@ -2583,8 +2573,7 @@ fec_restart(struct net_device *dev, int duplex) | |||
2583 | 2573 | ||
2584 | /* Enable interrupts we wish to service. | 2574 | /* Enable interrupts we wish to service. |
2585 | */ | 2575 | */ |
2586 | fecp->fec_imask = (FEC_ENET_TXF | FEC_ENET_TXB | | 2576 | fecp->fec_imask = (FEC_ENET_TXF | FEC_ENET_RXF | FEC_ENET_MII); |
2587 | FEC_ENET_RXF | FEC_ENET_RXB | FEC_ENET_MII); | ||
2588 | } | 2577 | } |
2589 | 2578 | ||
2590 | static void | 2579 | static void |
@@ -2624,7 +2613,7 @@ fec_stop(struct net_device *dev) | |||
2624 | static int __init fec_enet_module_init(void) | 2613 | static int __init fec_enet_module_init(void) |
2625 | { | 2614 | { |
2626 | struct net_device *dev; | 2615 | struct net_device *dev; |
2627 | int i, j, err; | 2616 | int i, err; |
2628 | DECLARE_MAC_BUF(mac); | 2617 | DECLARE_MAC_BUF(mac); |
2629 | 2618 | ||
2630 | printk("FEC ENET Version 0.2\n"); | 2619 | printk("FEC ENET Version 0.2\n"); |
diff --git a/drivers/net/fec.h b/drivers/net/fec.h index 1d421606984f..292719daceff 100644 --- a/drivers/net/fec.h +++ b/drivers/net/fec.h | |||
@@ -88,8 +88,8 @@ typedef struct fec { | |||
88 | unsigned long fec_reserved7[158]; | 88 | unsigned long fec_reserved7[158]; |
89 | unsigned long fec_addr_low; /* Low 32bits MAC address */ | 89 | unsigned long fec_addr_low; /* Low 32bits MAC address */ |
90 | unsigned long fec_addr_high; /* High 16bits MAC address */ | 90 | unsigned long fec_addr_high; /* High 16bits MAC address */ |
91 | unsigned long fec_hash_table_high; /* High 32bits hash table */ | 91 | unsigned long fec_grp_hash_table_high;/* High 32bits hash table */ |
92 | unsigned long fec_hash_table_low; /* Low 32bits hash table */ | 92 | unsigned long fec_grp_hash_table_low; /* Low 32bits hash table */ |
93 | unsigned long fec_r_des_start; /* Receive descriptor ring */ | 93 | unsigned long fec_r_des_start; /* Receive descriptor ring */ |
94 | unsigned long fec_x_des_start; /* Transmit descriptor ring */ | 94 | unsigned long fec_x_des_start; /* Transmit descriptor ring */ |
95 | unsigned long fec_r_buff_size; /* Maximum receive buff size */ | 95 | unsigned long fec_r_buff_size; /* Maximum receive buff size */ |
diff --git a/drivers/pcmcia/au1000_db1x00.c b/drivers/pcmcia/au1000_db1x00.c index 74e051535d6c..c78d77fd7e3b 100644 --- a/drivers/pcmcia/au1000_db1x00.c +++ b/drivers/pcmcia/au1000_db1x00.c | |||
@@ -194,7 +194,7 @@ db1x00_pcmcia_configure_socket(struct au1000_pcmcia_socket *skt, struct socket_s | |||
194 | default: | 194 | default: |
195 | pwr |= SET_VCC_VPP(0,0,sock); | 195 | pwr |= SET_VCC_VPP(0,0,sock); |
196 | printk("%s: bad Vcc/Vpp (%d:%d)\n", | 196 | printk("%s: bad Vcc/Vpp (%d:%d)\n", |
197 | __FUNCTION__, | 197 | __func__, |
198 | state->Vcc, | 198 | state->Vcc, |
199 | state->Vpp); | 199 | state->Vpp); |
200 | break; | 200 | break; |
@@ -215,7 +215,7 @@ db1x00_pcmcia_configure_socket(struct au1000_pcmcia_socket *skt, struct socket_s | |||
215 | default: | 215 | default: |
216 | pwr |= SET_VCC_VPP(0,0,sock); | 216 | pwr |= SET_VCC_VPP(0,0,sock); |
217 | printk("%s: bad Vcc/Vpp (%d:%d)\n", | 217 | printk("%s: bad Vcc/Vpp (%d:%d)\n", |
218 | __FUNCTION__, | 218 | __func__, |
219 | state->Vcc, | 219 | state->Vcc, |
220 | state->Vpp); | 220 | state->Vpp); |
221 | break; | 221 | break; |
@@ -224,7 +224,7 @@ db1x00_pcmcia_configure_socket(struct au1000_pcmcia_socket *skt, struct socket_s | |||
224 | default: /* what's this ? */ | 224 | default: /* what's this ? */ |
225 | pwr |= SET_VCC_VPP(0,0,sock); | 225 | pwr |= SET_VCC_VPP(0,0,sock); |
226 | printk(KERN_ERR "%s: bad Vcc %d\n", | 226 | printk(KERN_ERR "%s: bad Vcc %d\n", |
227 | __FUNCTION__, state->Vcc); | 227 | __func__, state->Vcc); |
228 | break; | 228 | break; |
229 | } | 229 | } |
230 | 230 | ||
diff --git a/drivers/pcmcia/au1000_generic.c b/drivers/pcmcia/au1000_generic.c index b693367d38cd..75e8f8505e47 100644 --- a/drivers/pcmcia/au1000_generic.c +++ b/drivers/pcmcia/au1000_generic.c | |||
@@ -41,6 +41,7 @@ | |||
41 | #include <linux/notifier.h> | 41 | #include <linux/notifier.h> |
42 | #include <linux/interrupt.h> | 42 | #include <linux/interrupt.h> |
43 | #include <linux/spinlock.h> | 43 | #include <linux/spinlock.h> |
44 | #include <linux/mutex.h> | ||
44 | #include <linux/platform_device.h> | 45 | #include <linux/platform_device.h> |
45 | 46 | ||
46 | #include <asm/io.h> | 47 | #include <asm/io.h> |
@@ -71,7 +72,7 @@ extern struct au1000_pcmcia_socket au1000_pcmcia_socket[]; | |||
71 | u32 *pcmcia_base_vaddrs[2]; | 72 | u32 *pcmcia_base_vaddrs[2]; |
72 | extern const unsigned long mips_io_port_base; | 73 | extern const unsigned long mips_io_port_base; |
73 | 74 | ||
74 | DECLARE_MUTEX(pcmcia_sockets_lock); | 75 | static DEFINE_MUTEX(pcmcia_sockets_lock); |
75 | 76 | ||
76 | static int (*au1x00_pcmcia_hw_init[])(struct device *dev) = { | 77 | static int (*au1x00_pcmcia_hw_init[])(struct device *dev) = { |
77 | au1x_board_init, | 78 | au1x_board_init, |
@@ -472,7 +473,7 @@ int au1x00_drv_pcmcia_remove(struct device *dev) | |||
472 | struct skt_dev_info *sinfo = dev_get_drvdata(dev); | 473 | struct skt_dev_info *sinfo = dev_get_drvdata(dev); |
473 | int i; | 474 | int i; |
474 | 475 | ||
475 | down(&pcmcia_sockets_lock); | 476 | mutex_lock(&pcmcia_sockets_lock); |
476 | dev_set_drvdata(dev, NULL); | 477 | dev_set_drvdata(dev, NULL); |
477 | 478 | ||
478 | for (i = 0; i < sinfo->nskt; i++) { | 479 | for (i = 0; i < sinfo->nskt; i++) { |
@@ -488,7 +489,7 @@ int au1x00_drv_pcmcia_remove(struct device *dev) | |||
488 | } | 489 | } |
489 | 490 | ||
490 | kfree(sinfo); | 491 | kfree(sinfo); |
491 | up(&pcmcia_sockets_lock); | 492 | mutex_unlock(&pcmcia_sockets_lock); |
492 | return 0; | 493 | return 0; |
493 | } | 494 | } |
494 | 495 | ||
@@ -501,13 +502,13 @@ static int au1x00_drv_pcmcia_probe(struct device *dev) | |||
501 | { | 502 | { |
502 | int i, ret = -ENODEV; | 503 | int i, ret = -ENODEV; |
503 | 504 | ||
504 | down(&pcmcia_sockets_lock); | 505 | mutex_lock(&pcmcia_sockets_lock); |
505 | for (i=0; i < ARRAY_SIZE(au1x00_pcmcia_hw_init); i++) { | 506 | for (i=0; i < ARRAY_SIZE(au1x00_pcmcia_hw_init); i++) { |
506 | ret = au1x00_pcmcia_hw_init[i](dev); | 507 | ret = au1x00_pcmcia_hw_init[i](dev); |
507 | if (ret == 0) | 508 | if (ret == 0) |
508 | break; | 509 | break; |
509 | } | 510 | } |
510 | up(&pcmcia_sockets_lock); | 511 | mutex_unlock(&pcmcia_sockets_lock); |
511 | return ret; | 512 | return ret; |
512 | } | 513 | } |
513 | 514 | ||
diff --git a/drivers/pcmcia/au1000_pb1x00.c b/drivers/pcmcia/au1000_pb1x00.c index 86c0808d6a05..157e41423a0a 100644 --- a/drivers/pcmcia/au1000_pb1x00.c +++ b/drivers/pcmcia/au1000_pb1x00.c | |||
@@ -244,7 +244,7 @@ pb1x00_pcmcia_configure_socket(const struct pcmcia_configure *configure) | |||
244 | pcr |= SET_VCC_VPP(VCC_HIZ,VPP_HIZ, | 244 | pcr |= SET_VCC_VPP(VCC_HIZ,VPP_HIZ, |
245 | configure->sock); | 245 | configure->sock); |
246 | printk("%s: bad Vcc/Vpp (%d:%d)\n", | 246 | printk("%s: bad Vcc/Vpp (%d:%d)\n", |
247 | __FUNCTION__, | 247 | __func__, |
248 | configure->vcc, | 248 | configure->vcc, |
249 | configure->vpp); | 249 | configure->vpp); |
250 | break; | 250 | break; |
@@ -272,7 +272,7 @@ pb1x00_pcmcia_configure_socket(const struct pcmcia_configure *configure) | |||
272 | pcr |= SET_VCC_VPP(VCC_HIZ,VPP_HIZ, | 272 | pcr |= SET_VCC_VPP(VCC_HIZ,VPP_HIZ, |
273 | configure->sock); | 273 | configure->sock); |
274 | printk("%s: bad Vcc/Vpp (%d:%d)\n", | 274 | printk("%s: bad Vcc/Vpp (%d:%d)\n", |
275 | __FUNCTION__, | 275 | __func__, |
276 | configure->vcc, | 276 | configure->vcc, |
277 | configure->vpp); | 277 | configure->vpp); |
278 | break; | 278 | break; |
@@ -300,7 +300,7 @@ pb1x00_pcmcia_configure_socket(const struct pcmcia_configure *configure) | |||
300 | pcr |= SET_VCC_VPP(VCC_HIZ,VPP_HIZ, | 300 | pcr |= SET_VCC_VPP(VCC_HIZ,VPP_HIZ, |
301 | configure->sock); | 301 | configure->sock); |
302 | printk("%s: bad Vcc/Vpp (%d:%d)\n", | 302 | printk("%s: bad Vcc/Vpp (%d:%d)\n", |
303 | __FUNCTION__, | 303 | __func__, |
304 | configure->vcc, | 304 | configure->vcc, |
305 | configure->vpp); | 305 | configure->vpp); |
306 | break; | 306 | break; |
@@ -309,7 +309,7 @@ pb1x00_pcmcia_configure_socket(const struct pcmcia_configure *configure) | |||
309 | default: /* what's this ? */ | 309 | default: /* what's this ? */ |
310 | pcr |= SET_VCC_VPP(VCC_HIZ,VPP_HIZ,configure->sock); | 310 | pcr |= SET_VCC_VPP(VCC_HIZ,VPP_HIZ,configure->sock); |
311 | printk(KERN_ERR "%s: bad Vcc %d\n", | 311 | printk(KERN_ERR "%s: bad Vcc %d\n", |
312 | __FUNCTION__, configure->vcc); | 312 | __func__, configure->vcc); |
313 | break; | 313 | break; |
314 | } | 314 | } |
315 | 315 | ||
@@ -353,7 +353,7 @@ pb1x00_pcmcia_configure_socket(const struct pcmcia_configure *configure) | |||
353 | default: | 353 | default: |
354 | pcr |= SET_VCC_VPP(0,0); | 354 | pcr |= SET_VCC_VPP(0,0); |
355 | printk("%s: bad Vcc/Vpp (%d:%d)\n", | 355 | printk("%s: bad Vcc/Vpp (%d:%d)\n", |
356 | __FUNCTION__, | 356 | __func__, |
357 | configure->vcc, | 357 | configure->vcc, |
358 | configure->vpp); | 358 | configure->vpp); |
359 | break; | 359 | break; |
@@ -374,7 +374,7 @@ pb1x00_pcmcia_configure_socket(const struct pcmcia_configure *configure) | |||
374 | default: | 374 | default: |
375 | pcr |= SET_VCC_VPP(0,0); | 375 | pcr |= SET_VCC_VPP(0,0); |
376 | printk("%s: bad Vcc/Vpp (%d:%d)\n", | 376 | printk("%s: bad Vcc/Vpp (%d:%d)\n", |
377 | __FUNCTION__, | 377 | __func__, |
378 | configure->vcc, | 378 | configure->vcc, |
379 | configure->vpp); | 379 | configure->vpp); |
380 | break; | 380 | break; |
@@ -383,7 +383,7 @@ pb1x00_pcmcia_configure_socket(const struct pcmcia_configure *configure) | |||
383 | default: /* what's this ? */ | 383 | default: /* what's this ? */ |
384 | pcr |= SET_VCC_VPP(0,0); | 384 | pcr |= SET_VCC_VPP(0,0); |
385 | printk(KERN_ERR "%s: bad Vcc %d\n", | 385 | printk(KERN_ERR "%s: bad Vcc %d\n", |
386 | __FUNCTION__, configure->vcc); | 386 | __func__, configure->vcc); |
387 | break; | 387 | break; |
388 | } | 388 | } |
389 | 389 | ||
diff --git a/drivers/pcmcia/au1000_xxs1500.c b/drivers/pcmcia/au1000_xxs1500.c index ce9d5c44a7b5..c78ed5347510 100644 --- a/drivers/pcmcia/au1000_xxs1500.c +++ b/drivers/pcmcia/au1000_xxs1500.c | |||
@@ -56,7 +56,7 @@ | |||
56 | #define PCMCIA_IRQ AU1000_GPIO_4 | 56 | #define PCMCIA_IRQ AU1000_GPIO_4 |
57 | 57 | ||
58 | #if 0 | 58 | #if 0 |
59 | #define DEBUG(x,args...) printk(__FUNCTION__ ": " x,##args) | 59 | #define DEBUG(x, args...) printk(__func__ ": " x, ##args) |
60 | #else | 60 | #else |
61 | #define DEBUG(x,args...) | 61 | #define DEBUG(x,args...) |
62 | #endif | 62 | #endif |
diff --git a/drivers/pcmcia/cardbus.c b/drivers/pcmcia/cardbus.c index 714baaeb6da1..fb2f38dc92c5 100644 --- a/drivers/pcmcia/cardbus.c +++ b/drivers/pcmcia/cardbus.c | |||
@@ -209,7 +209,7 @@ static void cardbus_assign_irqs(struct pci_bus *bus, int irq) | |||
209 | } | 209 | } |
210 | } | 210 | } |
211 | 211 | ||
212 | int cb_alloc(struct pcmcia_socket * s) | 212 | int __ref cb_alloc(struct pcmcia_socket * s) |
213 | { | 213 | { |
214 | struct pci_bus *bus = s->cb_dev->subordinate; | 214 | struct pci_bus *bus = s->cb_dev->subordinate; |
215 | struct pci_dev *dev; | 215 | struct pci_dev *dev; |
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c index 5a85871f5ee9..e40775443d04 100644 --- a/drivers/pcmcia/ds.c +++ b/drivers/pcmcia/ds.c | |||
@@ -1520,7 +1520,7 @@ static void pcmcia_bus_remove_socket(struct device *dev, | |||
1520 | 1520 | ||
1521 | 1521 | ||
1522 | /* the pcmcia_bus_interface is used to handle pcmcia socket devices */ | 1522 | /* the pcmcia_bus_interface is used to handle pcmcia socket devices */ |
1523 | static struct class_interface pcmcia_bus_interface = { | 1523 | static struct class_interface pcmcia_bus_interface __refdata = { |
1524 | .class = &pcmcia_socket_class, | 1524 | .class = &pcmcia_socket_class, |
1525 | .add_dev = &pcmcia_bus_add_socket, | 1525 | .add_dev = &pcmcia_bus_add_socket, |
1526 | .remove_dev = &pcmcia_bus_remove_socket, | 1526 | .remove_dev = &pcmcia_bus_remove_socket, |
diff --git a/drivers/pcmcia/i82092.c b/drivers/pcmcia/i82092.c index e54ecc580d9e..e13618656ff7 100644 --- a/drivers/pcmcia/i82092.c +++ b/drivers/pcmcia/i82092.c | |||
@@ -53,7 +53,7 @@ static int i82092aa_socket_resume (struct pci_dev *dev) | |||
53 | } | 53 | } |
54 | #endif | 54 | #endif |
55 | 55 | ||
56 | static struct pci_driver i82092aa_pci_drv = { | 56 | static struct pci_driver i82092aa_pci_driver = { |
57 | .name = "i82092aa", | 57 | .name = "i82092aa", |
58 | .id_table = i82092aa_pci_ids, | 58 | .id_table = i82092aa_pci_ids, |
59 | .probe = i82092aa_pci_probe, | 59 | .probe = i82092aa_pci_probe, |
@@ -714,13 +714,13 @@ static int i82092aa_set_mem_map(struct pcmcia_socket *socket, struct pccard_mem_ | |||
714 | 714 | ||
715 | static int i82092aa_module_init(void) | 715 | static int i82092aa_module_init(void) |
716 | { | 716 | { |
717 | return pci_register_driver(&i82092aa_pci_drv); | 717 | return pci_register_driver(&i82092aa_pci_driver); |
718 | } | 718 | } |
719 | 719 | ||
720 | static void i82092aa_module_exit(void) | 720 | static void i82092aa_module_exit(void) |
721 | { | 721 | { |
722 | enter("i82092aa_module_exit"); | 722 | enter("i82092aa_module_exit"); |
723 | pci_unregister_driver(&i82092aa_pci_drv); | 723 | pci_unregister_driver(&i82092aa_pci_driver); |
724 | if (sockets[0].io_base>0) | 724 | if (sockets[0].io_base>0) |
725 | release_region(sockets[0].io_base, 2); | 725 | release_region(sockets[0].io_base, 2); |
726 | leave("i82092aa_module_exit"); | 726 | leave("i82092aa_module_exit"); |
diff --git a/drivers/pcmcia/omap_cf.c b/drivers/pcmcia/omap_cf.c index bb6db3a582b2..46314b420765 100644 --- a/drivers/pcmcia/omap_cf.c +++ b/drivers/pcmcia/omap_cf.c | |||
@@ -153,7 +153,7 @@ omap_cf_set_socket(struct pcmcia_socket *sock, struct socket_state_t *s) | |||
153 | 153 | ||
154 | static int omap_cf_ss_suspend(struct pcmcia_socket *s) | 154 | static int omap_cf_ss_suspend(struct pcmcia_socket *s) |
155 | { | 155 | { |
156 | pr_debug("%s: %s\n", driver_name, __FUNCTION__); | 156 | pr_debug("%s: %s\n", driver_name, __func__); |
157 | return omap_cf_set_socket(s, &dead_socket); | 157 | return omap_cf_set_socket(s, &dead_socket); |
158 | } | 158 | } |
159 | 159 | ||
diff --git a/drivers/pcmcia/pd6729.c b/drivers/pcmcia/pd6729.c index abc10fe49bd8..8bed1dab9039 100644 --- a/drivers/pcmcia/pd6729.c +++ b/drivers/pcmcia/pd6729.c | |||
@@ -778,7 +778,7 @@ static struct pci_device_id pd6729_pci_ids[] = { | |||
778 | }; | 778 | }; |
779 | MODULE_DEVICE_TABLE(pci, pd6729_pci_ids); | 779 | MODULE_DEVICE_TABLE(pci, pd6729_pci_ids); |
780 | 780 | ||
781 | static struct pci_driver pd6729_pci_drv = { | 781 | static struct pci_driver pd6729_pci_driver = { |
782 | .name = "pd6729", | 782 | .name = "pd6729", |
783 | .id_table = pd6729_pci_ids, | 783 | .id_table = pd6729_pci_ids, |
784 | .probe = pd6729_pci_probe, | 784 | .probe = pd6729_pci_probe, |
@@ -791,12 +791,12 @@ static struct pci_driver pd6729_pci_drv = { | |||
791 | 791 | ||
792 | static int pd6729_module_init(void) | 792 | static int pd6729_module_init(void) |
793 | { | 793 | { |
794 | return pci_register_driver(&pd6729_pci_drv); | 794 | return pci_register_driver(&pd6729_pci_driver); |
795 | } | 795 | } |
796 | 796 | ||
797 | static void pd6729_module_exit(void) | 797 | static void pd6729_module_exit(void) |
798 | { | 798 | { |
799 | pci_unregister_driver(&pd6729_pci_drv); | 799 | pci_unregister_driver(&pd6729_pci_driver); |
800 | } | 800 | } |
801 | 801 | ||
802 | module_init(pd6729_module_init); | 802 | module_init(pd6729_module_init); |
diff --git a/drivers/pcmcia/pxa2xx_lubbock.c b/drivers/pcmcia/pxa2xx_lubbock.c index 4a05802213c8..881ec8a8e389 100644 --- a/drivers/pcmcia/pxa2xx_lubbock.c +++ b/drivers/pcmcia/pxa2xx_lubbock.c | |||
@@ -87,7 +87,7 @@ lubbock_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, | |||
87 | 87 | ||
88 | default: | 88 | default: |
89 | printk(KERN_ERR "%s(): unrecognized Vcc %u\n", | 89 | printk(KERN_ERR "%s(): unrecognized Vcc %u\n", |
90 | __FUNCTION__, state->Vcc); | 90 | __func__, state->Vcc); |
91 | ret = -1; | 91 | ret = -1; |
92 | } | 92 | } |
93 | 93 | ||
@@ -104,7 +104,7 @@ lubbock_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, | |||
104 | pa_dwr_set |= GPIO_A0; | 104 | pa_dwr_set |= GPIO_A0; |
105 | else { | 105 | else { |
106 | printk(KERN_ERR "%s(): unrecognized Vpp %u\n", | 106 | printk(KERN_ERR "%s(): unrecognized Vpp %u\n", |
107 | __FUNCTION__, state->Vpp); | 107 | __func__, state->Vpp); |
108 | ret = -1; | 108 | ret = -1; |
109 | break; | 109 | break; |
110 | } | 110 | } |
@@ -128,14 +128,14 @@ lubbock_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, | |||
128 | 128 | ||
129 | default: | 129 | default: |
130 | printk(KERN_ERR "%s(): unrecognized Vcc %u\n", | 130 | printk(KERN_ERR "%s(): unrecognized Vcc %u\n", |
131 | __FUNCTION__, state->Vcc); | 131 | __func__, state->Vcc); |
132 | ret = -1; | 132 | ret = -1; |
133 | break; | 133 | break; |
134 | } | 134 | } |
135 | 135 | ||
136 | if (state->Vpp != state->Vcc && state->Vpp != 0) { | 136 | if (state->Vpp != state->Vcc && state->Vpp != 0) { |
137 | printk(KERN_ERR "%s(): CF slot cannot support Vpp %u\n", | 137 | printk(KERN_ERR "%s(): CF slot cannot support Vpp %u\n", |
138 | __FUNCTION__, state->Vpp); | 138 | __func__, state->Vpp); |
139 | ret = -1; | 139 | ret = -1; |
140 | break; | 140 | break; |
141 | } | 141 | } |
diff --git a/drivers/pcmcia/pxa2xx_mainstone.c b/drivers/pcmcia/pxa2xx_mainstone.c index 6fa5eaaab8af..145b85e0f02c 100644 --- a/drivers/pcmcia/pxa2xx_mainstone.c +++ b/drivers/pcmcia/pxa2xx_mainstone.c | |||
@@ -99,7 +99,7 @@ static int mst_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, | |||
99 | case 50: power |= MST_PCMCIA_PWR_VCC_50; break; | 99 | case 50: power |= MST_PCMCIA_PWR_VCC_50; break; |
100 | default: | 100 | default: |
101 | printk(KERN_ERR "%s(): bad Vcc %u\n", | 101 | printk(KERN_ERR "%s(): bad Vcc %u\n", |
102 | __FUNCTION__, state->Vcc); | 102 | __func__, state->Vcc); |
103 | ret = -1; | 103 | ret = -1; |
104 | } | 104 | } |
105 | 105 | ||
@@ -111,7 +111,7 @@ static int mst_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, | |||
111 | power |= MST_PCMCIA_PWR_VPP_VCC; | 111 | power |= MST_PCMCIA_PWR_VPP_VCC; |
112 | } else { | 112 | } else { |
113 | printk(KERN_ERR "%s(): bad Vpp %u\n", | 113 | printk(KERN_ERR "%s(): bad Vpp %u\n", |
114 | __FUNCTION__, state->Vpp); | 114 | __func__, state->Vpp); |
115 | ret = -1; | 115 | ret = -1; |
116 | } | 116 | } |
117 | } | 117 | } |
diff --git a/drivers/pcmcia/rsrc_nonstatic.c b/drivers/pcmcia/rsrc_nonstatic.c index a8d100707721..0fcf763b9175 100644 --- a/drivers/pcmcia/rsrc_nonstatic.c +++ b/drivers/pcmcia/rsrc_nonstatic.c | |||
@@ -1045,7 +1045,7 @@ static void __devexit pccard_sysfs_remove_rsrc(struct device *dev, | |||
1045 | device_remove_file(dev, *attr); | 1045 | device_remove_file(dev, *attr); |
1046 | } | 1046 | } |
1047 | 1047 | ||
1048 | static struct class_interface pccard_rsrc_interface = { | 1048 | static struct class_interface pccard_rsrc_interface __refdata = { |
1049 | .class = &pcmcia_socket_class, | 1049 | .class = &pcmcia_socket_class, |
1050 | .add_dev = &pccard_sysfs_add_rsrc, | 1050 | .add_dev = &pccard_sysfs_add_rsrc, |
1051 | .remove_dev = __devexit_p(&pccard_sysfs_remove_rsrc), | 1051 | .remove_dev = __devexit_p(&pccard_sysfs_remove_rsrc), |
diff --git a/drivers/pcmcia/sa1100_assabet.c b/drivers/pcmcia/sa1100_assabet.c index 7c57fdd3c8d7..ce133ce81c10 100644 --- a/drivers/pcmcia/sa1100_assabet.c +++ b/drivers/pcmcia/sa1100_assabet.c | |||
@@ -66,14 +66,14 @@ assabet_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_stat | |||
66 | 66 | ||
67 | case 50: | 67 | case 50: |
68 | printk(KERN_WARNING "%s(): CS asked for 5V, applying 3.3V...\n", | 68 | printk(KERN_WARNING "%s(): CS asked for 5V, applying 3.3V...\n", |
69 | __FUNCTION__); | 69 | __func__); |
70 | 70 | ||
71 | case 33: /* Can only apply 3.3V to the CF slot. */ | 71 | case 33: /* Can only apply 3.3V to the CF slot. */ |
72 | mask = ASSABET_BCR_CF_PWR; | 72 | mask = ASSABET_BCR_CF_PWR; |
73 | break; | 73 | break; |
74 | 74 | ||
75 | default: | 75 | default: |
76 | printk(KERN_ERR "%s(): unrecognized Vcc %u\n", __FUNCTION__, | 76 | printk(KERN_ERR "%s(): unrecognized Vcc %u\n", __func__, |
77 | state->Vcc); | 77 | state->Vcc); |
78 | return -1; | 78 | return -1; |
79 | } | 79 | } |
diff --git a/drivers/pcmcia/sa1100_badge4.c b/drivers/pcmcia/sa1100_badge4.c index 62bfc7566ec2..607c3f326eca 100644 --- a/drivers/pcmcia/sa1100_badge4.c +++ b/drivers/pcmcia/sa1100_badge4.c | |||
@@ -82,14 +82,14 @@ badge4_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_state | |||
82 | case 0: | 82 | case 0: |
83 | if ((state->Vcc != 0) && | 83 | if ((state->Vcc != 0) && |
84 | (state->Vcc != badge4_pcmvcc)) { | 84 | (state->Vcc != badge4_pcmvcc)) { |
85 | complain_about_jumpering(__FUNCTION__, "pcmvcc", | 85 | complain_about_jumpering(__func__, "pcmvcc", |
86 | badge4_pcmvcc, state->Vcc); | 86 | badge4_pcmvcc, state->Vcc); |
87 | // Apply power regardless of the jumpering. | 87 | // Apply power regardless of the jumpering. |
88 | // return -1; | 88 | // return -1; |
89 | } | 89 | } |
90 | if ((state->Vpp != 0) && | 90 | if ((state->Vpp != 0) && |
91 | (state->Vpp != badge4_pcmvpp)) { | 91 | (state->Vpp != badge4_pcmvpp)) { |
92 | complain_about_jumpering(__FUNCTION__, "pcmvpp", | 92 | complain_about_jumpering(__func__, "pcmvpp", |
93 | badge4_pcmvpp, state->Vpp); | 93 | badge4_pcmvpp, state->Vpp); |
94 | return -1; | 94 | return -1; |
95 | } | 95 | } |
@@ -98,7 +98,7 @@ badge4_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_state | |||
98 | case 1: | 98 | case 1: |
99 | if ((state->Vcc != 0) && | 99 | if ((state->Vcc != 0) && |
100 | (state->Vcc != badge4_cfvcc)) { | 100 | (state->Vcc != badge4_cfvcc)) { |
101 | complain_about_jumpering(__FUNCTION__, "cfvcc", | 101 | complain_about_jumpering(__func__, "cfvcc", |
102 | badge4_cfvcc, state->Vcc); | 102 | badge4_cfvcc, state->Vcc); |
103 | return -1; | 103 | return -1; |
104 | } | 104 | } |
@@ -143,7 +143,7 @@ int pcmcia_badge4_init(struct device *dev) | |||
143 | if (machine_is_badge4()) { | 143 | if (machine_is_badge4()) { |
144 | printk(KERN_INFO | 144 | printk(KERN_INFO |
145 | "%s: badge4_pcmvcc=%d, badge4_pcmvpp=%d, badge4_cfvcc=%d\n", | 145 | "%s: badge4_pcmvcc=%d, badge4_pcmvpp=%d, badge4_cfvcc=%d\n", |
146 | __FUNCTION__, | 146 | __func__, |
147 | badge4_pcmvcc, badge4_pcmvpp, badge4_cfvcc); | 147 | badge4_pcmvcc, badge4_pcmvpp, badge4_cfvcc); |
148 | 148 | ||
149 | ret = sa11xx_drv_pcmcia_probe(dev, &badge4_pcmcia_ops, 0, 2); | 149 | ret = sa11xx_drv_pcmcia_probe(dev, &badge4_pcmcia_ops, 0, 2); |
diff --git a/drivers/pcmcia/sa1100_cerf.c b/drivers/pcmcia/sa1100_cerf.c index 549a1529fe35..7c3951a2675d 100644 --- a/drivers/pcmcia/sa1100_cerf.c +++ b/drivers/pcmcia/sa1100_cerf.c | |||
@@ -63,7 +63,7 @@ cerf_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, | |||
63 | 63 | ||
64 | default: | 64 | default: |
65 | printk(KERN_ERR "%s(): unrecognized Vcc %u\n", | 65 | printk(KERN_ERR "%s(): unrecognized Vcc %u\n", |
66 | __FUNCTION__, state->Vcc); | 66 | __func__, state->Vcc); |
67 | return -1; | 67 | return -1; |
68 | } | 68 | } |
69 | 69 | ||
diff --git a/drivers/pcmcia/sa1100_jornada720.c b/drivers/pcmcia/sa1100_jornada720.c index 6284c35dabc6..2167e6714d2d 100644 --- a/drivers/pcmcia/sa1100_jornada720.c +++ b/drivers/pcmcia/sa1100_jornada720.c | |||
@@ -42,7 +42,7 @@ jornada720_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_s | |||
42 | unsigned int pa_dwr_mask, pa_dwr_set; | 42 | unsigned int pa_dwr_mask, pa_dwr_set; |
43 | int ret; | 43 | int ret; |
44 | 44 | ||
45 | printk("%s(): config socket %d vcc %d vpp %d\n", __FUNCTION__, | 45 | printk("%s(): config socket %d vcc %d vpp %d\n", __func__, |
46 | skt->nr, state->Vcc, state->Vpp); | 46 | skt->nr, state->Vcc, state->Vpp); |
47 | 47 | ||
48 | switch (skt->nr) { | 48 | switch (skt->nr) { |
@@ -74,7 +74,7 @@ printk("%s(): config socket %d vcc %d vpp %d\n", __FUNCTION__, | |||
74 | 74 | ||
75 | if (state->Vpp != state->Vcc && state->Vpp != 0) { | 75 | if (state->Vpp != state->Vcc && state->Vpp != 0) { |
76 | printk(KERN_ERR "%s(): slot cannot support VPP %u\n", | 76 | printk(KERN_ERR "%s(): slot cannot support VPP %u\n", |
77 | __FUNCTION__, state->Vpp); | 77 | __func__, state->Vpp); |
78 | return -1; | 78 | return -1; |
79 | } | 79 | } |
80 | 80 | ||
diff --git a/drivers/pcmcia/sa1100_neponset.c b/drivers/pcmcia/sa1100_neponset.c index 5bc9e9532b9d..687492fcd5b4 100644 --- a/drivers/pcmcia/sa1100_neponset.c +++ b/drivers/pcmcia/sa1100_neponset.c | |||
@@ -59,7 +59,7 @@ neponset_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_sta | |||
59 | ncr_set = NCR_A0VPP; | 59 | ncr_set = NCR_A0VPP; |
60 | else { | 60 | else { |
61 | printk(KERN_ERR "%s(): unrecognized VPP %u\n", | 61 | printk(KERN_ERR "%s(): unrecognized VPP %u\n", |
62 | __FUNCTION__, state->Vpp); | 62 | __func__, state->Vpp); |
63 | return -1; | 63 | return -1; |
64 | } | 64 | } |
65 | break; | 65 | break; |
@@ -71,7 +71,7 @@ neponset_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_sta | |||
71 | 71 | ||
72 | if (state->Vpp != state->Vcc && state->Vpp != 0) { | 72 | if (state->Vpp != state->Vcc && state->Vpp != 0) { |
73 | printk(KERN_ERR "%s(): CF slot cannot support VPP %u\n", | 73 | printk(KERN_ERR "%s(): CF slot cannot support VPP %u\n", |
74 | __FUNCTION__, state->Vpp); | 74 | __func__, state->Vpp); |
75 | return -1; | 75 | return -1; |
76 | } | 76 | } |
77 | break; | 77 | break; |
diff --git a/drivers/pcmcia/sa1100_shannon.c b/drivers/pcmcia/sa1100_shannon.c index 9456f5478d09..494912fccc0d 100644 --- a/drivers/pcmcia/sa1100_shannon.c +++ b/drivers/pcmcia/sa1100_shannon.c | |||
@@ -73,19 +73,19 @@ shannon_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, | |||
73 | { | 73 | { |
74 | switch (state->Vcc) { | 74 | switch (state->Vcc) { |
75 | case 0: /* power off */ | 75 | case 0: /* power off */ |
76 | printk(KERN_WARNING "%s(): CS asked for 0V, still applying 3.3V..\n", __FUNCTION__); | 76 | printk(KERN_WARNING "%s(): CS asked for 0V, still applying 3.3V..\n", __func__); |
77 | break; | 77 | break; |
78 | case 50: | 78 | case 50: |
79 | printk(KERN_WARNING "%s(): CS asked for 5V, applying 3.3V..\n", __FUNCTION__); | 79 | printk(KERN_WARNING "%s(): CS asked for 5V, applying 3.3V..\n", __func__); |
80 | case 33: | 80 | case 33: |
81 | break; | 81 | break; |
82 | default: | 82 | default: |
83 | printk(KERN_ERR "%s(): unrecognized Vcc %u\n", | 83 | printk(KERN_ERR "%s(): unrecognized Vcc %u\n", |
84 | __FUNCTION__, state->Vcc); | 84 | __func__, state->Vcc); |
85 | return -1; | 85 | return -1; |
86 | } | 86 | } |
87 | 87 | ||
88 | printk(KERN_WARNING "%s(): Warning, Can't perform reset\n", __FUNCTION__); | 88 | printk(KERN_WARNING "%s(): Warning, Can't perform reset\n", __func__); |
89 | 89 | ||
90 | /* Silently ignore Vpp, output enable, speaker enable. */ | 90 | /* Silently ignore Vpp, output enable, speaker enable. */ |
91 | 91 | ||
diff --git a/drivers/pcmcia/sa1100_simpad.c b/drivers/pcmcia/sa1100_simpad.c index 04d6f7f75f78..42567de894b9 100644 --- a/drivers/pcmcia/sa1100_simpad.c +++ b/drivers/pcmcia/sa1100_simpad.c | |||
@@ -90,7 +90,7 @@ simpad_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, | |||
90 | 90 | ||
91 | default: | 91 | default: |
92 | printk(KERN_ERR "%s(): unrecognized Vcc %u\n", | 92 | printk(KERN_ERR "%s(): unrecognized Vcc %u\n", |
93 | __FUNCTION__, state->Vcc); | 93 | __func__, state->Vcc); |
94 | clear_cs3_bit(VCC_3V_EN|VCC_5V_EN|EN0|EN1); | 94 | clear_cs3_bit(VCC_3V_EN|VCC_5V_EN|EN0|EN1); |
95 | local_irq_restore(flags); | 95 | local_irq_restore(flags); |
96 | return -1; | 96 | return -1; |
diff --git a/drivers/pcmcia/soc_common.c b/drivers/pcmcia/soc_common.c index aa7779d89752..420a77540f41 100644 --- a/drivers/pcmcia/soc_common.c +++ b/drivers/pcmcia/soc_common.c | |||
@@ -37,6 +37,7 @@ | |||
37 | #include <linux/kernel.h> | 37 | #include <linux/kernel.h> |
38 | #include <linux/timer.h> | 38 | #include <linux/timer.h> |
39 | #include <linux/mm.h> | 39 | #include <linux/mm.h> |
40 | #include <linux/mutex.h> | ||
40 | #include <linux/interrupt.h> | 41 | #include <linux/interrupt.h> |
41 | #include <linux/irq.h> | 42 | #include <linux/irq.h> |
42 | #include <linux/spinlock.h> | 43 | #include <linux/spinlock.h> |
@@ -353,7 +354,7 @@ soc_common_pcmcia_set_io_map(struct pcmcia_socket *sock, struct pccard_io_map *m | |||
353 | (map->flags&MAP_PREFETCH)?"PREFETCH ":""); | 354 | (map->flags&MAP_PREFETCH)?"PREFETCH ":""); |
354 | 355 | ||
355 | if (map->map >= MAX_IO_WIN) { | 356 | if (map->map >= MAX_IO_WIN) { |
356 | printk(KERN_ERR "%s(): map (%d) out of range\n", __FUNCTION__, | 357 | printk(KERN_ERR "%s(): map (%d) out of range\n", __func__, |
357 | map->map); | 358 | map->map); |
358 | return -1; | 359 | return -1; |
359 | } | 360 | } |
@@ -578,7 +579,7 @@ EXPORT_SYMBOL(soc_pcmcia_enable_irqs); | |||
578 | 579 | ||
579 | 580 | ||
580 | LIST_HEAD(soc_pcmcia_sockets); | 581 | LIST_HEAD(soc_pcmcia_sockets); |
581 | DECLARE_MUTEX(soc_pcmcia_sockets_lock); | 582 | static DEFINE_MUTEX(soc_pcmcia_sockets_lock); |
582 | 583 | ||
583 | static const char *skt_names[] = { | 584 | static const char *skt_names[] = { |
584 | "PCMCIA socket 0", | 585 | "PCMCIA socket 0", |
@@ -601,11 +602,11 @@ soc_pcmcia_notifier(struct notifier_block *nb, unsigned long val, void *data) | |||
601 | struct cpufreq_freqs *freqs = data; | 602 | struct cpufreq_freqs *freqs = data; |
602 | int ret = 0; | 603 | int ret = 0; |
603 | 604 | ||
604 | down(&soc_pcmcia_sockets_lock); | 605 | mutex_lock(&soc_pcmcia_sockets_lock); |
605 | list_for_each_entry(skt, &soc_pcmcia_sockets, node) | 606 | list_for_each_entry(skt, &soc_pcmcia_sockets, node) |
606 | if ( skt->ops->frequency_change ) | 607 | if ( skt->ops->frequency_change ) |
607 | ret += skt->ops->frequency_change(skt, val, freqs); | 608 | ret += skt->ops->frequency_change(skt, val, freqs); |
608 | up(&soc_pcmcia_sockets_lock); | 609 | mutex_unlock(&soc_pcmcia_sockets_lock); |
609 | 610 | ||
610 | return ret; | 611 | return ret; |
611 | } | 612 | } |
@@ -642,7 +643,7 @@ int soc_common_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops | |||
642 | struct soc_pcmcia_socket *skt; | 643 | struct soc_pcmcia_socket *skt; |
643 | int ret, i; | 644 | int ret, i; |
644 | 645 | ||
645 | down(&soc_pcmcia_sockets_lock); | 646 | mutex_lock(&soc_pcmcia_sockets_lock); |
646 | 647 | ||
647 | sinfo = kzalloc(SKT_DEV_INFO_SIZE(nr), GFP_KERNEL); | 648 | sinfo = kzalloc(SKT_DEV_INFO_SIZE(nr), GFP_KERNEL); |
648 | if (!sinfo) { | 649 | if (!sinfo) { |
@@ -782,7 +783,7 @@ int soc_common_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops | |||
782 | kfree(sinfo); | 783 | kfree(sinfo); |
783 | 784 | ||
784 | out: | 785 | out: |
785 | up(&soc_pcmcia_sockets_lock); | 786 | mutex_unlock(&soc_pcmcia_sockets_lock); |
786 | return ret; | 787 | return ret; |
787 | } | 788 | } |
788 | 789 | ||
@@ -793,7 +794,7 @@ int soc_common_drv_pcmcia_remove(struct device *dev) | |||
793 | 794 | ||
794 | dev_set_drvdata(dev, NULL); | 795 | dev_set_drvdata(dev, NULL); |
795 | 796 | ||
796 | down(&soc_pcmcia_sockets_lock); | 797 | mutex_lock(&soc_pcmcia_sockets_lock); |
797 | for (i = 0; i < sinfo->nskt; i++) { | 798 | for (i = 0; i < sinfo->nskt; i++) { |
798 | struct soc_pcmcia_socket *skt = &sinfo->skt[i]; | 799 | struct soc_pcmcia_socket *skt = &sinfo->skt[i]; |
799 | 800 | ||
@@ -818,7 +819,7 @@ int soc_common_drv_pcmcia_remove(struct device *dev) | |||
818 | if (list_empty(&soc_pcmcia_sockets)) | 819 | if (list_empty(&soc_pcmcia_sockets)) |
819 | soc_pcmcia_cpufreq_unregister(); | 820 | soc_pcmcia_cpufreq_unregister(); |
820 | 821 | ||
821 | up(&soc_pcmcia_sockets_lock); | 822 | mutex_unlock(&soc_pcmcia_sockets_lock); |
822 | 823 | ||
823 | kfree(sinfo); | 824 | kfree(sinfo); |
824 | 825 | ||
diff --git a/drivers/pcmcia/soc_common.h b/drivers/pcmcia/soc_common.h index 6f14126889b3..1edc1da9d353 100644 --- a/drivers/pcmcia/soc_common.h +++ b/drivers/pcmcia/soc_common.h | |||
@@ -133,7 +133,6 @@ extern void soc_common_pcmcia_get_timing(struct soc_pcmcia_socket *, struct soc_ | |||
133 | 133 | ||
134 | 134 | ||
135 | extern struct list_head soc_pcmcia_sockets; | 135 | extern struct list_head soc_pcmcia_sockets; |
136 | extern struct semaphore soc_pcmcia_sockets_lock; | ||
137 | 136 | ||
138 | extern int soc_common_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops, int first, int nr); | 137 | extern int soc_common_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops, int first, int nr); |
139 | extern int soc_common_drv_pcmcia_remove(struct device *dev); | 138 | extern int soc_common_drv_pcmcia_remove(struct device *dev); |
diff --git a/drivers/pnp/pnpbios/rsparser.c b/drivers/pnp/pnpbios/rsparser.c index 2e2c457a0fea..5ff9a4c0447e 100644 --- a/drivers/pnp/pnpbios/rsparser.c +++ b/drivers/pnp/pnpbios/rsparser.c | |||
@@ -591,7 +591,8 @@ static void pnpbios_encode_irq(struct pnp_dev *dev, unsigned char *p, | |||
591 | p[1] = map & 0xff; | 591 | p[1] = map & 0xff; |
592 | p[2] = (map >> 8) & 0xff; | 592 | p[2] = (map >> 8) & 0xff; |
593 | 593 | ||
594 | dev_dbg(&dev->dev, " encode irq %d\n", res->start); | 594 | dev_dbg(&dev->dev, " encode irq %llu\n", |
595 | (unsigned long long)res->start); | ||
595 | } | 596 | } |
596 | 597 | ||
597 | static void pnpbios_encode_dma(struct pnp_dev *dev, unsigned char *p, | 598 | static void pnpbios_encode_dma(struct pnp_dev *dev, unsigned char *p, |
@@ -602,7 +603,8 @@ static void pnpbios_encode_dma(struct pnp_dev *dev, unsigned char *p, | |||
602 | map = 1 << res->start; | 603 | map = 1 << res->start; |
603 | p[1] = map & 0xff; | 604 | p[1] = map & 0xff; |
604 | 605 | ||
605 | dev_dbg(&dev->dev, " encode dma %d\n", res->start); | 606 | dev_dbg(&dev->dev, " encode dma %llu\n", |
607 | (unsigned long long)res->start); | ||
606 | } | 608 | } |
607 | 609 | ||
608 | static void pnpbios_encode_port(struct pnp_dev *dev, unsigned char *p, | 610 | static void pnpbios_encode_port(struct pnp_dev *dev, unsigned char *p, |
diff --git a/drivers/scsi/mvsas.c b/drivers/scsi/mvsas.c index e55b9037adb2..1dd70d7a4947 100644 --- a/drivers/scsi/mvsas.c +++ b/drivers/scsi/mvsas.c | |||
@@ -2822,7 +2822,9 @@ static void mvs_update_phyinfo(struct mvs_info *mvi, int i, | |||
2822 | dev_printk(KERN_DEBUG, &pdev->dev, | 2822 | dev_printk(KERN_DEBUG, &pdev->dev, |
2823 | "phy[%d] Get Attached Address 0x%llX ," | 2823 | "phy[%d] Get Attached Address 0x%llX ," |
2824 | " SAS Address 0x%llX\n", | 2824 | " SAS Address 0x%llX\n", |
2825 | i, phy->att_dev_sas_addr, phy->dev_sas_addr); | 2825 | i, |
2826 | (unsigned long long)phy->att_dev_sas_addr, | ||
2827 | (unsigned long long)phy->dev_sas_addr); | ||
2826 | dev_printk(KERN_DEBUG, &pdev->dev, | 2828 | dev_printk(KERN_DEBUG, &pdev->dev, |
2827 | "Rate = %x , type = %d\n", | 2829 | "Rate = %x , type = %d\n", |
2828 | sas_phy->linkrate, phy->phy_type); | 2830 | sas_phy->linkrate, phy->phy_type); |
diff --git a/drivers/scsi/ncr53c8xx.c b/drivers/scsi/ncr53c8xx.c index ceab4f73caf1..c57c94c0ffd2 100644 --- a/drivers/scsi/ncr53c8xx.c +++ b/drivers/scsi/ncr53c8xx.c | |||
@@ -8222,7 +8222,7 @@ static void process_waiting_list(struct ncb *np, int sts) | |||
8222 | #ifdef DEBUG_WAITING_LIST | 8222 | #ifdef DEBUG_WAITING_LIST |
8223 | if (waiting_list) printk("%s: waiting_list=%lx processing sts=%d\n", ncr_name(np), (u_long) waiting_list, sts); | 8223 | if (waiting_list) printk("%s: waiting_list=%lx processing sts=%d\n", ncr_name(np), (u_long) waiting_list, sts); |
8224 | #endif | 8224 | #endif |
8225 | while (wcmd = waiting_list) { | 8225 | while ((wcmd = waiting_list) != NULL) { |
8226 | waiting_list = (struct scsi_cmnd *) wcmd->next_wcmd; | 8226 | waiting_list = (struct scsi_cmnd *) wcmd->next_wcmd; |
8227 | wcmd->next_wcmd = NULL; | 8227 | wcmd->next_wcmd = NULL; |
8228 | if (sts == DID_OK) { | 8228 | if (sts == DID_OK) { |
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index ea41f2626458..a1ca9b7bf2d5 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c | |||
@@ -2271,7 +2271,8 @@ static int serial8250_request_std_resource(struct uart_8250_port *up) | |||
2271 | } | 2271 | } |
2272 | 2272 | ||
2273 | if (up->port.flags & UPF_IOREMAP) { | 2273 | if (up->port.flags & UPF_IOREMAP) { |
2274 | up->port.membase = ioremap(up->port.mapbase, size); | 2274 | up->port.membase = ioremap_nocache(up->port.mapbase, |
2275 | size); | ||
2275 | if (!up->port.membase) { | 2276 | if (!up->port.membase) { |
2276 | release_mem_region(up->port.mapbase, size); | 2277 | release_mem_region(up->port.mapbase, size); |
2277 | ret = -ENOMEM; | 2278 | ret = -ENOMEM; |
diff --git a/drivers/serial/8250_early.c b/drivers/serial/8250_early.c index cd898704ba4f..f279745e9fef 100644 --- a/drivers/serial/8250_early.c +++ b/drivers/serial/8250_early.c | |||
@@ -153,7 +153,7 @@ static int __init parse_options(struct early_serial8250_device *device, | |||
153 | (void __iomem *)__fix_to_virt(FIX_EARLYCON_MEM_BASE); | 153 | (void __iomem *)__fix_to_virt(FIX_EARLYCON_MEM_BASE); |
154 | port->membase += port->mapbase & ~PAGE_MASK; | 154 | port->membase += port->mapbase & ~PAGE_MASK; |
155 | #else | 155 | #else |
156 | port->membase = ioremap(port->mapbase, 64); | 156 | port->membase = ioremap_nocache(port->mapbase, 64); |
157 | if (!port->membase) { | 157 | if (!port->membase) { |
158 | printk(KERN_ERR "%s: Couldn't ioremap 0x%llx\n", | 158 | printk(KERN_ERR "%s: Couldn't ioremap 0x%llx\n", |
159 | __func__, | 159 | __func__, |
diff --git a/drivers/serial/8250_pci.c b/drivers/serial/8250_pci.c index 6e57382b9137..53fa19cf2f06 100644 --- a/drivers/serial/8250_pci.c +++ b/drivers/serial/8250_pci.c | |||
@@ -86,7 +86,7 @@ setup_port(struct serial_private *priv, struct uart_port *port, | |||
86 | len = pci_resource_len(dev, bar); | 86 | len = pci_resource_len(dev, bar); |
87 | 87 | ||
88 | if (!priv->remapped_bar[bar]) | 88 | if (!priv->remapped_bar[bar]) |
89 | priv->remapped_bar[bar] = ioremap(base, len); | 89 | priv->remapped_bar[bar] = ioremap_nocache(base, len); |
90 | if (!priv->remapped_bar[bar]) | 90 | if (!priv->remapped_bar[bar]) |
91 | return -ENOMEM; | 91 | return -ENOMEM; |
92 | 92 | ||
@@ -270,7 +270,7 @@ static int pci_plx9050_init(struct pci_dev *dev) | |||
270 | /* | 270 | /* |
271 | * enable/disable interrupts | 271 | * enable/disable interrupts |
272 | */ | 272 | */ |
273 | p = ioremap(pci_resource_start(dev, 0), 0x80); | 273 | p = ioremap_nocache(pci_resource_start(dev, 0), 0x80); |
274 | if (p == NULL) | 274 | if (p == NULL) |
275 | return -ENOMEM; | 275 | return -ENOMEM; |
276 | writel(irq_config, p + 0x4c); | 276 | writel(irq_config, p + 0x4c); |
@@ -294,7 +294,7 @@ static void __devexit pci_plx9050_exit(struct pci_dev *dev) | |||
294 | /* | 294 | /* |
295 | * disable interrupts | 295 | * disable interrupts |
296 | */ | 296 | */ |
297 | p = ioremap(pci_resource_start(dev, 0), 0x80); | 297 | p = ioremap_nocache(pci_resource_start(dev, 0), 0x80); |
298 | if (p != NULL) { | 298 | if (p != NULL) { |
299 | writel(0, p + 0x4c); | 299 | writel(0, p + 0x4c); |
300 | 300 | ||
@@ -341,7 +341,8 @@ static int sbs_init(struct pci_dev *dev) | |||
341 | { | 341 | { |
342 | u8 __iomem *p; | 342 | u8 __iomem *p; |
343 | 343 | ||
344 | p = ioremap(pci_resource_start(dev, 0), pci_resource_len(dev, 0)); | 344 | p = ioremap_nocache(pci_resource_start(dev, 0), |
345 | pci_resource_len(dev, 0)); | ||
345 | 346 | ||
346 | if (p == NULL) | 347 | if (p == NULL) |
347 | return -ENOMEM; | 348 | return -ENOMEM; |
@@ -365,7 +366,8 @@ static void __devexit sbs_exit(struct pci_dev *dev) | |||
365 | { | 366 | { |
366 | u8 __iomem *p; | 367 | u8 __iomem *p; |
367 | 368 | ||
368 | p = ioremap(pci_resource_start(dev, 0), pci_resource_len(dev, 0)); | 369 | p = ioremap_nocache(pci_resource_start(dev, 0), |
370 | pci_resource_len(dev, 0)); | ||
369 | /* FIXME: What if resource_len < OCT_REG_CR_OFF */ | 371 | /* FIXME: What if resource_len < OCT_REG_CR_OFF */ |
370 | if (p != NULL) | 372 | if (p != NULL) |
371 | writeb(0, p + OCT_REG_CR_OFF); | 373 | writeb(0, p + OCT_REG_CR_OFF); |
@@ -419,7 +421,7 @@ static int pci_siig10x_init(struct pci_dev *dev) | |||
419 | break; | 421 | break; |
420 | } | 422 | } |
421 | 423 | ||
422 | p = ioremap(pci_resource_start(dev, 0), 0x80); | 424 | p = ioremap_nocache(pci_resource_start(dev, 0), 0x80); |
423 | if (p == NULL) | 425 | if (p == NULL) |
424 | return -ENOMEM; | 426 | return -ENOMEM; |
425 | 427 | ||
diff --git a/drivers/serial/jsm/jsm.h b/drivers/serial/jsm/jsm.h index 12c934a1f274..8871aaa3dba6 100644 --- a/drivers/serial/jsm/jsm.h +++ b/drivers/serial/jsm/jsm.h | |||
@@ -373,6 +373,7 @@ struct neo_uart_struct { | |||
373 | #define PCI_DEVICE_NEO_2DB9PRI_PCI_NAME "Neo 2 - DB9 Universal PCI - Powered Ring Indicator" | 373 | #define PCI_DEVICE_NEO_2DB9PRI_PCI_NAME "Neo 2 - DB9 Universal PCI - Powered Ring Indicator" |
374 | #define PCI_DEVICE_NEO_2RJ45_PCI_NAME "Neo 2 - RJ45 Universal PCI" | 374 | #define PCI_DEVICE_NEO_2RJ45_PCI_NAME "Neo 2 - RJ45 Universal PCI" |
375 | #define PCI_DEVICE_NEO_2RJ45PRI_PCI_NAME "Neo 2 - RJ45 Universal PCI - Powered Ring Indicator" | 375 | #define PCI_DEVICE_NEO_2RJ45PRI_PCI_NAME "Neo 2 - RJ45 Universal PCI - Powered Ring Indicator" |
376 | #define PCIE_DEVICE_NEO_IBM_PCI_NAME "Neo 4 - PCI Express - IBM" | ||
376 | 377 | ||
377 | /* | 378 | /* |
378 | * Our Global Variables. | 379 | * Our Global Variables. |
diff --git a/drivers/serial/jsm/jsm_driver.c b/drivers/serial/jsm/jsm_driver.c index 6767ee381cd1..338cf8a08b43 100644 --- a/drivers/serial/jsm/jsm_driver.c +++ b/drivers/serial/jsm/jsm_driver.c | |||
@@ -82,7 +82,10 @@ static int jsm_probe_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
82 | /* store the info for the board we've found */ | 82 | /* store the info for the board we've found */ |
83 | brd->boardnum = adapter_count++; | 83 | brd->boardnum = adapter_count++; |
84 | brd->pci_dev = pdev; | 84 | brd->pci_dev = pdev; |
85 | brd->maxports = 2; | 85 | if (pdev->device == PCIE_DEVICE_ID_NEO_4_IBM) |
86 | brd->maxports = 4; | ||
87 | else | ||
88 | brd->maxports = 2; | ||
86 | 89 | ||
87 | spin_lock_init(&brd->bd_lock); | 90 | spin_lock_init(&brd->bd_lock); |
88 | spin_lock_init(&brd->bd_intr_lock); | 91 | spin_lock_init(&brd->bd_intr_lock); |
@@ -208,6 +211,7 @@ static struct pci_device_id jsm_pci_tbl[] = { | |||
208 | { PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_NEO_2DB9PRI), 0, 0, 1 }, | 211 | { PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_NEO_2DB9PRI), 0, 0, 1 }, |
209 | { PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_NEO_2RJ45), 0, 0, 2 }, | 212 | { PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_NEO_2RJ45), 0, 0, 2 }, |
210 | { PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_NEO_2RJ45PRI), 0, 0, 3 }, | 213 | { PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_NEO_2RJ45PRI), 0, 0, 3 }, |
214 | { PCI_DEVICE(PCI_VENDOR_ID_DIGI, PCIE_DEVICE_ID_NEO_4_IBM), 0, 0, 4 }, | ||
211 | { 0, } | 215 | { 0, } |
212 | }; | 216 | }; |
213 | MODULE_DEVICE_TABLE(pci, jsm_pci_tbl); | 217 | MODULE_DEVICE_TABLE(pci, jsm_pci_tbl); |
diff --git a/drivers/spi/spi_bfin5xx.c b/drivers/spi/spi_bfin5xx.c index a9ac1fdb3094..7fea3cf4588a 100644 --- a/drivers/spi/spi_bfin5xx.c +++ b/drivers/spi/spi_bfin5xx.c | |||
@@ -608,6 +608,7 @@ static void pump_transfers(unsigned long data) | |||
608 | u8 width; | 608 | u8 width; |
609 | u16 cr, dma_width, dma_config; | 609 | u16 cr, dma_width, dma_config; |
610 | u32 tranf_success = 1; | 610 | u32 tranf_success = 1; |
611 | u8 full_duplex = 0; | ||
611 | 612 | ||
612 | /* Get current state information */ | 613 | /* Get current state information */ |
613 | message = drv_data->cur_msg; | 614 | message = drv_data->cur_msg; |
@@ -658,6 +659,7 @@ static void pump_transfers(unsigned long data) | |||
658 | } | 659 | } |
659 | 660 | ||
660 | if (transfer->rx_buf != NULL) { | 661 | if (transfer->rx_buf != NULL) { |
662 | full_duplex = transfer->tx_buf != NULL; | ||
661 | drv_data->rx = transfer->rx_buf; | 663 | drv_data->rx = transfer->rx_buf; |
662 | drv_data->rx_end = drv_data->rx + transfer->len; | 664 | drv_data->rx_end = drv_data->rx + transfer->len; |
663 | dev_dbg(&drv_data->pdev->dev, "rx_buf is %p, rx_end is %p\n", | 665 | dev_dbg(&drv_data->pdev->dev, "rx_buf is %p, rx_end is %p\n", |
@@ -740,7 +742,8 @@ static void pump_transfers(unsigned long data) | |||
740 | * successful use different way to r/w according to | 742 | * successful use different way to r/w according to |
741 | * drv_data->cur_chip->enable_dma | 743 | * drv_data->cur_chip->enable_dma |
742 | */ | 744 | */ |
743 | if (drv_data->cur_chip->enable_dma && drv_data->len > 6) { | 745 | if (!full_duplex && drv_data->cur_chip->enable_dma |
746 | && drv_data->len > 6) { | ||
744 | 747 | ||
745 | disable_dma(drv_data->dma_channel); | 748 | disable_dma(drv_data->dma_channel); |
746 | clear_dma_irqstat(drv_data->dma_channel); | 749 | clear_dma_irqstat(drv_data->dma_channel); |
@@ -828,7 +831,7 @@ static void pump_transfers(unsigned long data) | |||
828 | /* IO mode write then read */ | 831 | /* IO mode write then read */ |
829 | dev_dbg(&drv_data->pdev->dev, "doing IO transfer\n"); | 832 | dev_dbg(&drv_data->pdev->dev, "doing IO transfer\n"); |
830 | 833 | ||
831 | if (drv_data->tx != NULL && drv_data->rx != NULL) { | 834 | if (full_duplex) { |
832 | /* full duplex mode */ | 835 | /* full duplex mode */ |
833 | BUG_ON((drv_data->tx_end - drv_data->tx) != | 836 | BUG_ON((drv_data->tx_end - drv_data->tx) != |
834 | (drv_data->rx_end - drv_data->rx)); | 837 | (drv_data->rx_end - drv_data->rx)); |
diff --git a/drivers/spi/spi_s3c24xx.c b/drivers/spi/spi_s3c24xx.c index 34bfb7dd7764..0885cc357a37 100644 --- a/drivers/spi/spi_s3c24xx.c +++ b/drivers/spi/spi_s3c24xx.c | |||
@@ -125,10 +125,10 @@ static int s3c24xx_spi_setupxfer(struct spi_device *spi, | |||
125 | /* is clk = pclk / (2 * (pre+1)), or is it | 125 | /* is clk = pclk / (2 * (pre+1)), or is it |
126 | * clk = (pclk * 2) / ( pre + 1) */ | 126 | * clk = (pclk * 2) / ( pre + 1) */ |
127 | 127 | ||
128 | div = (div / 2) - 1; | 128 | div /= 2; |
129 | 129 | ||
130 | if (div < 0) | 130 | if (div > 0) |
131 | div = 1; | 131 | div -= 1; |
132 | 132 | ||
133 | if (div > 255) | 133 | if (div > 255) |
134 | div = 255; | 134 | div = 255; |