Skip to content

Commit

Permalink
ALSA: aoa i2sbus: don't overwrite module parameter
Browse files Browse the repository at this point in the history
We shouldn't modify a global variable here.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Johannes Berg authored and Takashi Iwai committed Oct 23, 2008
1 parent 13095c3 commit 9f50bba
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sound/aoa/soundbus/i2sbus/i2sbus-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ static int i2sbus_add_dev(struct macio_dev *macio,
struct i2sbus_dev *dev;
struct device_node *child = NULL, *sound = NULL;
struct resource *r;
int i, layout = 0, rlen;
int i, layout = 0, rlen, ok = force;
static const char *rnames[] = { "i2sbus: %s (control)",
"i2sbus: %s (tx)",
"i2sbus: %s (rx)" };
Expand Down Expand Up @@ -192,7 +192,7 @@ static int i2sbus_add_dev(struct macio_dev *macio,
layout = *layout_id;
snprintf(dev->sound.modalias, 32,
"sound-layout-%d", layout);
force = 1;
ok = 1;
}
}
/* for the time being, until we can handle non-layout-id
Expand All @@ -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,
* then this depends on the order, but that isn't important
* either as the second one in that case is just a modem. */
if (!force) {
if (!ok) {
kfree(dev);
return -ENODEV;
}
Expand Down

0 comments on commit 9f50bba

Please sign in to comment.