diff options
author | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-01 19:41:07 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-01 19:41:07 -0500 |
commit | 4549df891a31b9a05b7d183106c09049b79327be (patch) | |
tree | d4dfd0921f0dd0dba2525fd33c0962b26ba5ff1e /include | |
parent | 6b8cc71ab2619a776b02869fd733ac1ead3db4e8 (diff) | |
parent | e17e0f51aeea4e59c7e450a1c0f26605b91c1260 (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: (36 commits)
Driver core: show drivers in /sys/module/
Documentation/driver-model/platform.txt update/rewrite
Driver core: platform_driver_probe(), can save codespace
driver core: Use klist_remove() in device_move()
driver core: Introduce device_move(): move a device to a new parent.
Driver core: make drivers/base/core.c:setup_parent() static
driver core: Introduce device_find_child().
sysfs: sysfs_write_file() writes zero terminated data
cpu topology: consider sysfs_create_group return value
Driver core: Call platform_notify_remove later
ACPI: Change ACPI to use dev_archdata instead of firmware_data
Driver core: add dev_archdata to struct device
Driver core: convert sound core to use struct device
Driver core: change mem class_devices to be real devices
Driver core: convert fb code to use struct device
Driver core: convert firmware code to use struct device
Driver core: convert mmc code to use struct device
Driver core: convert ppdev code to use struct device
Driver core: convert PPP code to use struct device
Driver core: convert cpuid code to use struct device
...
Diffstat (limited to 'include')
37 files changed, 283 insertions, 22 deletions
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index f338e40bd544..fdd10953b2b6 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h | |||
@@ -357,7 +357,7 @@ struct device *acpi_get_physical_device(acpi_handle); | |||
357 | /* helper */ | 357 | /* helper */ |
358 | acpi_handle acpi_get_child(acpi_handle, acpi_integer); | 358 | acpi_handle acpi_get_child(acpi_handle, acpi_integer); |
359 | acpi_handle acpi_get_pci_rootbridge_handle(unsigned int, unsigned int); | 359 | acpi_handle acpi_get_pci_rootbridge_handle(unsigned int, unsigned int); |
360 | #define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)((dev)->firmware_data)) | 360 | #define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)((dev)->archdata.acpi_handle)) |
361 | 361 | ||
362 | #endif /* CONFIG_ACPI */ | 362 | #endif /* CONFIG_ACPI */ |
363 | 363 | ||
diff --git a/include/asm-alpha/device.h b/include/asm-alpha/device.h new file mode 100644 index 000000000000..d8f9872b0e2d --- /dev/null +++ b/include/asm-alpha/device.h | |||
@@ -0,0 +1,7 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/include/asm-arm/device.h b/include/asm-arm/device.h new file mode 100644 index 000000000000..d8f9872b0e2d --- /dev/null +++ b/include/asm-arm/device.h | |||
@@ -0,0 +1,7 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/include/asm-arm26/device.h b/include/asm-arm26/device.h new file mode 100644 index 000000000000..d8f9872b0e2d --- /dev/null +++ b/include/asm-arm26/device.h | |||
@@ -0,0 +1,7 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/include/asm-avr32/device.h b/include/asm-avr32/device.h new file mode 100644 index 000000000000..d8f9872b0e2d --- /dev/null +++ b/include/asm-avr32/device.h | |||
@@ -0,0 +1,7 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/include/asm-cris/device.h b/include/asm-cris/device.h new file mode 100644 index 000000000000..d8f9872b0e2d --- /dev/null +++ b/include/asm-cris/device.h | |||
@@ -0,0 +1,7 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/include/asm-frv/device.h b/include/asm-frv/device.h new file mode 100644 index 000000000000..d8f9872b0e2d --- /dev/null +++ b/include/asm-frv/device.h | |||
@@ -0,0 +1,7 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/include/asm-generic/device.h b/include/asm-generic/device.h new file mode 100644 index 000000000000..c17c9600f220 --- /dev/null +++ b/include/asm-generic/device.h | |||
@@ -0,0 +1,12 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #ifndef _ASM_GENERIC_DEVICE_H | ||
7 | #define _ASM_GENERIC_DEVICE_H | ||
8 | |||
9 | struct dev_archdata { | ||
10 | }; | ||
11 | |||
12 | #endif /* _ASM_GENERIC_DEVICE_H */ | ||
diff --git a/include/asm-h8300/device.h b/include/asm-h8300/device.h new file mode 100644 index 000000000000..d8f9872b0e2d --- /dev/null +++ b/include/asm-h8300/device.h | |||
@@ -0,0 +1,7 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/include/asm-i386/device.h b/include/asm-i386/device.h new file mode 100644 index 000000000000..849604c70e6b --- /dev/null +++ b/include/asm-i386/device.h | |||
@@ -0,0 +1,15 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #ifndef _ASM_I386_DEVICE_H | ||
7 | #define _ASM_I386_DEVICE_H | ||
8 | |||
9 | struct dev_archdata { | ||
10 | #ifdef CONFIG_ACPI | ||
11 | void *acpi_handle; | ||
12 | #endif | ||
13 | }; | ||
14 | |||
15 | #endif /* _ASM_I386_DEVICE_H */ | ||
diff --git a/include/asm-ia64/device.h b/include/asm-ia64/device.h new file mode 100644 index 000000000000..3db6daf7f251 --- /dev/null +++ b/include/asm-ia64/device.h | |||
@@ -0,0 +1,15 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #ifndef _ASM_IA64_DEVICE_H | ||
7 | #define _ASM_IA64_DEVICE_H | ||
8 | |||
9 | struct dev_archdata { | ||
10 | #ifdef CONFIG_ACPI | ||
11 | void *acpi_handle; | ||
12 | #endif | ||
13 | }; | ||
14 | |||
15 | #endif /* _ASM_IA64_DEVICE_H */ | ||
diff --git a/include/asm-m32r/device.h b/include/asm-m32r/device.h new file mode 100644 index 000000000000..d8f9872b0e2d --- /dev/null +++ b/include/asm-m32r/device.h | |||
@@ -0,0 +1,7 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/include/asm-m68k/device.h b/include/asm-m68k/device.h new file mode 100644 index 000000000000..d8f9872b0e2d --- /dev/null +++ b/include/asm-m68k/device.h | |||
@@ -0,0 +1,7 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/include/asm-m68knommu/device.h b/include/asm-m68knommu/device.h new file mode 100644 index 000000000000..d8f9872b0e2d --- /dev/null +++ b/include/asm-m68knommu/device.h | |||
@@ -0,0 +1,7 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/include/asm-mips/device.h b/include/asm-mips/device.h new file mode 100644 index 000000000000..d8f9872b0e2d --- /dev/null +++ b/include/asm-mips/device.h | |||
@@ -0,0 +1,7 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/include/asm-parisc/device.h b/include/asm-parisc/device.h new file mode 100644 index 000000000000..d8f9872b0e2d --- /dev/null +++ b/include/asm-parisc/device.h | |||
@@ -0,0 +1,7 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/include/asm-powerpc/device.h b/include/asm-powerpc/device.h new file mode 100644 index 000000000000..d8f9872b0e2d --- /dev/null +++ b/include/asm-powerpc/device.h | |||
@@ -0,0 +1,7 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/include/asm-ppc/device.h b/include/asm-ppc/device.h new file mode 100644 index 000000000000..d8f9872b0e2d --- /dev/null +++ b/include/asm-ppc/device.h | |||
@@ -0,0 +1,7 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/include/asm-s390/device.h b/include/asm-s390/device.h new file mode 100644 index 000000000000..d8f9872b0e2d --- /dev/null +++ b/include/asm-s390/device.h | |||
@@ -0,0 +1,7 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/include/asm-sh/device.h b/include/asm-sh/device.h new file mode 100644 index 000000000000..d8f9872b0e2d --- /dev/null +++ b/include/asm-sh/device.h | |||
@@ -0,0 +1,7 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/include/asm-sh64/device.h b/include/asm-sh64/device.h new file mode 100644 index 000000000000..d8f9872b0e2d --- /dev/null +++ b/include/asm-sh64/device.h | |||
@@ -0,0 +1,7 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/include/asm-sparc/device.h b/include/asm-sparc/device.h new file mode 100644 index 000000000000..d8f9872b0e2d --- /dev/null +++ b/include/asm-sparc/device.h | |||
@@ -0,0 +1,7 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/include/asm-sparc64/device.h b/include/asm-sparc64/device.h new file mode 100644 index 000000000000..d8f9872b0e2d --- /dev/null +++ b/include/asm-sparc64/device.h | |||
@@ -0,0 +1,7 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/include/asm-um/device.h b/include/asm-um/device.h new file mode 100644 index 000000000000..d8f9872b0e2d --- /dev/null +++ b/include/asm-um/device.h | |||
@@ -0,0 +1,7 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/include/asm-v850/device.h b/include/asm-v850/device.h new file mode 100644 index 000000000000..d8f9872b0e2d --- /dev/null +++ b/include/asm-v850/device.h | |||
@@ -0,0 +1,7 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/include/asm-x86_64/device.h b/include/asm-x86_64/device.h new file mode 100644 index 000000000000..3afa03f33a36 --- /dev/null +++ b/include/asm-x86_64/device.h | |||
@@ -0,0 +1,15 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #ifndef _ASM_X86_64_DEVICE_H | ||
7 | #define _ASM_X86_64_DEVICE_H | ||
8 | |||
9 | struct dev_archdata { | ||
10 | #ifdef CONFIG_ACPI | ||
11 | void *acpi_handle; | ||
12 | #endif | ||
13 | }; | ||
14 | |||
15 | #endif /* _ASM_X86_64_DEVICE_H */ | ||
diff --git a/include/asm-xtensa/device.h b/include/asm-xtensa/device.h new file mode 100644 index 000000000000..d8f9872b0e2d --- /dev/null +++ b/include/asm-xtensa/device.h | |||
@@ -0,0 +1,7 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/include/linux/device.h b/include/linux/device.h index 9d4f6a963936..583a341e016c 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/pm.h> | 21 | #include <linux/pm.h> |
22 | #include <asm/semaphore.h> | 22 | #include <asm/semaphore.h> |
23 | #include <asm/atomic.h> | 23 | #include <asm/atomic.h> |
24 | #include <asm/device.h> | ||
24 | 25 | ||
25 | #define DEVICE_NAME_SIZE 50 | 26 | #define DEVICE_NAME_SIZE 50 |
26 | #define DEVICE_NAME_HALF __stringify(20) /* Less than half to accommodate slop */ | 27 | #define DEVICE_NAME_HALF __stringify(20) /* Less than half to accommodate slop */ |
@@ -42,6 +43,8 @@ struct bus_type { | |||
42 | struct klist klist_devices; | 43 | struct klist klist_devices; |
43 | struct klist klist_drivers; | 44 | struct klist klist_drivers; |
44 | 45 | ||
46 | struct blocking_notifier_head bus_notifier; | ||
47 | |||
45 | struct bus_attribute * bus_attrs; | 48 | struct bus_attribute * bus_attrs; |
46 | struct device_attribute * dev_attrs; | 49 | struct device_attribute * dev_attrs; |
47 | struct driver_attribute * drv_attrs; | 50 | struct driver_attribute * drv_attrs; |
@@ -75,6 +78,29 @@ int __must_check bus_for_each_drv(struct bus_type *bus, | |||
75 | struct device_driver *start, void *data, | 78 | struct device_driver *start, void *data, |
76 | int (*fn)(struct device_driver *, void *)); | 79 | int (*fn)(struct device_driver *, void *)); |
77 | 80 | ||
81 | /* | ||
82 | * Bus notifiers: Get notified of addition/removal of devices | ||
83 | * and binding/unbinding of drivers to devices. | ||
84 | * In the long run, it should be a replacement for the platform | ||
85 | * notify hooks. | ||
86 | */ | ||
87 | struct notifier_block; | ||
88 | |||
89 | extern int bus_register_notifier(struct bus_type *bus, | ||
90 | struct notifier_block *nb); | ||
91 | extern int bus_unregister_notifier(struct bus_type *bus, | ||
92 | struct notifier_block *nb); | ||
93 | |||
94 | /* All 4 notifers below get called with the target struct device * | ||
95 | * as an argument. Note that those functions are likely to be called | ||
96 | * with the device semaphore held in the core, so be careful. | ||
97 | */ | ||
98 | #define BUS_NOTIFY_ADD_DEVICE 0x00000001 /* device added */ | ||
99 | #define BUS_NOTIFY_DEL_DEVICE 0x00000002 /* device removed */ | ||
100 | #define BUS_NOTIFY_BOUND_DRIVER 0x00000003 /* driver bound to device */ | ||
101 | #define BUS_NOTIFY_UNBIND_DRIVER 0x00000004 /* driver about to be | ||
102 | unbound */ | ||
103 | |||
78 | /* driverfs interface for exporting bus attributes */ | 104 | /* driverfs interface for exporting bus attributes */ |
79 | 105 | ||
80 | struct bus_attribute { | 106 | struct bus_attribute { |
@@ -343,8 +369,6 @@ struct device { | |||
343 | void *driver_data; /* data private to the driver */ | 369 | void *driver_data; /* data private to the driver */ |
344 | void *platform_data; /* Platform specific data, device | 370 | void *platform_data; /* Platform specific data, device |
345 | core doesn't touch it */ | 371 | core doesn't touch it */ |
346 | void *firmware_data; /* Firmware specific data (e.g. ACPI, | ||
347 | BIOS data),reserved for device core*/ | ||
348 | struct dev_pm_info power; | 372 | struct dev_pm_info power; |
349 | 373 | ||
350 | u64 *dma_mask; /* dma mask (if dma'able device) */ | 374 | u64 *dma_mask; /* dma mask (if dma'able device) */ |
@@ -358,6 +382,8 @@ struct device { | |||
358 | 382 | ||
359 | struct dma_coherent_mem *dma_mem; /* internal for coherent mem | 383 | struct dma_coherent_mem *dma_mem; /* internal for coherent mem |
360 | override */ | 384 | override */ |
385 | /* arch specific additions */ | ||
386 | struct dev_archdata archdata; | ||
361 | 387 | ||
362 | /* class_device migration path */ | 388 | /* class_device migration path */ |
363 | struct list_head node; | 389 | struct list_head node; |
@@ -395,7 +421,10 @@ extern int __must_check device_add(struct device * dev); | |||
395 | extern void device_del(struct device * dev); | 421 | extern void device_del(struct device * dev); |
396 | extern int device_for_each_child(struct device *, void *, | 422 | extern int device_for_each_child(struct device *, void *, |
397 | int (*fn)(struct device *, void *)); | 423 | int (*fn)(struct device *, void *)); |
424 | extern struct device *device_find_child(struct device *, void *data, | ||
425 | int (*match)(struct device *, void *)); | ||
398 | extern int device_rename(struct device *dev, char *new_name); | 426 | extern int device_rename(struct device *dev, char *new_name); |
427 | extern int device_move(struct device *dev, struct device *new_parent); | ||
399 | 428 | ||
400 | /* | 429 | /* |
401 | * Manual binding of a device to driver. See drivers/base/bus.c | 430 | * Manual binding of a device to driver. See drivers/base/bus.c |
@@ -415,8 +444,6 @@ extern struct device *device_create(struct class *cls, struct device *parent, | |||
415 | __attribute__((format(printf,4,5))); | 444 | __attribute__((format(printf,4,5))); |
416 | extern void device_destroy(struct class *cls, dev_t devt); | 445 | extern void device_destroy(struct class *cls, dev_t devt); |
417 | 446 | ||
418 | extern int virtual_device_parent(struct device *dev); | ||
419 | |||
420 | /* | 447 | /* |
421 | * Platform "fixup" functions - allow the platform to have their say | 448 | * Platform "fixup" functions - allow the platform to have their say |
422 | * about devices and actions that the general device layer doesn't | 449 | * about devices and actions that the general device layer doesn't |
diff --git a/include/linux/fb.h b/include/linux/fb.h index 3e69241e6a81..fa23e0671bb3 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
@@ -774,8 +774,8 @@ struct fb_info { | |||
774 | #endif | 774 | #endif |
775 | 775 | ||
776 | struct fb_ops *fbops; | 776 | struct fb_ops *fbops; |
777 | struct device *device; | 777 | struct device *device; /* This is the parent */ |
778 | struct class_device *class_device; /* sysfs per device attrs */ | 778 | struct device *dev; /* This is this fb device */ |
779 | int class_flag; /* private sysfs flags */ | 779 | int class_flag; /* private sysfs flags */ |
780 | #ifdef CONFIG_FB_TILEBLITTING | 780 | #ifdef CONFIG_FB_TILEBLITTING |
781 | struct fb_tile_ops *tileops; /* Tile Blitting */ | 781 | struct fb_tile_ops *tileops; /* Tile Blitting */ |
@@ -910,8 +910,8 @@ static inline void __fb_pad_aligned_buffer(u8 *dst, u32 d_pitch, | |||
910 | /* drivers/video/fbsysfs.c */ | 910 | /* drivers/video/fbsysfs.c */ |
911 | extern struct fb_info *framebuffer_alloc(size_t size, struct device *dev); | 911 | extern struct fb_info *framebuffer_alloc(size_t size, struct device *dev); |
912 | extern void framebuffer_release(struct fb_info *info); | 912 | extern void framebuffer_release(struct fb_info *info); |
913 | extern int fb_init_class_device(struct fb_info *fb_info); | 913 | extern int fb_init_device(struct fb_info *fb_info); |
914 | extern void fb_cleanup_class_device(struct fb_info *head); | 914 | extern void fb_cleanup_device(struct fb_info *head); |
915 | extern void fb_bl_default_curve(struct fb_info *fb_info, u8 off, u8 min, u8 max); | 915 | extern void fb_bl_default_curve(struct fb_info *fb_info, u8 off, u8 min, u8 max); |
916 | 916 | ||
917 | /* drivers/video/fbmon.c */ | 917 | /* drivers/video/fbmon.c */ |
diff --git a/include/linux/kobject.h b/include/linux/kobject.h index bcd9cd173c2c..d1c8d28fa92e 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h | |||
@@ -47,6 +47,7 @@ enum kobject_action { | |||
47 | KOBJ_UMOUNT = (__force kobject_action_t) 0x05, /* umount event for block devices (broken) */ | 47 | KOBJ_UMOUNT = (__force kobject_action_t) 0x05, /* umount event for block devices (broken) */ |
48 | KOBJ_OFFLINE = (__force kobject_action_t) 0x06, /* device offline */ | 48 | KOBJ_OFFLINE = (__force kobject_action_t) 0x06, /* device offline */ |
49 | KOBJ_ONLINE = (__force kobject_action_t) 0x07, /* device online */ | 49 | KOBJ_ONLINE = (__force kobject_action_t) 0x07, /* device online */ |
50 | KOBJ_MOVE = (__force kobject_action_t) 0x08, /* device move */ | ||
50 | }; | 51 | }; |
51 | 52 | ||
52 | struct kobject { | 53 | struct kobject { |
@@ -76,6 +77,7 @@ extern int __must_check kobject_add(struct kobject *); | |||
76 | extern void kobject_del(struct kobject *); | 77 | extern void kobject_del(struct kobject *); |
77 | 78 | ||
78 | extern int __must_check kobject_rename(struct kobject *, const char *new_name); | 79 | extern int __must_check kobject_rename(struct kobject *, const char *new_name); |
80 | extern int __must_check kobject_move(struct kobject *, struct kobject *); | ||
79 | 81 | ||
80 | extern int __must_check kobject_register(struct kobject *); | 82 | extern int __must_check kobject_register(struct kobject *); |
81 | extern void kobject_unregister(struct kobject *); | 83 | extern void kobject_unregister(struct kobject *); |
@@ -264,6 +266,8 @@ extern int __must_check subsys_create_file(struct subsystem * , | |||
264 | 266 | ||
265 | #if defined(CONFIG_HOTPLUG) | 267 | #if defined(CONFIG_HOTPLUG) |
266 | void kobject_uevent(struct kobject *kobj, enum kobject_action action); | 268 | void kobject_uevent(struct kobject *kobj, enum kobject_action action); |
269 | void kobject_uevent_env(struct kobject *kobj, enum kobject_action action, | ||
270 | char *envp[]); | ||
267 | 271 | ||
268 | int add_uevent_var(char **envp, int num_envp, int *cur_index, | 272 | int add_uevent_var(char **envp, int num_envp, int *cur_index, |
269 | char *buffer, int buffer_size, int *cur_len, | 273 | char *buffer, int buffer_size, int *cur_len, |
@@ -271,6 +275,10 @@ int add_uevent_var(char **envp, int num_envp, int *cur_index, | |||
271 | __attribute__((format (printf, 7, 8))); | 275 | __attribute__((format (printf, 7, 8))); |
272 | #else | 276 | #else |
273 | static inline void kobject_uevent(struct kobject *kobj, enum kobject_action action) { } | 277 | static inline void kobject_uevent(struct kobject *kobj, enum kobject_action action) { } |
278 | static inline void kobject_uevent_env(struct kobject *kobj, | ||
279 | enum kobject_action action, | ||
280 | char *envp[]) | ||
281 | { } | ||
274 | 282 | ||
275 | static inline int add_uevent_var(char **envp, int num_envp, int *cur_index, | 283 | static inline int add_uevent_var(char **envp, int num_envp, int *cur_index, |
276 | char *buffer, int buffer_size, int *cur_len, | 284 | char *buffer, int buffer_size, int *cur_len, |
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h index b03cfb91e228..326da7d500c7 100644 --- a/include/linux/miscdevice.h +++ b/include/linux/miscdevice.h | |||
@@ -31,15 +31,14 @@ | |||
31 | #define HPET_MINOR 228 | 31 | #define HPET_MINOR 228 |
32 | 32 | ||
33 | struct device; | 33 | struct device; |
34 | struct class_device; | ||
35 | 34 | ||
36 | struct miscdevice { | 35 | struct miscdevice { |
37 | int minor; | 36 | int minor; |
38 | const char *name; | 37 | const char *name; |
39 | const struct file_operations *fops; | 38 | const struct file_operations *fops; |
40 | struct list_head list; | 39 | struct list_head list; |
41 | struct device *dev; | 40 | struct device *parent; |
42 | struct class_device *class; | 41 | struct device *this_device; |
43 | }; | 42 | }; |
44 | 43 | ||
45 | extern int misc_register(struct miscdevice * misc); | 44 | extern int misc_register(struct miscdevice * misc); |
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 587264a58d56..528e7d3fecb1 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h | |||
@@ -74,8 +74,8 @@ struct mmc_card; | |||
74 | struct device; | 74 | struct device; |
75 | 75 | ||
76 | struct mmc_host { | 76 | struct mmc_host { |
77 | struct device *dev; | 77 | struct device *parent; |
78 | struct class_device class_dev; | 78 | struct device class_dev; |
79 | int index; | 79 | int index; |
80 | const struct mmc_host_ops *ops; | 80 | const struct mmc_host_ops *ops; |
81 | unsigned int f_min; | 81 | unsigned int f_min; |
@@ -125,8 +125,8 @@ static inline void *mmc_priv(struct mmc_host *host) | |||
125 | return (void *)host->private; | 125 | return (void *)host->private; |
126 | } | 126 | } |
127 | 127 | ||
128 | #define mmc_dev(x) ((x)->dev) | 128 | #define mmc_dev(x) ((x)->parent) |
129 | #define mmc_hostname(x) ((x)->class_dev.class_id) | 129 | #define mmc_hostname(x) ((x)->class_dev.bus_id) |
130 | 130 | ||
131 | extern int mmc_suspend_host(struct mmc_host *, pm_message_t); | 131 | extern int mmc_suspend_host(struct mmc_host *, pm_message_t); |
132 | extern int mmc_resume_host(struct mmc_host *); | 132 | extern int mmc_resume_host(struct mmc_host *); |
diff --git a/include/linux/module.h b/include/linux/module.h index d1d00ce8f4ed..9258ffd8a7f0 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -264,6 +264,7 @@ struct module | |||
264 | struct module_attribute *modinfo_attrs; | 264 | struct module_attribute *modinfo_attrs; |
265 | const char *version; | 265 | const char *version; |
266 | const char *srcversion; | 266 | const char *srcversion; |
267 | struct kobject *drivers_dir; | ||
267 | 268 | ||
268 | /* Exported symbols */ | 269 | /* Exported symbols */ |
269 | const struct kernel_symbol *syms; | 270 | const struct kernel_symbol *syms; |
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index 29cd6dee13db..20f47b81d3fa 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h | |||
@@ -58,6 +58,12 @@ struct platform_driver { | |||
58 | extern int platform_driver_register(struct platform_driver *); | 58 | extern int platform_driver_register(struct platform_driver *); |
59 | extern void platform_driver_unregister(struct platform_driver *); | 59 | extern void platform_driver_unregister(struct platform_driver *); |
60 | 60 | ||
61 | /* non-hotpluggable platform devices may use this so that probe() and | ||
62 | * its support may live in __init sections, conserving runtime memory. | ||
63 | */ | ||
64 | extern int platform_driver_probe(struct platform_driver *driver, | ||
65 | int (*probe)(struct platform_device *)); | ||
66 | |||
61 | #define platform_get_drvdata(_dev) dev_get_drvdata(&(_dev)->dev) | 67 | #define platform_get_drvdata(_dev) dev_get_drvdata(&(_dev)->dev) |
62 | #define platform_set_drvdata(_dev,data) dev_set_drvdata(&(_dev)->dev, (data)) | 68 | #define platform_set_drvdata(_dev,data) dev_set_drvdata(&(_dev)->dev, (data)) |
63 | 69 | ||
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index 6d5c43d31dec..2129d1b6c874 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h | |||
@@ -97,6 +97,9 @@ extern int __must_check | |||
97 | sysfs_rename_dir(struct kobject *, const char *new_name); | 97 | sysfs_rename_dir(struct kobject *, const char *new_name); |
98 | 98 | ||
99 | extern int __must_check | 99 | extern int __must_check |
100 | sysfs_move_dir(struct kobject *, struct kobject *); | ||
101 | |||
102 | extern int __must_check | ||
100 | sysfs_create_file(struct kobject *, const struct attribute *); | 103 | sysfs_create_file(struct kobject *, const struct attribute *); |
101 | 104 | ||
102 | extern int __must_check | 105 | extern int __must_check |
@@ -142,6 +145,11 @@ static inline int sysfs_rename_dir(struct kobject * k, const char *new_name) | |||
142 | return 0; | 145 | return 0; |
143 | } | 146 | } |
144 | 147 | ||
148 | static inline int sysfs_move_dir(struct kobject * k, struct kobject * new_parent) | ||
149 | { | ||
150 | return 0; | ||
151 | } | ||
152 | |||
145 | static inline int sysfs_create_file(struct kobject * k, const struct attribute * a) | 153 | static inline int sysfs_create_file(struct kobject * k, const struct attribute * a) |
146 | { | 154 | { |
147 | return 0; | 155 | return 0; |
diff --git a/include/linux/tty.h b/include/linux/tty.h index 44091c0db0b4..65321f911c1e 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -276,9 +276,8 @@ extern int tty_register_ldisc(int disc, struct tty_ldisc *new_ldisc); | |||
276 | extern int tty_unregister_ldisc(int disc); | 276 | extern int tty_unregister_ldisc(int disc); |
277 | extern int tty_register_driver(struct tty_driver *driver); | 277 | extern int tty_register_driver(struct tty_driver *driver); |
278 | extern int tty_unregister_driver(struct tty_driver *driver); | 278 | extern int tty_unregister_driver(struct tty_driver *driver); |
279 | extern struct class_device *tty_register_device(struct tty_driver *driver, | 279 | extern struct device *tty_register_device(struct tty_driver *driver, |
280 | unsigned index, | 280 | unsigned index, struct device *dev); |
281 | struct device *dev); | ||
282 | extern void tty_unregister_device(struct tty_driver *driver, unsigned index); | 281 | extern void tty_unregister_device(struct tty_driver *driver, unsigned index); |
283 | extern int tty_read_raw_data(struct tty_struct *tty, unsigned char *bufp, | 282 | extern int tty_read_raw_data(struct tty_struct *tty, unsigned char *bufp, |
284 | int buflen); | 283 | int buflen); |
diff --git a/include/sound/core.h b/include/sound/core.h index fa1ca0127bab..a994bea09cd6 100644 --- a/include/sound/core.h +++ b/include/sound/core.h | |||
@@ -132,6 +132,7 @@ struct snd_card { | |||
132 | int shutdown; /* this card is going down */ | 132 | int shutdown; /* this card is going down */ |
133 | int free_on_last_close; /* free in context of file_release */ | 133 | int free_on_last_close; /* free in context of file_release */ |
134 | wait_queue_head_t shutdown_sleep; | 134 | wait_queue_head_t shutdown_sleep; |
135 | struct device *parent; | ||
135 | struct device *dev; | 136 | struct device *dev; |
136 | 137 | ||
137 | #ifdef CONFIG_PM | 138 | #ifdef CONFIG_PM |
@@ -187,13 +188,14 @@ struct snd_minor { | |||
187 | int device; /* device number */ | 188 | int device; /* device number */ |
188 | const struct file_operations *f_ops; /* file operations */ | 189 | const struct file_operations *f_ops; /* file operations */ |
189 | void *private_data; /* private data for f_ops->open */ | 190 | void *private_data; /* private data for f_ops->open */ |
190 | struct class_device *class_dev; /* class device for sysfs */ | 191 | struct device *dev; /* device for sysfs */ |
191 | }; | 192 | }; |
192 | 193 | ||
193 | /* sound.c */ | 194 | /* sound.c */ |
194 | 195 | ||
195 | extern int snd_major; | 196 | extern int snd_major; |
196 | extern int snd_ecards_limit; | 197 | extern int snd_ecards_limit; |
198 | extern struct class *sound_class; | ||
197 | 199 | ||
198 | void snd_request_card(int card); | 200 | void snd_request_card(int card); |
199 | 201 | ||
@@ -203,7 +205,7 @@ int snd_register_device(int type, struct snd_card *card, int dev, | |||
203 | int snd_unregister_device(int type, struct snd_card *card, int dev); | 205 | int snd_unregister_device(int type, struct snd_card *card, int dev); |
204 | void *snd_lookup_minor_data(unsigned int minor, int type); | 206 | void *snd_lookup_minor_data(unsigned int minor, int type); |
205 | int snd_add_device_sysfs_file(int type, struct snd_card *card, int dev, | 207 | int snd_add_device_sysfs_file(int type, struct snd_card *card, int dev, |
206 | const struct class_device_attribute *attr); | 208 | struct device_attribute *attr); |
207 | 209 | ||
208 | #ifdef CONFIG_SND_OSSEMUL | 210 | #ifdef CONFIG_SND_OSSEMUL |
209 | int snd_register_oss_device(int type, struct snd_card *card, int dev, | 211 | int snd_register_oss_device(int type, struct snd_card *card, int dev, |
@@ -255,7 +257,7 @@ int snd_card_file_add(struct snd_card *card, struct file *file); | |||
255 | int snd_card_file_remove(struct snd_card *card, struct file *file); | 257 | int snd_card_file_remove(struct snd_card *card, struct file *file); |
256 | 258 | ||
257 | #ifndef snd_card_set_dev | 259 | #ifndef snd_card_set_dev |
258 | #define snd_card_set_dev(card,devptr) ((card)->dev = (devptr)) | 260 | #define snd_card_set_dev(card,devptr) ((card)->parent = (devptr)) |
259 | #endif | 261 | #endif |
260 | 262 | ||
261 | /* device.c */ | 263 | /* device.c */ |