Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Driver Core: Add platform device arch data V3

Allow architecture specific data in struct platform_device V3.

With this patch struct pdev_archdata is added to struct
platform_device, similar to struct dev_archdata in found in
struct device. Useful for architecture code that needs to
keep extra data associated with each platform device.

Struct pdev_archdata is different from dev.platform_data, the
convention is that dev.platform_data points to driver-specific
data. It may or may not be required by the driver. The format
of this depends on driver but is the same across architectures.

The structure pdev_archdata is a place for architecture specific
data. This data is handled by architecture specific code (for
example runtime PM), and since it is architecture specific it
should _never_ be touched by device driver code. Exactly like
struct dev_archdata but for platform devices.

[rjw: This change is for power management mostly and that's why it
goes through the suspend tree.]

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Acked-by: Kevin Hilman <khilman@deeprootsystems.com>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>

authored by

Magnus Damm and committed by
Rafael J. Wysocki
d7aacadd aea1f796

+24
+3
arch/arm/include/asm/device.h
··· 12 12 #endif 13 13 }; 14 14 15 + struct pdev_archdata { 16 + }; 17 + 15 18 #endif
+3
arch/ia64/include/asm/device.h
··· 15 15 #endif 16 16 }; 17 17 18 + struct pdev_archdata { 19 + }; 20 + 18 21 #endif /* _ASM_IA64_DEVICE_H */
+3
arch/microblaze/include/asm/device.h
··· 16 16 struct device_node *of_node; 17 17 }; 18 18 19 + struct pdev_archdata { 20 + }; 21 + 19 22 #endif /* _ASM_MICROBLAZE_DEVICE_H */ 20 23 21 24
+3
arch/powerpc/include/asm/device.h
··· 30 30 return ad->of_node; 31 31 } 32 32 33 + struct pdev_archdata { 34 + }; 35 + 33 36 #endif /* _ASM_POWERPC_DEVICE_H */
+3
arch/sparc/include/asm/device.h
··· 32 32 return ad->prom_node; 33 33 } 34 34 35 + struct pdev_archdata { 36 + }; 37 + 35 38 #endif /* _ASM_SPARC_DEVICE_H */
+3
arch/x86/include/asm/device.h
··· 13 13 #endif 14 14 }; 15 15 16 + struct pdev_archdata { 17 + }; 18 + 16 19 #endif /* _ASM_X86_DEVICE_H */
+3
include/asm-generic/device.h
··· 9 9 struct dev_archdata { 10 10 }; 11 11 12 + struct pdev_archdata { 13 + }; 14 + 12 15 #endif /* _ASM_GENERIC_DEVICE_H */
+3
include/linux/platform_device.h
··· 22 22 struct resource * resource; 23 23 24 24 struct platform_device_id *id_entry; 25 + 26 + /* arch specific additions */ 27 + struct pdev_archdata archdata; 25 28 }; 26 29 27 30 #define platform_get_device_id(pdev) ((pdev)->id_entry)