Skip to content

Commit

Permalink
ALSA: ak411x: simplify snd_ak4113_create() a bit
Browse files Browse the repository at this point in the history
"err" is always a negative error code here, so there is no point in
checking.  Removing the check silences a static checker warning and
makes the code a bit more clear.  Also we don't need to initialize "err".

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Dan Carpenter authored and Takashi Iwai committed Mar 23, 2015
1 parent e311782 commit 034f90b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sound/i2c/other/ak4113.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ int snd_ak4113_create(struct snd_card *card, ak4113_read_t *read,
void *private_data, struct ak4113 **r_ak4113)
{
struct ak4113 *chip;
int err = 0;
int err;
unsigned char reg;
static struct snd_device_ops ops = {
.dev_free = snd_ak4113_dev_free,
Expand Down Expand Up @@ -109,7 +109,7 @@ int snd_ak4113_create(struct snd_card *card, ak4113_read_t *read,

__fail:
snd_ak4113_free(chip);
return err < 0 ? err : -EIO;
return err;
}
EXPORT_SYMBOL_GPL(snd_ak4113_create);

Expand Down

0 comments on commit 034f90b

Please sign in to comment.