diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-08 13:17:20 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-08 13:17:20 -0500 |
| commit | e10154189f001b6428a83f58b03a27954f0f8022 (patch) | |
| tree | 30b4ac5760c5d310e9cc2cbf8fc4b9c6f9d0e369 /drivers/pci | |
| parent | d4bab1b091be4a91a7363118c9ede3cc9a7fefd4 (diff) | |
| parent | 410c17651998944630a95fbb286a50362de2dbb0 (diff) | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6: (62 commits)
msi-laptop: depends on RFKILL
msi-laptop: Detect 3G device exists by standard ec command
msi-laptop: Add resume method for set the SCM load again
msi-laptop: Support some MSI 3G netbook that is need load SCM
msi-laptop: Add threeg sysfs file for support query 3G state by standard 66/62 ec command
msi-laptop: Support standard ec 66/62 command on MSI notebook and nebook
Driver core: create lock/unlock functions for struct device
sysfs: fix for thinko with sysfs_bin_attr_init()
sysfs: Kill unused sysfs_sb variable.
sysfs: Pass super_block to sysfs_get_inode
driver core: Use sysfs_rename_link in device_rename
sysfs: Implement sysfs_rename_link
sysfs: Pack sysfs_dirent more tightly.
sysfs: Serialize updates to the vfs inode
sysfs: windfarm: init sysfs attributes
sysfs: Use sysfs_attr_init and sysfs_bin_attr_init on module dynamic attributes
sysfs: Document sysfs_attr_init and sysfs_bin_attr_init
sysfs: Use sysfs_attr_init and sysfs_bin_attr_init on dynamic attributes
sysfs: Use one lockdep class per sysfs attribute.
sysfs: Only take active references on attributes.
...
Diffstat (limited to 'drivers/pci')
| -rw-r--r-- | drivers/pci/bus.c | 4 | ||||
| -rw-r--r-- | drivers/pci/hotplug/fakephp.c | 2 | ||||
| -rw-r--r-- | drivers/pci/pci-sysfs.c | 5 | ||||
| -rw-r--r-- | drivers/pci/pci.c | 4 | ||||
| -rw-r--r-- | drivers/pci/slot.c | 2 |
5 files changed, 11 insertions, 6 deletions
diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c index 712250f5874a..26301cb25e7f 100644 --- a/drivers/pci/bus.c +++ b/drivers/pci/bus.c | |||
| @@ -288,9 +288,9 @@ void pci_walk_bus(struct pci_bus *top, int (*cb)(struct pci_dev *, void *), | |||
| 288 | next = dev->bus_list.next; | 288 | next = dev->bus_list.next; |
| 289 | 289 | ||
| 290 | /* Run device routines with the device locked */ | 290 | /* Run device routines with the device locked */ |
| 291 | down(&dev->dev.sem); | 291 | device_lock(&dev->dev); |
| 292 | retval = cb(dev, userdata); | 292 | retval = cb(dev, userdata); |
| 293 | up(&dev->dev.sem); | 293 | device_unlock(&dev->dev); |
| 294 | if (retval) | 294 | if (retval) |
| 295 | break; | 295 | break; |
| 296 | } | 296 | } |
diff --git a/drivers/pci/hotplug/fakephp.c b/drivers/pci/hotplug/fakephp.c index 6151389fd903..0a894efd4b9b 100644 --- a/drivers/pci/hotplug/fakephp.c +++ b/drivers/pci/hotplug/fakephp.c | |||
| @@ -73,7 +73,7 @@ static void legacy_release(struct kobject *kobj) | |||
| 73 | } | 73 | } |
| 74 | 74 | ||
| 75 | static struct kobj_type legacy_ktype = { | 75 | static struct kobj_type legacy_ktype = { |
| 76 | .sysfs_ops = &(struct sysfs_ops){ | 76 | .sysfs_ops = &(const struct sysfs_ops){ |
| 77 | .store = legacy_store, .show = legacy_show | 77 | .store = legacy_store, .show = legacy_show |
| 78 | }, | 78 | }, |
| 79 | .release = &legacy_release, | 79 | .release = &legacy_release, |
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c index 807224ec8351..de296452c957 100644 --- a/drivers/pci/pci-sysfs.c +++ b/drivers/pci/pci-sysfs.c | |||
| @@ -642,6 +642,7 @@ void pci_create_legacy_files(struct pci_bus *b) | |||
| 642 | if (!b->legacy_io) | 642 | if (!b->legacy_io) |
| 643 | goto kzalloc_err; | 643 | goto kzalloc_err; |
| 644 | 644 | ||
| 645 | sysfs_bin_attr_init(b->legacy_io); | ||
| 645 | b->legacy_io->attr.name = "legacy_io"; | 646 | b->legacy_io->attr.name = "legacy_io"; |
| 646 | b->legacy_io->size = 0xffff; | 647 | b->legacy_io->size = 0xffff; |
| 647 | b->legacy_io->attr.mode = S_IRUSR | S_IWUSR; | 648 | b->legacy_io->attr.mode = S_IRUSR | S_IWUSR; |
| @@ -654,6 +655,7 @@ void pci_create_legacy_files(struct pci_bus *b) | |||
| 654 | goto legacy_io_err; | 655 | goto legacy_io_err; |
| 655 | 656 | ||
| 656 | /* Allocated above after the legacy_io struct */ | 657 | /* Allocated above after the legacy_io struct */ |
| 658 | sysfs_bin_attr_init(b->legacy_mem); | ||
| 657 | b->legacy_mem = b->legacy_io + 1; | 659 | b->legacy_mem = b->legacy_io + 1; |
| 658 | b->legacy_mem->attr.name = "legacy_mem"; | 660 | b->legacy_mem->attr.name = "legacy_mem"; |
| 659 | b->legacy_mem->size = 1024*1024; | 661 | b->legacy_mem->size = 1024*1024; |
| @@ -800,6 +802,7 @@ static int pci_create_attr(struct pci_dev *pdev, int num, int write_combine) | |||
| 800 | if (res_attr) { | 802 | if (res_attr) { |
| 801 | char *res_attr_name = (char *)(res_attr + 1); | 803 | char *res_attr_name = (char *)(res_attr + 1); |
| 802 | 804 | ||
| 805 | sysfs_bin_attr_init(res_attr); | ||
| 803 | if (write_combine) { | 806 | if (write_combine) { |
| 804 | pdev->res_attr_wc[num] = res_attr; | 807 | pdev->res_attr_wc[num] = res_attr; |
| 805 | sprintf(res_attr_name, "resource%d_wc", num); | 808 | sprintf(res_attr_name, "resource%d_wc", num); |
| @@ -972,6 +975,7 @@ static int pci_create_capabilities_sysfs(struct pci_dev *dev) | |||
| 972 | if (!attr) | 975 | if (!attr) |
| 973 | return -ENOMEM; | 976 | return -ENOMEM; |
| 974 | 977 | ||
| 978 | sysfs_bin_attr_init(attr); | ||
| 975 | attr->size = dev->vpd->len; | 979 | attr->size = dev->vpd->len; |
| 976 | attr->attr.name = "vpd"; | 980 | attr->attr.name = "vpd"; |
| 977 | attr->attr.mode = S_IRUSR | S_IWUSR; | 981 | attr->attr.mode = S_IRUSR | S_IWUSR; |
| @@ -1038,6 +1042,7 @@ int __must_check pci_create_sysfs_dev_files (struct pci_dev *pdev) | |||
| 1038 | retval = -ENOMEM; | 1042 | retval = -ENOMEM; |
| 1039 | goto err_resource_files; | 1043 | goto err_resource_files; |
| 1040 | } | 1044 | } |
| 1045 | sysfs_bin_attr_init(attr); | ||
| 1041 | attr->size = rom_size; | 1046 | attr->size = rom_size; |
| 1042 | attr->attr.name = "rom"; | 1047 | attr->attr.name = "rom"; |
| 1043 | attr->attr.mode = S_IRUSR; | 1048 | attr->attr.mode = S_IRUSR; |
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 77b493b3d97b..897fa5ccdb78 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
| @@ -2486,7 +2486,7 @@ static int pci_dev_reset(struct pci_dev *dev, int probe) | |||
| 2486 | if (!probe) { | 2486 | if (!probe) { |
| 2487 | pci_block_user_cfg_access(dev); | 2487 | pci_block_user_cfg_access(dev); |
| 2488 | /* block PM suspend, driver probe, etc. */ | 2488 | /* block PM suspend, driver probe, etc. */ |
| 2489 | down(&dev->dev.sem); | 2489 | device_lock(&dev->dev); |
| 2490 | } | 2490 | } |
| 2491 | 2491 | ||
| 2492 | rc = pci_dev_specific_reset(dev, probe); | 2492 | rc = pci_dev_specific_reset(dev, probe); |
| @@ -2508,7 +2508,7 @@ static int pci_dev_reset(struct pci_dev *dev, int probe) | |||
| 2508 | rc = pci_parent_bus_reset(dev, probe); | 2508 | rc = pci_parent_bus_reset(dev, probe); |
| 2509 | done: | 2509 | done: |
| 2510 | if (!probe) { | 2510 | if (!probe) { |
| 2511 | up(&dev->dev.sem); | 2511 | device_unlock(&dev->dev); |
| 2512 | pci_unblock_user_cfg_access(dev); | 2512 | pci_unblock_user_cfg_access(dev); |
| 2513 | } | 2513 | } |
| 2514 | 2514 | ||
diff --git a/drivers/pci/slot.c b/drivers/pci/slot.c index 49c9e6c9779a..f75a44d37fbe 100644 --- a/drivers/pci/slot.c +++ b/drivers/pci/slot.c | |||
| @@ -29,7 +29,7 @@ static ssize_t pci_slot_attr_store(struct kobject *kobj, | |||
| 29 | return attribute->store ? attribute->store(slot, buf, len) : -EIO; | 29 | return attribute->store ? attribute->store(slot, buf, len) : -EIO; |
| 30 | } | 30 | } |
| 31 | 31 | ||
| 32 | static struct sysfs_ops pci_slot_sysfs_ops = { | 32 | static const struct sysfs_ops pci_slot_sysfs_ops = { |
| 33 | .show = pci_slot_attr_show, | 33 | .show = pci_slot_attr_show, |
| 34 | .store = pci_slot_attr_store, | 34 | .store = pci_slot_attr_store, |
| 35 | }; | 35 | }; |
