Commit 9f50bbad authored by Johannes Berg's avatar Johannes Berg Committed by Takashi Iwai

ALSA: aoa i2sbus: don't overwrite module parameter

We shouldn't modify a global variable here.
Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 13095c37
...@@ -159,7 +159,7 @@ static int i2sbus_add_dev(struct macio_dev *macio, ...@@ -159,7 +159,7 @@ static int i2sbus_add_dev(struct macio_dev *macio,
struct i2sbus_dev *dev; struct i2sbus_dev *dev;
struct device_node *child = NULL, *sound = NULL; struct device_node *child = NULL, *sound = NULL;
struct resource *r; struct resource *r;
int i, layout = 0, rlen; int i, layout = 0, rlen, ok = force;
static const char *rnames[] = { "i2sbus: %s (control)", static const char *rnames[] = { "i2sbus: %s (control)",
"i2sbus: %s (tx)", "i2sbus: %s (tx)",
"i2sbus: %s (rx)" }; "i2sbus: %s (rx)" };
...@@ -192,7 +192,7 @@ static int i2sbus_add_dev(struct macio_dev *macio, ...@@ -192,7 +192,7 @@ static int i2sbus_add_dev(struct macio_dev *macio,
layout = *layout_id; layout = *layout_id;
snprintf(dev->sound.modalias, 32, snprintf(dev->sound.modalias, 32,
"sound-layout-%d", layout); "sound-layout-%d", layout);
force = 1; ok = 1;
} }
} }
/* for the time being, until we can handle non-layout-id /* for the time being, until we can handle non-layout-id
...@@ -201,7 +201,7 @@ static int i2sbus_add_dev(struct macio_dev *macio, ...@@ -201,7 +201,7 @@ static int i2sbus_add_dev(struct macio_dev *macio,
* When there are two i2s busses and only one has a layout-id, * When there are two i2s busses and only one has a layout-id,
* then this depends on the order, but that isn't important * then this depends on the order, but that isn't important
* either as the second one in that case is just a modem. */ * either as the second one in that case is just a modem. */
if (!force) { if (!ok) {
kfree(dev); kfree(dev);
return -ENODEV; return -ENODEV;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment