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 | |
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')
-rw-r--r-- | drivers/pci/hotplug/acpiphp_ibm.c | 7 | ||||
-rw-r--r-- | drivers/pci/pci-sysfs.c | 22 | ||||
-rw-r--r-- | drivers/pci/probe.c | 2 |
3 files changed, 16 insertions, 15 deletions
diff --git a/drivers/pci/hotplug/acpiphp_ibm.c b/drivers/pci/hotplug/acpiphp_ibm.c index e7322c25d377..70db38c0ced9 100644 --- a/drivers/pci/hotplug/acpiphp_ibm.c +++ b/drivers/pci/hotplug/acpiphp_ibm.c | |||
@@ -106,7 +106,8 @@ static int ibm_get_attention_status(struct hotplug_slot *slot, u8 *status); | |||
106 | static void ibm_handle_events(acpi_handle handle, u32 event, void *context); | 106 | static void ibm_handle_events(acpi_handle handle, u32 event, void *context); |
107 | static int ibm_get_table_from_acpi(char **bufp); | 107 | static int ibm_get_table_from_acpi(char **bufp); |
108 | static ssize_t ibm_read_apci_table(struct kobject *kobj, | 108 | static ssize_t ibm_read_apci_table(struct kobject *kobj, |
109 | char *buffer, loff_t pos, size_t size); | 109 | struct bin_attribute *bin_attr, |
110 | char *buffer, loff_t pos, size_t size); | ||
110 | static acpi_status __init ibm_find_acpi_device(acpi_handle handle, | 111 | static acpi_status __init ibm_find_acpi_device(acpi_handle handle, |
111 | u32 lvl, void *context, void **rv); | 112 | u32 lvl, void *context, void **rv); |
112 | static int __init ibm_acpiphp_init(void); | 113 | static int __init ibm_acpiphp_init(void); |
@@ -117,7 +118,6 @@ static struct notification ibm_note; | |||
117 | static struct bin_attribute ibm_apci_table_attr = { | 118 | static struct bin_attribute ibm_apci_table_attr = { |
118 | .attr = { | 119 | .attr = { |
119 | .name = "apci_table", | 120 | .name = "apci_table", |
120 | .owner = THIS_MODULE, | ||
121 | .mode = S_IRUGO, | 121 | .mode = S_IRUGO, |
122 | }, | 122 | }, |
123 | .read = ibm_read_apci_table, | 123 | .read = ibm_read_apci_table, |
@@ -358,7 +358,8 @@ read_table_done: | |||
358 | * our solution is to only allow reading the table in all at once | 358 | * our solution is to only allow reading the table in all at once |
359 | **/ | 359 | **/ |
360 | static ssize_t ibm_read_apci_table(struct kobject *kobj, | 360 | static ssize_t ibm_read_apci_table(struct kobject *kobj, |
361 | char *buffer, loff_t pos, size_t size) | 361 | struct bin_attribute *bin_attr, |
362 | char *buffer, loff_t pos, size_t size) | ||
362 | { | 363 | { |
363 | int bytes_read = -EINVAL; | 364 | int bytes_read = -EINVAL; |
364 | char *table = NULL; | 365 | char *table = NULL; |
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); |
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index e48fcf089621..08783bd381f5 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c | |||
@@ -39,7 +39,6 @@ static void pci_create_legacy_files(struct pci_bus *b) | |||
39 | b->legacy_io->attr.name = "legacy_io"; | 39 | b->legacy_io->attr.name = "legacy_io"; |
40 | b->legacy_io->size = 0xffff; | 40 | b->legacy_io->size = 0xffff; |
41 | b->legacy_io->attr.mode = S_IRUSR | S_IWUSR; | 41 | b->legacy_io->attr.mode = S_IRUSR | S_IWUSR; |
42 | b->legacy_io->attr.owner = THIS_MODULE; | ||
43 | b->legacy_io->read = pci_read_legacy_io; | 42 | b->legacy_io->read = pci_read_legacy_io; |
44 | b->legacy_io->write = pci_write_legacy_io; | 43 | b->legacy_io->write = pci_write_legacy_io; |
45 | class_device_create_bin_file(&b->class_dev, b->legacy_io); | 44 | class_device_create_bin_file(&b->class_dev, b->legacy_io); |
@@ -49,7 +48,6 @@ static void pci_create_legacy_files(struct pci_bus *b) | |||
49 | b->legacy_mem->attr.name = "legacy_mem"; | 48 | b->legacy_mem->attr.name = "legacy_mem"; |
50 | b->legacy_mem->size = 1024*1024; | 49 | b->legacy_mem->size = 1024*1024; |
51 | b->legacy_mem->attr.mode = S_IRUSR | S_IWUSR; | 50 | b->legacy_mem->attr.mode = S_IRUSR | S_IWUSR; |
52 | b->legacy_mem->attr.owner = THIS_MODULE; | ||
53 | b->legacy_mem->mmap = pci_mmap_legacy_mem; | 51 | b->legacy_mem->mmap = pci_mmap_legacy_mem; |
54 | class_device_create_bin_file(&b->class_dev, b->legacy_mem); | 52 | class_device_create_bin_file(&b->class_dev, b->legacy_mem); |
55 | } | 53 | } |