Skip to content

Commit

Permalink
[ARM] pxa: register Power I2C device only when necessary
Browse files Browse the repository at this point in the history
Signed-off-by: Eric Miao <eric.miao@marvell.com>
  • Loading branch information
Eric Miao committed Dec 2, 2008
1 parent 9946429 commit 1475822
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions arch/arm/mach-pxa/pxa27x.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ void __init pxa27x_set_i2c_power_info(struct i2c_pxa_platform_data *info)
local_irq_disable();
PCFR |= PCFR_PI2CEN;
local_irq_enable();
pxa27x_device_i2c_power.dev.platform_data = info;
pxa_register_device(&pxa27x_device_i2c_power, info);
}

static struct platform_device *devices[] __initdata = {
Expand All @@ -334,7 +334,6 @@ static struct platform_device *devices[] __initdata = {
&pxa_device_stuart,
&pxa_device_i2s,
&pxa_device_rtc,
&pxa27x_device_i2c_power,
&pxa27x_device_ssp1,
&pxa27x_device_ssp2,
&pxa27x_device_ssp3,
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-pxa/pxa3xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <mach/pm.h>
#include <mach/dma.h>
#include <mach/ssp.h>
#include <mach/i2c.h>

#include "generic.h"
#include "devices.h"
Expand Down Expand Up @@ -531,7 +532,7 @@ void __init pxa3xx_init_irq(void)

void __init pxa3xx_set_i2c_power_info(struct i2c_pxa_platform_data *info)
{
pxa3xx_device_i2c_power.dev.platform_data = info;
pxa_register_device(&pxa3xx_device_i2c_power, info);
}

static struct platform_device *devices[] __initdata = {
Expand All @@ -547,7 +548,6 @@ static struct platform_device *devices[] __initdata = {
&pxa3xx_device_ssp4,
&pxa27x_device_pwm0,
&pxa27x_device_pwm1,
&pxa3xx_device_i2c_power,
};

static struct sys_device pxa3xx_sysdev[] = {
Expand Down

0 comments on commit 1475822

Please sign in to comment.