aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci-sysfs.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-03-08 13:17:20 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-03-08 13:17:20 -0500
commite10154189f001b6428a83f58b03a27954f0f8022 (patch)
tree30b4ac5760c5d310e9cc2cbf8fc4b9c6f9d0e369 /drivers/pci/pci-sysfs.c
parentd4bab1b091be4a91a7363118c9ede3cc9a7fefd4 (diff)
parent410c17651998944630a95fbb286a50362de2dbb0 (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/pci-sysfs.c')
-rw-r--r--drivers/pci/pci-sysfs.c5
1 files changed, 5 insertions, 0 deletions
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;