diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-26 01:59:39 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-26 01:59:39 -0400 |
commit | 184475029a724b6b900d88fc3a5f462a6107d5af (patch) | |
tree | 408320b46df221a2424bf94282b1b8e5b7aff7a1 /drivers/base | |
parent | 3b76eefe0f970c2e19f165d4a1650abc523d10bc (diff) | |
parent | f1f4ee01c0d3dce0e3aa7d04e4332677db7af478 (diff) |
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (99 commits)
drivers/virt: add missing linux/interrupt.h to fsl_hypervisor.c
powerpc/85xx: fix mpic configuration in CAMP mode
powerpc: Copy back TIF flags on return from softirq stack
powerpc/64: Make server perfmon only built on ppc64 server devices
powerpc/pseries: Fix hvc_vio.c build due to recent changes
powerpc: Exporting boot_cpuid_phys
powerpc: Add CFAR to oops output
hvc_console: Add kdb support
powerpc/pseries: Fix hvterm_raw_get_chars to accept < 16 chars, fixing xmon
powerpc/irq: Quieten irq mapping printks
powerpc: Enable lockup and hung task detectors in pseries and ppc64 defeconfigs
powerpc: Add mpt2sas driver to pseries and ppc64 defconfig
powerpc: Disable IRQs off tracer in ppc64 defconfig
powerpc: Sync pseries and ppc64 defconfigs
powerpc/pseries/hvconsole: Fix dropped console output
hvc_console: Improve tty/console put_chars handling
powerpc/kdump: Fix timeout in crash_kexec_wait_realmode
powerpc/mm: Fix output of total_ram.
powerpc/cpufreq: Add cpufreq driver for Momentum Maple boards
powerpc: Correct annotations of pmu registration functions
...
Fix up trivial Kconfig/Makefile conflicts in arch/powerpc, drivers, and
drivers/cpufreq
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/platform.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 6040717b62bb..0cad9c7f6bb5 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c | |||
@@ -32,6 +32,25 @@ struct device platform_bus = { | |||
32 | EXPORT_SYMBOL_GPL(platform_bus); | 32 | EXPORT_SYMBOL_GPL(platform_bus); |
33 | 33 | ||
34 | /** | 34 | /** |
35 | * arch_setup_pdev_archdata - Allow manipulation of archdata before its used | ||
36 | * @dev: platform device | ||
37 | * | ||
38 | * This is called before platform_device_add() such that any pdev_archdata may | ||
39 | * be setup before the platform_notifier is called. So if a user needs to | ||
40 | * manipulate any relevant information in the pdev_archdata they can do: | ||
41 | * | ||
42 | * platform_devic_alloc() | ||
43 | * ... manipulate ... | ||
44 | * platform_device_add() | ||
45 | * | ||
46 | * And if they don't care they can just call platform_device_register() and | ||
47 | * everything will just work out. | ||
48 | */ | ||
49 | void __weak arch_setup_pdev_archdata(struct platform_device *pdev) | ||
50 | { | ||
51 | } | ||
52 | |||
53 | /** | ||
35 | * platform_get_resource - get a resource for a device | 54 | * platform_get_resource - get a resource for a device |
36 | * @dev: platform device | 55 | * @dev: platform device |
37 | * @type: resource type | 56 | * @type: resource type |
@@ -173,6 +192,7 @@ struct platform_device *platform_device_alloc(const char *name, int id) | |||
173 | pa->pdev.id = id; | 192 | pa->pdev.id = id; |
174 | device_initialize(&pa->pdev.dev); | 193 | device_initialize(&pa->pdev.dev); |
175 | pa->pdev.dev.release = platform_device_release; | 194 | pa->pdev.dev.release = platform_device_release; |
195 | arch_setup_pdev_archdata(&pa->pdev); | ||
176 | } | 196 | } |
177 | 197 | ||
178 | return pa ? &pa->pdev : NULL; | 198 | return pa ? &pa->pdev : NULL; |
@@ -334,6 +354,7 @@ EXPORT_SYMBOL_GPL(platform_device_del); | |||
334 | int platform_device_register(struct platform_device *pdev) | 354 | int platform_device_register(struct platform_device *pdev) |
335 | { | 355 | { |
336 | device_initialize(&pdev->dev); | 356 | device_initialize(&pdev->dev); |
357 | arch_setup_pdev_archdata(pdev); | ||
337 | return platform_device_add(pdev); | 358 | return platform_device_add(pdev); |
338 | } | 359 | } |
339 | EXPORT_SYMBOL_GPL(platform_device_register); | 360 | EXPORT_SYMBOL_GPL(platform_device_register); |