summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/generic.c
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2007-11-08 11:17:19 +0000
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-01-26 15:07:50 +0000
commit03f5b2cee6cabd0400b9f89956c373a0b5d3802a (patch)
treeabea1a5700170fc5434b200679aa51e876afe3a7 /arch/arm/mach-pxa/generic.c
parent2fd2b1242810fb4d2ba36548fecc1f005c36770c (diff)
downloadblackbird-obmc-linux-03f5b2cee6cabd0400b9f89956c373a0b5d3802a.tar.gz
blackbird-obmc-linux-03f5b2cee6cabd0400b9f89956c373a0b5d3802a.zip
[ARM] pxa: avoid always registering MMC, I2C, IrDA and framebuffer devices
Only register the MMC, framebuffer, I2C and FICP devices when the platform supplies the necessary platform data structures for the devices. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-pxa/generic.c')
-rw-r--r--arch/arm/mach-pxa/generic.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/arch/arm/mach-pxa/generic.c b/arch/arm/mach-pxa/generic.c
index 1c34946ee16e..3d863c919e8b 100644
--- a/arch/arm/mach-pxa/generic.c
+++ b/arch/arm/mach-pxa/generic.c
@@ -235,6 +235,18 @@ void __init pxa_map_io(void)
}
+void __init pxa_register_device(struct platform_device *dev, void *data)
+{
+ int ret;
+
+ dev->dev.platform_data = data;
+
+ ret = platform_device_register(dev);
+ if (ret)
+ dev_err(&dev->dev, "unable to register device: %d\n", ret);
+}
+
+
static struct resource pxamci_resources[] = {
[0] = {
.start = 0x41100000,
@@ -263,7 +275,7 @@ struct platform_device pxa_device_mci = {
void __init pxa_set_mci_info(struct pxamci_platform_data *info)
{
- pxa_device_mci.dev.platform_data = info;
+ pxa_register_device(&pxa_device_mci, info);
}
@@ -328,7 +340,7 @@ struct platform_device pxa_device_fb = {
void __init set_pxa_fb_info(struct pxafb_mach_info *info)
{
- pxa_device_fb.dev.platform_data = info;
+ pxa_register_device(&pxa_device_fb, info);
}
void __init set_pxa_fb_parent(struct device *parent_dev)
@@ -433,7 +445,7 @@ struct platform_device pxa_device_i2c = {
void __init pxa_set_i2c_info(struct i2c_pxa_platform_data *info)
{
- pxa_device_i2c.dev.platform_data = info;
+ pxa_register_device(&pxa_device_i2c, info);
}
static struct resource pxai2s_resources[] = {
@@ -468,7 +480,7 @@ struct platform_device pxa_device_ficp = {
void __init pxa_set_ficp_info(struct pxaficp_platform_data *info)
{
- pxa_device_ficp.dev.platform_data = info;
+ pxa_register_device(&pxa_device_ficp, info);
}
struct platform_device pxa_device_rtc = {
OpenPOWER on IntegriCloud