diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/char/serial167.c | 2 | ||||
-rw-r--r-- | drivers/edac/edac_core.h | 2 | ||||
-rw-r--r-- | drivers/edac/edac_device.c | 6 | ||||
-rw-r--r-- | drivers/edac/edac_mc.c | 6 | ||||
-rw-r--r-- | drivers/edac/edac_pci.c | 6 | ||||
-rw-r--r-- | drivers/ide/legacy/falconide.c | 2 | ||||
-rw-r--r-- | drivers/input/serio/hp_sdc.c | 1 | ||||
-rw-r--r-- | drivers/macintosh/adb.c | 30 | ||||
-rw-r--r-- | drivers/macintosh/therm_pm72.c | 31 | ||||
-rw-r--r-- | drivers/macintosh/windfarm_smu_sat.c | 10 | ||||
-rw-r--r-- | drivers/pci/probe.c | 33 | ||||
-rw-r--r-- | drivers/scsi/Kconfig | 1 |
12 files changed, 67 insertions, 63 deletions
diff --git a/drivers/char/serial167.c b/drivers/char/serial167.c index fd2db07a50fc..3b23270eaa65 100644 --- a/drivers/char/serial167.c +++ b/drivers/char/serial167.c | |||
@@ -1073,7 +1073,7 @@ static int cy_put_char(struct tty_struct *tty, unsigned char ch) | |||
1073 | return 0; | 1073 | return 0; |
1074 | 1074 | ||
1075 | if (!info->xmit_buf) | 1075 | if (!info->xmit_buf) |
1076 | return; | 1076 | return 0; |
1077 | 1077 | ||
1078 | local_irq_save(flags); | 1078 | local_irq_save(flags); |
1079 | if (info->xmit_cnt >= PAGE_SIZE - 1) { | 1079 | if (info->xmit_cnt >= PAGE_SIZE - 1) { |
diff --git a/drivers/edac/edac_core.h b/drivers/edac/edac_core.h index a9aa845dbe74..b27b13c5eb5a 100644 --- a/drivers/edac/edac_core.h +++ b/drivers/edac/edac_core.h | |||
@@ -97,7 +97,7 @@ extern int edac_debug_level; | |||
97 | #define PCI_VEND_DEV(vend, dev) PCI_VENDOR_ID_ ## vend, \ | 97 | #define PCI_VEND_DEV(vend, dev) PCI_VENDOR_ID_ ## vend, \ |
98 | PCI_DEVICE_ID_ ## vend ## _ ## dev | 98 | PCI_DEVICE_ID_ ## vend ## _ ## dev |
99 | 99 | ||
100 | #define dev_name(dev) (dev)->dev_name | 100 | #define edac_dev_name(dev) (dev)->dev_name |
101 | 101 | ||
102 | /* memory devices */ | 102 | /* memory devices */ |
103 | enum dev_type { | 103 | enum dev_type { |
diff --git a/drivers/edac/edac_device.c b/drivers/edac/edac_device.c index 63372fa7ecfe..5fcd3d89c75d 100644 --- a/drivers/edac/edac_device.c +++ b/drivers/edac/edac_device.c | |||
@@ -333,7 +333,7 @@ static int add_edac_dev_to_global_list(struct edac_device_ctl_info *edac_dev) | |||
333 | fail0: | 333 | fail0: |
334 | edac_printk(KERN_WARNING, EDAC_MC, | 334 | edac_printk(KERN_WARNING, EDAC_MC, |
335 | "%s (%s) %s %s already assigned %d\n", | 335 | "%s (%s) %s %s already assigned %d\n", |
336 | rover->dev->bus_id, dev_name(rover), | 336 | rover->dev->bus_id, edac_dev_name(rover), |
337 | rover->mod_name, rover->ctl_name, rover->dev_idx); | 337 | rover->mod_name, rover->ctl_name, rover->dev_idx); |
338 | return 1; | 338 | return 1; |
339 | 339 | ||
@@ -538,7 +538,7 @@ int edac_device_add_device(struct edac_device_ctl_info *edac_dev) | |||
538 | "'%s': DEV '%s' (%s)\n", | 538 | "'%s': DEV '%s' (%s)\n", |
539 | edac_dev->mod_name, | 539 | edac_dev->mod_name, |
540 | edac_dev->ctl_name, | 540 | edac_dev->ctl_name, |
541 | dev_name(edac_dev), | 541 | edac_dev_name(edac_dev), |
542 | edac_op_state_to_string(edac_dev->op_state)); | 542 | edac_op_state_to_string(edac_dev->op_state)); |
543 | 543 | ||
544 | mutex_unlock(&device_ctls_mutex); | 544 | mutex_unlock(&device_ctls_mutex); |
@@ -599,7 +599,7 @@ struct edac_device_ctl_info *edac_device_del_device(struct device *dev) | |||
599 | edac_printk(KERN_INFO, EDAC_MC, | 599 | edac_printk(KERN_INFO, EDAC_MC, |
600 | "Removed device %d for %s %s: DEV %s\n", | 600 | "Removed device %d for %s %s: DEV %s\n", |
601 | edac_dev->dev_idx, | 601 | edac_dev->dev_idx, |
602 | edac_dev->mod_name, edac_dev->ctl_name, dev_name(edac_dev)); | 602 | edac_dev->mod_name, edac_dev->ctl_name, edac_dev_name(edac_dev)); |
603 | 603 | ||
604 | return edac_dev; | 604 | return edac_dev; |
605 | } | 605 | } |
diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c index a4cf1645f588..d110392d48f4 100644 --- a/drivers/edac/edac_mc.c +++ b/drivers/edac/edac_mc.c | |||
@@ -402,7 +402,7 @@ static int add_mc_to_global_list(struct mem_ctl_info *mci) | |||
402 | fail0: | 402 | fail0: |
403 | edac_printk(KERN_WARNING, EDAC_MC, | 403 | edac_printk(KERN_WARNING, EDAC_MC, |
404 | "%s (%s) %s %s already assigned %d\n", p->dev->bus_id, | 404 | "%s (%s) %s %s already assigned %d\n", p->dev->bus_id, |
405 | dev_name(mci), p->mod_name, p->ctl_name, p->mc_idx); | 405 | edac_dev_name(mci), p->mod_name, p->ctl_name, p->mc_idx); |
406 | return 1; | 406 | return 1; |
407 | 407 | ||
408 | fail1: | 408 | fail1: |
@@ -517,7 +517,7 @@ int edac_mc_add_mc(struct mem_ctl_info *mci) | |||
517 | 517 | ||
518 | /* Report action taken */ | 518 | /* Report action taken */ |
519 | edac_mc_printk(mci, KERN_INFO, "Giving out device to '%s' '%s':" | 519 | edac_mc_printk(mci, KERN_INFO, "Giving out device to '%s' '%s':" |
520 | " DEV %s\n", mci->mod_name, mci->ctl_name, dev_name(mci)); | 520 | " DEV %s\n", mci->mod_name, mci->ctl_name, edac_dev_name(mci)); |
521 | 521 | ||
522 | mutex_unlock(&mem_ctls_mutex); | 522 | mutex_unlock(&mem_ctls_mutex); |
523 | return 0; | 523 | return 0; |
@@ -565,7 +565,7 @@ struct mem_ctl_info *edac_mc_del_mc(struct device *dev) | |||
565 | 565 | ||
566 | edac_printk(KERN_INFO, EDAC_MC, | 566 | edac_printk(KERN_INFO, EDAC_MC, |
567 | "Removed device %d for %s %s: DEV %s\n", mci->mc_idx, | 567 | "Removed device %d for %s %s: DEV %s\n", mci->mc_idx, |
568 | mci->mod_name, mci->ctl_name, dev_name(mci)); | 568 | mci->mod_name, mci->ctl_name, edac_dev_name(mci)); |
569 | 569 | ||
570 | return mci; | 570 | return mci; |
571 | } | 571 | } |
diff --git a/drivers/edac/edac_pci.c b/drivers/edac/edac_pci.c index 9b24340b52e1..22ec9d5d4312 100644 --- a/drivers/edac/edac_pci.c +++ b/drivers/edac/edac_pci.c | |||
@@ -150,7 +150,7 @@ static int add_edac_pci_to_global_list(struct edac_pci_ctl_info *pci) | |||
150 | fail0: | 150 | fail0: |
151 | edac_printk(KERN_WARNING, EDAC_PCI, | 151 | edac_printk(KERN_WARNING, EDAC_PCI, |
152 | "%s (%s) %s %s already assigned %d\n", | 152 | "%s (%s) %s %s already assigned %d\n", |
153 | rover->dev->bus_id, dev_name(rover), | 153 | rover->dev->bus_id, edac_dev_name(rover), |
154 | rover->mod_name, rover->ctl_name, rover->pci_idx); | 154 | rover->mod_name, rover->ctl_name, rover->pci_idx); |
155 | return 1; | 155 | return 1; |
156 | 156 | ||
@@ -360,7 +360,7 @@ int edac_pci_add_device(struct edac_pci_ctl_info *pci, int edac_idx) | |||
360 | " DEV '%s' (%s)\n", | 360 | " DEV '%s' (%s)\n", |
361 | pci->mod_name, | 361 | pci->mod_name, |
362 | pci->ctl_name, | 362 | pci->ctl_name, |
363 | dev_name(pci), edac_op_state_to_string(pci->op_state)); | 363 | edac_dev_name(pci), edac_op_state_to_string(pci->op_state)); |
364 | 364 | ||
365 | mutex_unlock(&edac_pci_ctls_mutex); | 365 | mutex_unlock(&edac_pci_ctls_mutex); |
366 | return 0; | 366 | return 0; |
@@ -415,7 +415,7 @@ struct edac_pci_ctl_info *edac_pci_del_device(struct device *dev) | |||
415 | 415 | ||
416 | edac_printk(KERN_INFO, EDAC_PCI, | 416 | edac_printk(KERN_INFO, EDAC_PCI, |
417 | "Removed device %d for %s %s: DEV %s\n", | 417 | "Removed device %d for %s %s: DEV %s\n", |
418 | pci->pci_idx, pci->mod_name, pci->ctl_name, dev_name(pci)); | 418 | pci->pci_idx, pci->mod_name, pci->ctl_name, edac_dev_name(pci)); |
419 | 419 | ||
420 | return pci; | 420 | return pci; |
421 | } | 421 | } |
diff --git a/drivers/ide/legacy/falconide.c b/drivers/ide/legacy/falconide.c index 83555ca513b5..9e449a0c623f 100644 --- a/drivers/ide/legacy/falconide.c +++ b/drivers/ide/legacy/falconide.c | |||
@@ -61,7 +61,7 @@ static void falconide_output_data(ide_drive_t *drive, struct request *rq, | |||
61 | unsigned long data_addr = drive->hwif->io_ports.data_addr; | 61 | unsigned long data_addr = drive->hwif->io_ports.data_addr; |
62 | 62 | ||
63 | if (drive->media == ide_disk && rq && rq->cmd_type == REQ_TYPE_FS) | 63 | if (drive->media == ide_disk && rq && rq->cmd_type == REQ_TYPE_FS) |
64 | return outsw(data_adr, buf, (len + 1) / 2); | 64 | return outsw(data_addr, buf, (len + 1) / 2); |
65 | 65 | ||
66 | outsw_swapw(data_addr, buf, (len + 1) / 2); | 66 | outsw_swapw(data_addr, buf, (len + 1) / 2); |
67 | } | 67 | } |
diff --git a/drivers/input/serio/hp_sdc.c b/drivers/input/serio/hp_sdc.c index 02b3ad8c0826..edfedd9a166c 100644 --- a/drivers/input/serio/hp_sdc.c +++ b/drivers/input/serio/hp_sdc.c | |||
@@ -69,6 +69,7 @@ | |||
69 | #include <linux/time.h> | 69 | #include <linux/time.h> |
70 | #include <linux/slab.h> | 70 | #include <linux/slab.h> |
71 | #include <linux/hil.h> | 71 | #include <linux/hil.h> |
72 | #include <linux/semaphore.h> | ||
72 | #include <asm/io.h> | 73 | #include <asm/io.h> |
73 | #include <asm/system.h> | 74 | #include <asm/system.h> |
74 | 75 | ||
diff --git a/drivers/macintosh/adb.c b/drivers/macintosh/adb.c index 20978205cd02..b8b9e44f7f4e 100644 --- a/drivers/macintosh/adb.c +++ b/drivers/macintosh/adb.c | |||
@@ -37,7 +37,7 @@ | |||
37 | #include <linux/device.h> | 37 | #include <linux/device.h> |
38 | #include <linux/kthread.h> | 38 | #include <linux/kthread.h> |
39 | #include <linux/platform_device.h> | 39 | #include <linux/platform_device.h> |
40 | #include <linux/semaphore.h> | 40 | #include <linux/mutex.h> |
41 | 41 | ||
42 | #include <asm/uaccess.h> | 42 | #include <asm/uaccess.h> |
43 | #ifdef CONFIG_PPC | 43 | #ifdef CONFIG_PPC |
@@ -102,7 +102,7 @@ static struct adb_handler { | |||
102 | } adb_handler[16]; | 102 | } adb_handler[16]; |
103 | 103 | ||
104 | /* | 104 | /* |
105 | * The adb_handler_sem mutex protects all accesses to the original_address | 105 | * The adb_handler_mutex mutex protects all accesses to the original_address |
106 | * and handler_id fields of adb_handler[i] for all i, and changes to the | 106 | * and handler_id fields of adb_handler[i] for all i, and changes to the |
107 | * handler field. | 107 | * handler field. |
108 | * Accesses to the handler field are protected by the adb_handler_lock | 108 | * Accesses to the handler field are protected by the adb_handler_lock |
@@ -110,7 +110,7 @@ static struct adb_handler { | |||
110 | * time adb_unregister returns, we know that the old handler isn't being | 110 | * time adb_unregister returns, we know that the old handler isn't being |
111 | * called. | 111 | * called. |
112 | */ | 112 | */ |
113 | static DECLARE_MUTEX(adb_handler_sem); | 113 | static DEFINE_MUTEX(adb_handler_mutex); |
114 | static DEFINE_RWLOCK(adb_handler_lock); | 114 | static DEFINE_RWLOCK(adb_handler_lock); |
115 | 115 | ||
116 | #if 0 | 116 | #if 0 |
@@ -355,7 +355,7 @@ do_adb_reset_bus(void) | |||
355 | msleep(500); | 355 | msleep(500); |
356 | } | 356 | } |
357 | 357 | ||
358 | down(&adb_handler_sem); | 358 | mutex_lock(&adb_handler_mutex); |
359 | write_lock_irq(&adb_handler_lock); | 359 | write_lock_irq(&adb_handler_lock); |
360 | memset(adb_handler, 0, sizeof(adb_handler)); | 360 | memset(adb_handler, 0, sizeof(adb_handler)); |
361 | write_unlock_irq(&adb_handler_lock); | 361 | write_unlock_irq(&adb_handler_lock); |
@@ -376,7 +376,7 @@ do_adb_reset_bus(void) | |||
376 | if (adb_controller->autopoll) | 376 | if (adb_controller->autopoll) |
377 | adb_controller->autopoll(autopoll_devs); | 377 | adb_controller->autopoll(autopoll_devs); |
378 | } | 378 | } |
379 | up(&adb_handler_sem); | 379 | mutex_unlock(&adb_handler_mutex); |
380 | 380 | ||
381 | blocking_notifier_call_chain(&adb_client_list, | 381 | blocking_notifier_call_chain(&adb_client_list, |
382 | ADB_MSG_POST_RESET, NULL); | 382 | ADB_MSG_POST_RESET, NULL); |
@@ -454,7 +454,7 @@ adb_register(int default_id, int handler_id, struct adb_ids *ids, | |||
454 | { | 454 | { |
455 | int i; | 455 | int i; |
456 | 456 | ||
457 | down(&adb_handler_sem); | 457 | mutex_lock(&adb_handler_mutex); |
458 | ids->nids = 0; | 458 | ids->nids = 0; |
459 | for (i = 1; i < 16; i++) { | 459 | for (i = 1; i < 16; i++) { |
460 | if ((adb_handler[i].original_address == default_id) && | 460 | if ((adb_handler[i].original_address == default_id) && |
@@ -472,7 +472,7 @@ adb_register(int default_id, int handler_id, struct adb_ids *ids, | |||
472 | ids->id[ids->nids++] = i; | 472 | ids->id[ids->nids++] = i; |
473 | } | 473 | } |
474 | } | 474 | } |
475 | up(&adb_handler_sem); | 475 | mutex_unlock(&adb_handler_mutex); |
476 | return ids->nids; | 476 | return ids->nids; |
477 | } | 477 | } |
478 | 478 | ||
@@ -481,7 +481,7 @@ adb_unregister(int index) | |||
481 | { | 481 | { |
482 | int ret = -ENODEV; | 482 | int ret = -ENODEV; |
483 | 483 | ||
484 | down(&adb_handler_sem); | 484 | mutex_lock(&adb_handler_mutex); |
485 | write_lock_irq(&adb_handler_lock); | 485 | write_lock_irq(&adb_handler_lock); |
486 | if (adb_handler[index].handler) { | 486 | if (adb_handler[index].handler) { |
487 | while(adb_handler[index].busy) { | 487 | while(adb_handler[index].busy) { |
@@ -493,7 +493,7 @@ adb_unregister(int index) | |||
493 | adb_handler[index].handler = NULL; | 493 | adb_handler[index].handler = NULL; |
494 | } | 494 | } |
495 | write_unlock_irq(&adb_handler_lock); | 495 | write_unlock_irq(&adb_handler_lock); |
496 | up(&adb_handler_sem); | 496 | mutex_unlock(&adb_handler_mutex); |
497 | return ret; | 497 | return ret; |
498 | } | 498 | } |
499 | 499 | ||
@@ -557,19 +557,19 @@ adb_try_handler_change(int address, int new_id) | |||
557 | { | 557 | { |
558 | int ret; | 558 | int ret; |
559 | 559 | ||
560 | down(&adb_handler_sem); | 560 | mutex_lock(&adb_handler_mutex); |
561 | ret = try_handler_change(address, new_id); | 561 | ret = try_handler_change(address, new_id); |
562 | up(&adb_handler_sem); | 562 | mutex_unlock(&adb_handler_mutex); |
563 | return ret; | 563 | return ret; |
564 | } | 564 | } |
565 | 565 | ||
566 | int | 566 | int |
567 | adb_get_infos(int address, int *original_address, int *handler_id) | 567 | adb_get_infos(int address, int *original_address, int *handler_id) |
568 | { | 568 | { |
569 | down(&adb_handler_sem); | 569 | mutex_lock(&adb_handler_mutex); |
570 | *original_address = adb_handler[address].original_address; | 570 | *original_address = adb_handler[address].original_address; |
571 | *handler_id = adb_handler[address].handler_id; | 571 | *handler_id = adb_handler[address].handler_id; |
572 | up(&adb_handler_sem); | 572 | mutex_unlock(&adb_handler_mutex); |
573 | 573 | ||
574 | return (*original_address != 0); | 574 | return (*original_address != 0); |
575 | } | 575 | } |
@@ -628,10 +628,10 @@ do_adb_query(struct adb_request *req) | |||
628 | case ADB_QUERY_GETDEVINFO: | 628 | case ADB_QUERY_GETDEVINFO: |
629 | if (req->nbytes < 3) | 629 | if (req->nbytes < 3) |
630 | break; | 630 | break; |
631 | down(&adb_handler_sem); | 631 | mutex_lock(&adb_handler_mutex); |
632 | req->reply[0] = adb_handler[req->data[2]].original_address; | 632 | req->reply[0] = adb_handler[req->data[2]].original_address; |
633 | req->reply[1] = adb_handler[req->data[2]].handler_id; | 633 | req->reply[1] = adb_handler[req->data[2]].handler_id; |
634 | up(&adb_handler_sem); | 634 | mutex_unlock(&adb_handler_mutex); |
635 | req->complete = 1; | 635 | req->complete = 1; |
636 | req->reply_len = 2; | 636 | req->reply_len = 2; |
637 | adb_write_done(req); | 637 | adb_write_done(req); |
diff --git a/drivers/macintosh/therm_pm72.c b/drivers/macintosh/therm_pm72.c index 1e0a69a5e815..ddfb426a9abd 100644 --- a/drivers/macintosh/therm_pm72.c +++ b/drivers/macintosh/therm_pm72.c | |||
@@ -122,6 +122,7 @@ | |||
122 | #include <linux/kmod.h> | 122 | #include <linux/kmod.h> |
123 | #include <linux/i2c.h> | 123 | #include <linux/i2c.h> |
124 | #include <linux/kthread.h> | 124 | #include <linux/kthread.h> |
125 | #include <linux/mutex.h> | ||
125 | #include <asm/prom.h> | 126 | #include <asm/prom.h> |
126 | #include <asm/machdep.h> | 127 | #include <asm/machdep.h> |
127 | #include <asm/io.h> | 128 | #include <asm/io.h> |
@@ -169,7 +170,7 @@ static int rackmac; | |||
169 | static s32 dimm_output_clamp; | 170 | static s32 dimm_output_clamp; |
170 | static int fcu_rpm_shift; | 171 | static int fcu_rpm_shift; |
171 | static int fcu_tickle_ticks; | 172 | static int fcu_tickle_ticks; |
172 | static DECLARE_MUTEX(driver_lock); | 173 | static DEFINE_MUTEX(driver_lock); |
173 | 174 | ||
174 | /* | 175 | /* |
175 | * We have 3 types of CPU PID control. One is "split" old style control | 176 | * We have 3 types of CPU PID control. One is "split" old style control |
@@ -729,9 +730,9 @@ static void fetch_cpu_pumps_minmax(void) | |||
729 | static ssize_t show_##name(struct device *dev, struct device_attribute *attr, char *buf) \ | 730 | static ssize_t show_##name(struct device *dev, struct device_attribute *attr, char *buf) \ |
730 | { \ | 731 | { \ |
731 | ssize_t r; \ | 732 | ssize_t r; \ |
732 | down(&driver_lock); \ | 733 | mutex_lock(&driver_lock); \ |
733 | r = sprintf(buf, "%d.%03d", FIX32TOPRINT(data)); \ | 734 | r = sprintf(buf, "%d.%03d", FIX32TOPRINT(data)); \ |
734 | up(&driver_lock); \ | 735 | mutex_unlock(&driver_lock); \ |
735 | return r; \ | 736 | return r; \ |
736 | } | 737 | } |
737 | #define BUILD_SHOW_FUNC_INT(name, data) \ | 738 | #define BUILD_SHOW_FUNC_INT(name, data) \ |
@@ -1803,11 +1804,11 @@ static int main_control_loop(void *x) | |||
1803 | { | 1804 | { |
1804 | DBG("main_control_loop started\n"); | 1805 | DBG("main_control_loop started\n"); |
1805 | 1806 | ||
1806 | down(&driver_lock); | 1807 | mutex_lock(&driver_lock); |
1807 | 1808 | ||
1808 | if (start_fcu() < 0) { | 1809 | if (start_fcu() < 0) { |
1809 | printk(KERN_ERR "kfand: failed to start FCU\n"); | 1810 | printk(KERN_ERR "kfand: failed to start FCU\n"); |
1810 | up(&driver_lock); | 1811 | mutex_unlock(&driver_lock); |
1811 | goto out; | 1812 | goto out; |
1812 | } | 1813 | } |
1813 | 1814 | ||
@@ -1822,14 +1823,14 @@ static int main_control_loop(void *x) | |||
1822 | 1823 | ||
1823 | fcu_tickle_ticks = FCU_TICKLE_TICKS; | 1824 | fcu_tickle_ticks = FCU_TICKLE_TICKS; |
1824 | 1825 | ||
1825 | up(&driver_lock); | 1826 | mutex_unlock(&driver_lock); |
1826 | 1827 | ||
1827 | while (state == state_attached) { | 1828 | while (state == state_attached) { |
1828 | unsigned long elapsed, start; | 1829 | unsigned long elapsed, start; |
1829 | 1830 | ||
1830 | start = jiffies; | 1831 | start = jiffies; |
1831 | 1832 | ||
1832 | down(&driver_lock); | 1833 | mutex_lock(&driver_lock); |
1833 | 1834 | ||
1834 | /* Tickle the FCU just in case */ | 1835 | /* Tickle the FCU just in case */ |
1835 | if (--fcu_tickle_ticks < 0) { | 1836 | if (--fcu_tickle_ticks < 0) { |
@@ -1861,7 +1862,7 @@ static int main_control_loop(void *x) | |||
1861 | do_monitor_slots(&slots_state); | 1862 | do_monitor_slots(&slots_state); |
1862 | else | 1863 | else |
1863 | do_monitor_drives(&drives_state); | 1864 | do_monitor_drives(&drives_state); |
1864 | up(&driver_lock); | 1865 | mutex_unlock(&driver_lock); |
1865 | 1866 | ||
1866 | if (critical_state == 1) { | 1867 | if (critical_state == 1) { |
1867 | printk(KERN_WARNING "Temperature control detected a critical condition\n"); | 1868 | printk(KERN_WARNING "Temperature control detected a critical condition\n"); |
@@ -2019,13 +2020,13 @@ static void detach_fcu(void) | |||
2019 | */ | 2020 | */ |
2020 | static int therm_pm72_attach(struct i2c_adapter *adapter) | 2021 | static int therm_pm72_attach(struct i2c_adapter *adapter) |
2021 | { | 2022 | { |
2022 | down(&driver_lock); | 2023 | mutex_lock(&driver_lock); |
2023 | 2024 | ||
2024 | /* Check state */ | 2025 | /* Check state */ |
2025 | if (state == state_detached) | 2026 | if (state == state_detached) |
2026 | state = state_attaching; | 2027 | state = state_attaching; |
2027 | if (state != state_attaching) { | 2028 | if (state != state_attaching) { |
2028 | up(&driver_lock); | 2029 | mutex_unlock(&driver_lock); |
2029 | return 0; | 2030 | return 0; |
2030 | } | 2031 | } |
2031 | 2032 | ||
@@ -2054,7 +2055,7 @@ static int therm_pm72_attach(struct i2c_adapter *adapter) | |||
2054 | state = state_attached; | 2055 | state = state_attached; |
2055 | start_control_loops(); | 2056 | start_control_loops(); |
2056 | } | 2057 | } |
2057 | up(&driver_lock); | 2058 | mutex_unlock(&driver_lock); |
2058 | 2059 | ||
2059 | return 0; | 2060 | return 0; |
2060 | } | 2061 | } |
@@ -2065,16 +2066,16 @@ static int therm_pm72_attach(struct i2c_adapter *adapter) | |||
2065 | */ | 2066 | */ |
2066 | static int therm_pm72_detach(struct i2c_adapter *adapter) | 2067 | static int therm_pm72_detach(struct i2c_adapter *adapter) |
2067 | { | 2068 | { |
2068 | down(&driver_lock); | 2069 | mutex_lock(&driver_lock); |
2069 | 2070 | ||
2070 | if (state != state_detached) | 2071 | if (state != state_detached) |
2071 | state = state_detaching; | 2072 | state = state_detaching; |
2072 | 2073 | ||
2073 | /* Stop control loops if any */ | 2074 | /* Stop control loops if any */ |
2074 | DBG("stopping control loops\n"); | 2075 | DBG("stopping control loops\n"); |
2075 | up(&driver_lock); | 2076 | mutex_unlock(&driver_lock); |
2076 | stop_control_loops(); | 2077 | stop_control_loops(); |
2077 | down(&driver_lock); | 2078 | mutex_lock(&driver_lock); |
2078 | 2079 | ||
2079 | if (u3_0 != NULL && !strcmp(adapter->name, "u3 0")) { | 2080 | if (u3_0 != NULL && !strcmp(adapter->name, "u3 0")) { |
2080 | DBG("lost U3-0, disposing control loops\n"); | 2081 | DBG("lost U3-0, disposing control loops\n"); |
@@ -2090,7 +2091,7 @@ static int therm_pm72_detach(struct i2c_adapter *adapter) | |||
2090 | if (u3_0 == NULL && u3_1 == NULL) | 2091 | if (u3_0 == NULL && u3_1 == NULL) |
2091 | state = state_detached; | 2092 | state = state_detached; |
2092 | 2093 | ||
2093 | up(&driver_lock); | 2094 | mutex_unlock(&driver_lock); |
2094 | 2095 | ||
2095 | return 0; | 2096 | return 0; |
2096 | } | 2097 | } |
diff --git a/drivers/macintosh/windfarm_smu_sat.c b/drivers/macintosh/windfarm_smu_sat.c index 797918d0e59c..7f2be4baaeda 100644 --- a/drivers/macintosh/windfarm_smu_sat.c +++ b/drivers/macintosh/windfarm_smu_sat.c | |||
@@ -13,7 +13,7 @@ | |||
13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <linux/wait.h> | 14 | #include <linux/wait.h> |
15 | #include <linux/i2c.h> | 15 | #include <linux/i2c.h> |
16 | #include <linux/semaphore.h> | 16 | #include <linux/mutex.h> |
17 | #include <asm/prom.h> | 17 | #include <asm/prom.h> |
18 | #include <asm/smu.h> | 18 | #include <asm/smu.h> |
19 | #include <asm/pmac_low_i2c.h> | 19 | #include <asm/pmac_low_i2c.h> |
@@ -36,7 +36,7 @@ | |||
36 | struct wf_sat { | 36 | struct wf_sat { |
37 | int nr; | 37 | int nr; |
38 | atomic_t refcnt; | 38 | atomic_t refcnt; |
39 | struct semaphore mutex; | 39 | struct mutex mutex; |
40 | unsigned long last_read; /* jiffies when cache last updated */ | 40 | unsigned long last_read; /* jiffies when cache last updated */ |
41 | u8 cache[16]; | 41 | u8 cache[16]; |
42 | struct i2c_client i2c; | 42 | struct i2c_client i2c; |
@@ -163,7 +163,7 @@ static int wf_sat_get(struct wf_sensor *sr, s32 *value) | |||
163 | if (sat->i2c.adapter == NULL) | 163 | if (sat->i2c.adapter == NULL) |
164 | return -ENODEV; | 164 | return -ENODEV; |
165 | 165 | ||
166 | down(&sat->mutex); | 166 | mutex_lock(&sat->mutex); |
167 | if (time_after(jiffies, (sat->last_read + MAX_AGE))) { | 167 | if (time_after(jiffies, (sat->last_read + MAX_AGE))) { |
168 | err = wf_sat_read_cache(sat); | 168 | err = wf_sat_read_cache(sat); |
169 | if (err) | 169 | if (err) |
@@ -182,7 +182,7 @@ static int wf_sat_get(struct wf_sensor *sr, s32 *value) | |||
182 | err = 0; | 182 | err = 0; |
183 | 183 | ||
184 | fail: | 184 | fail: |
185 | up(&sat->mutex); | 185 | mutex_unlock(&sat->mutex); |
186 | return err; | 186 | return err; |
187 | } | 187 | } |
188 | 188 | ||
@@ -233,7 +233,7 @@ static void wf_sat_create(struct i2c_adapter *adapter, struct device_node *dev) | |||
233 | sat->nr = -1; | 233 | sat->nr = -1; |
234 | sat->node = of_node_get(dev); | 234 | sat->node = of_node_get(dev); |
235 | atomic_set(&sat->refcnt, 0); | 235 | atomic_set(&sat->refcnt, 0); |
236 | init_MUTEX(&sat->mutex); | 236 | mutex_init(&sat->mutex); |
237 | sat->i2c.addr = (addr >> 1) & 0x7f; | 237 | sat->i2c.addr = (addr >> 1) & 0x7f; |
238 | sat->i2c.adapter = adapter; | 238 | sat->i2c.adapter = adapter; |
239 | sat->i2c.driver = &wf_sat_driver; | 239 | sat->i2c.driver = &wf_sat_driver; |
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 4a55bf380957..3706ce7972dd 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c | |||
@@ -842,13 +842,25 @@ static void set_pcie_port_type(struct pci_dev *pdev) | |||
842 | * reading the dword at 0x100 which must either be 0 or a valid extended | 842 | * reading the dword at 0x100 which must either be 0 or a valid extended |
843 | * capability header. | 843 | * capability header. |
844 | */ | 844 | */ |
845 | int pci_cfg_space_size_ext(struct pci_dev *dev, unsigned check_exp_pcix) | 845 | int pci_cfg_space_size_ext(struct pci_dev *dev) |
846 | { | 846 | { |
847 | int pos; | ||
848 | u32 status; | 847 | u32 status; |
849 | 848 | ||
850 | if (!check_exp_pcix) | 849 | if (pci_read_config_dword(dev, 256, &status) != PCIBIOS_SUCCESSFUL) |
851 | goto skip; | 850 | goto fail; |
851 | if (status == 0xffffffff) | ||
852 | goto fail; | ||
853 | |||
854 | return PCI_CFG_SPACE_EXP_SIZE; | ||
855 | |||
856 | fail: | ||
857 | return PCI_CFG_SPACE_SIZE; | ||
858 | } | ||
859 | |||
860 | int pci_cfg_space_size(struct pci_dev *dev) | ||
861 | { | ||
862 | int pos; | ||
863 | u32 status; | ||
852 | 864 | ||
853 | pos = pci_find_capability(dev, PCI_CAP_ID_EXP); | 865 | pos = pci_find_capability(dev, PCI_CAP_ID_EXP); |
854 | if (!pos) { | 866 | if (!pos) { |
@@ -861,23 +873,12 @@ int pci_cfg_space_size_ext(struct pci_dev *dev, unsigned check_exp_pcix) | |||
861 | goto fail; | 873 | goto fail; |
862 | } | 874 | } |
863 | 875 | ||
864 | skip: | 876 | return pci_cfg_space_size_ext(dev); |
865 | if (pci_read_config_dword(dev, 256, &status) != PCIBIOS_SUCCESSFUL) | ||
866 | goto fail; | ||
867 | if (status == 0xffffffff) | ||
868 | goto fail; | ||
869 | |||
870 | return PCI_CFG_SPACE_EXP_SIZE; | ||
871 | 877 | ||
872 | fail: | 878 | fail: |
873 | return PCI_CFG_SPACE_SIZE; | 879 | return PCI_CFG_SPACE_SIZE; |
874 | } | 880 | } |
875 | 881 | ||
876 | int pci_cfg_space_size(struct pci_dev *dev) | ||
877 | { | ||
878 | return pci_cfg_space_size_ext(dev, 1); | ||
879 | } | ||
880 | |||
881 | static void pci_release_bus_bridge_dev(struct device *dev) | 882 | static void pci_release_bus_bridge_dev(struct device *dev) |
882 | { | 883 | { |
883 | kfree(dev); | 884 | kfree(dev); |
diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig index 46d7e400c8be..81ccbd7f9e34 100644 --- a/drivers/scsi/Kconfig +++ b/drivers/scsi/Kconfig | |||
@@ -1679,6 +1679,7 @@ config MAC_SCSI | |||
1679 | config SCSI_MAC_ESP | 1679 | config SCSI_MAC_ESP |
1680 | tristate "Macintosh NCR53c9[46] SCSI" | 1680 | tristate "Macintosh NCR53c9[46] SCSI" |
1681 | depends on MAC && SCSI | 1681 | depends on MAC && SCSI |
1682 | select SCSI_SPI_ATTRS | ||
1682 | help | 1683 | help |
1683 | This is the NCR 53c9x SCSI controller found on most of the 68040 | 1684 | This is the NCR 53c9x SCSI controller found on most of the 68040 |
1684 | based Macintoshes. | 1685 | based Macintoshes. |