diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-12 16:40:20 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-12 16:40:20 -0400 |
commit | dc690d8ef842b464f1c429a376ca16cb8dbee6ae (patch) | |
tree | 77955849af5a15755f5e55e24ae4b9c520583a72 /drivers/pci/pci-sysfs.c | |
parent | 57399ec9077a4b962b81037aaa279fab52f5e989 (diff) | |
parent | 91a6902958f052358899f58683d44e36228d85c2 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6: (61 commits)
sysfs: add parameter "struct bin_attribute *" in .read/.write methods for sysfs binary attributes
sysfs: make directory dentries and inodes reclaimable
sysfs: implement sysfs_get_dentry()
sysfs: move sysfs_drop_dentry() to dir.c and make it static
sysfs: restructure add/remove paths and fix inode update
sysfs: use sysfs_mutex to protect the sysfs_dirent tree
sysfs: consolidate sysfs spinlocks
sysfs: make kobj point to sysfs_dirent instead of dentry
sysfs: implement sysfs_find_dirent() and sysfs_get_dirent()
sysfs: implement SYSFS_FLAG_REMOVED flag
sysfs: rename sysfs_dirent->s_type to s_flags and make room for flags
sysfs: make sysfs_drop_dentry() access inodes using ilookup()
sysfs: Fix oops in sysfs_drop_dentry on x86_64
sysfs: use singly-linked list for sysfs_dirent tree
sysfs: slim down sysfs_dirent->s_active
sysfs: move s_active functions to fs/sysfs/dir.c
sysfs: fix root sysfs_dirent -> root dentry association
sysfs: use iget_locked() instead of new_inode()
sysfs: reorganize sysfs_new_indoe() and sysfs_create()
sysfs: fix parent refcounting during rename and move
...
Diffstat (limited to 'drivers/pci/pci-sysfs.c')
-rw-r--r-- | drivers/pci/pci-sysfs.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c index 284e83a527f9..6543cbe83be5 100644 --- a/drivers/pci/pci-sysfs.c +++ b/drivers/pci/pci-sysfs.c | |||
@@ -213,7 +213,8 @@ struct device_attribute pci_dev_attrs[] = { | |||
213 | }; | 213 | }; |
214 | 214 | ||
215 | static ssize_t | 215 | static ssize_t |
216 | pci_read_config(struct kobject *kobj, char *buf, loff_t off, size_t count) | 216 | pci_read_config(struct kobject *kobj, struct bin_attribute *bin_attr, |
217 | char *buf, loff_t off, size_t count) | ||
217 | { | 218 | { |
218 | struct pci_dev *dev = to_pci_dev(container_of(kobj,struct device,kobj)); | 219 | struct pci_dev *dev = to_pci_dev(container_of(kobj,struct device,kobj)); |
219 | unsigned int size = 64; | 220 | unsigned int size = 64; |
@@ -285,7 +286,8 @@ pci_read_config(struct kobject *kobj, char *buf, loff_t off, size_t count) | |||
285 | } | 286 | } |
286 | 287 | ||
287 | static ssize_t | 288 | static ssize_t |
288 | pci_write_config(struct kobject *kobj, char *buf, loff_t off, size_t count) | 289 | pci_write_config(struct kobject *kobj, struct bin_attribute *bin_attr, |
290 | char *buf, loff_t off, size_t count) | ||
289 | { | 291 | { |
290 | struct pci_dev *dev = to_pci_dev(container_of(kobj,struct device,kobj)); | 292 | struct pci_dev *dev = to_pci_dev(container_of(kobj,struct device,kobj)); |
291 | unsigned int size = count; | 293 | unsigned int size = count; |
@@ -352,7 +354,8 @@ pci_write_config(struct kobject *kobj, char *buf, loff_t off, size_t count) | |||
352 | * callback routine (pci_legacy_read). | 354 | * callback routine (pci_legacy_read). |
353 | */ | 355 | */ |
354 | ssize_t | 356 | ssize_t |
355 | pci_read_legacy_io(struct kobject *kobj, char *buf, loff_t off, size_t count) | 357 | pci_read_legacy_io(struct kobject *kobj, struct bin_attribute *bin_attr, |
358 | char *buf, loff_t off, size_t count) | ||
356 | { | 359 | { |
357 | struct pci_bus *bus = to_pci_bus(container_of(kobj, | 360 | struct pci_bus *bus = to_pci_bus(container_of(kobj, |
358 | struct class_device, | 361 | struct class_device, |
@@ -376,7 +379,8 @@ pci_read_legacy_io(struct kobject *kobj, char *buf, loff_t off, size_t count) | |||
376 | * callback routine (pci_legacy_write). | 379 | * callback routine (pci_legacy_write). |
377 | */ | 380 | */ |
378 | ssize_t | 381 | ssize_t |
379 | pci_write_legacy_io(struct kobject *kobj, char *buf, loff_t off, size_t count) | 382 | pci_write_legacy_io(struct kobject *kobj, struct bin_attribute *bin_attr, |
383 | char *buf, loff_t off, size_t count) | ||
380 | { | 384 | { |
381 | struct pci_bus *bus = to_pci_bus(container_of(kobj, | 385 | struct pci_bus *bus = to_pci_bus(container_of(kobj, |
382 | struct class_device, | 386 | struct class_device, |
@@ -499,7 +503,6 @@ static int pci_create_resource_files(struct pci_dev *pdev) | |||
499 | sprintf(res_attr_name, "resource%d", i); | 503 | sprintf(res_attr_name, "resource%d", i); |
500 | res_attr->attr.name = res_attr_name; | 504 | res_attr->attr.name = res_attr_name; |
501 | res_attr->attr.mode = S_IRUSR | S_IWUSR; | 505 | res_attr->attr.mode = S_IRUSR | S_IWUSR; |
502 | res_attr->attr.owner = THIS_MODULE; | ||
503 | res_attr->size = pci_resource_len(pdev, i); | 506 | res_attr->size = pci_resource_len(pdev, i); |
504 | res_attr->mmap = pci_mmap_resource; | 507 | res_attr->mmap = pci_mmap_resource; |
505 | res_attr->private = &pdev->resource[i]; | 508 | res_attr->private = &pdev->resource[i]; |
@@ -529,7 +532,8 @@ static inline void pci_remove_resource_files(struct pci_dev *dev) { return; } | |||
529 | * writing anything except 0 enables it | 532 | * writing anything except 0 enables it |
530 | */ | 533 | */ |
531 | static ssize_t | 534 | static ssize_t |
532 | pci_write_rom(struct kobject *kobj, char *buf, loff_t off, size_t count) | 535 | pci_write_rom(struct kobject *kobj, struct bin_attribute *bin_attr, |
536 | char *buf, loff_t off, size_t count) | ||
533 | { | 537 | { |
534 | struct pci_dev *pdev = to_pci_dev(container_of(kobj, struct device, kobj)); | 538 | struct pci_dev *pdev = to_pci_dev(container_of(kobj, struct device, kobj)); |
535 | 539 | ||
@@ -552,7 +556,8 @@ pci_write_rom(struct kobject *kobj, char *buf, loff_t off, size_t count) | |||
552 | * device corresponding to @kobj. | 556 | * device corresponding to @kobj. |
553 | */ | 557 | */ |
554 | static ssize_t | 558 | static ssize_t |
555 | pci_read_rom(struct kobject *kobj, char *buf, loff_t off, size_t count) | 559 | pci_read_rom(struct kobject *kobj, struct bin_attribute *bin_attr, |
560 | char *buf, loff_t off, size_t count) | ||
556 | { | 561 | { |
557 | struct pci_dev *pdev = to_pci_dev(container_of(kobj, struct device, kobj)); | 562 | struct pci_dev *pdev = to_pci_dev(container_of(kobj, struct device, kobj)); |
558 | void __iomem *rom; | 563 | void __iomem *rom; |
@@ -582,7 +587,6 @@ static struct bin_attribute pci_config_attr = { | |||
582 | .attr = { | 587 | .attr = { |
583 | .name = "config", | 588 | .name = "config", |
584 | .mode = S_IRUGO | S_IWUSR, | 589 | .mode = S_IRUGO | S_IWUSR, |
585 | .owner = THIS_MODULE, | ||
586 | }, | 590 | }, |
587 | .size = 256, | 591 | .size = 256, |
588 | .read = pci_read_config, | 592 | .read = pci_read_config, |
@@ -593,7 +597,6 @@ static struct bin_attribute pcie_config_attr = { | |||
593 | .attr = { | 597 | .attr = { |
594 | .name = "config", | 598 | .name = "config", |
595 | .mode = S_IRUGO | S_IWUSR, | 599 | .mode = S_IRUGO | S_IWUSR, |
596 | .owner = THIS_MODULE, | ||
597 | }, | 600 | }, |
598 | .size = 4096, | 601 | .size = 4096, |
599 | .read = pci_read_config, | 602 | .read = pci_read_config, |
@@ -628,7 +631,6 @@ int __must_check pci_create_sysfs_dev_files (struct pci_dev *pdev) | |||
628 | rom_attr->size = pci_resource_len(pdev, PCI_ROM_RESOURCE); | 631 | rom_attr->size = pci_resource_len(pdev, PCI_ROM_RESOURCE); |
629 | rom_attr->attr.name = "rom"; | 632 | rom_attr->attr.name = "rom"; |
630 | rom_attr->attr.mode = S_IRUSR; | 633 | rom_attr->attr.mode = S_IRUSR; |
631 | rom_attr->attr.owner = THIS_MODULE; | ||
632 | rom_attr->read = pci_read_rom; | 634 | rom_attr->read = pci_read_rom; |
633 | rom_attr->write = pci_write_rom; | 635 | rom_attr->write = pci_write_rom; |
634 | retval = sysfs_create_bin_file(&pdev->dev.kobj, rom_attr); | 636 | retval = sysfs_create_bin_file(&pdev->dev.kobj, rom_attr); |