Skip to content

Commit a0dbf2a

Browse files
Russ Dilltmlind
authored andcommitted
ARM: OMAP2+ smsc911x: Fix possible stale smsc911x flags
If this function is called the first time with flags set, and the second time without flags set then the leftover flags from the first called will be used rather than the desired default flags. Signed-off-by: Russ Dill <russ.dill@ti.com> Tested-by: Igor Grinberg <grinberg@compulab.co.il> Signed-off-by: Tony Lindgren <tony@atomide.com>
1 parent 54da078 commit a0dbf2a

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

‎arch/arm/mach-omap2/gpmc-smsc911x.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ static struct smsc911x_platform_config gpmc_smsc911x_config = {
3939
.phy_interface = PHY_INTERFACE_MODE_MII,
4040
.irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
4141
.irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
42-
.flags = SMSC911X_USE_16BIT,
4342
};
4443

4544
static struct regulator_consumer_supply gpmc_smsc911x_supply[] = {
@@ -135,8 +134,7 @@ void __init gpmc_smsc911x_init(struct omap_smsc911x_platform_data *gpmc_cfg)
135134
gpio_set_value(gpmc_cfg->gpio_reset, 1);
136135
}
137136

138-
if (gpmc_cfg->flags)
139-
gpmc_smsc911x_config.flags = gpmc_cfg->flags;
137+
gpmc_smsc911x_config.flags = gpmc_cfg->flags ? : SMSC911X_USE_16BIT;
140138

141139
pdev = platform_device_register_resndata(NULL, "smsc911x", gpmc_cfg->id,
142140
gpmc_smsc911x_resources, ARRAY_SIZE(gpmc_smsc911x_resources),

0 commit comments

Comments
 (0)