Skip to content

Commit

Permalink
ALSA: asihpi: Remove always NULL parameter
Browse files Browse the repository at this point in the history
snd_asihpi_hpi_new() takes a pointer to a pointer of a hwdep where if this
parameter is provided the newly allocated hwdep is stored. All callers pass
NULL though, so remove the parameter. This makes the code a bit cleaner and
shorter.

Signed-off-by: Lars-Peter Clausen <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
larsclausen authored and tiwai committed Jan 2, 2015
1 parent a088009 commit d18132a
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions sound/pci/asihpi/asihpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -2832,14 +2832,11 @@ static int snd_asihpi_hpi_ioctl(struct snd_hwdep *hw, struct file *file,
/* results in /dev/snd/hwC#D0 file for each card with index #
also /proc/asound/hwdep will contain '#-00: asihpi (HPI) for each card'
*/
static int snd_asihpi_hpi_new(struct snd_card_asihpi *asihpi,
int device, struct snd_hwdep **rhwdep)
static int snd_asihpi_hpi_new(struct snd_card_asihpi *asihpi, int device)
{
struct snd_hwdep *hw;
int err;

if (rhwdep)
*rhwdep = NULL;
err = snd_hwdep_new(asihpi->card, "HPI", device, &hw);
if (err < 0)
return err;
Expand All @@ -2849,8 +2846,6 @@ static int snd_asihpi_hpi_new(struct snd_card_asihpi *asihpi,
hw->ops.ioctl = snd_asihpi_hpi_ioctl;
hw->ops.release = snd_asihpi_hpi_release;
hw->private_data = asihpi;
if (rhwdep)
*rhwdep = hw;
return 0;
}

Expand Down Expand Up @@ -2993,7 +2988,7 @@ static int snd_asihpi_probe(struct pci_dev *pci_dev,

/* always create, can be enabled or disabled dynamically
by enable_hwdep module param*/
snd_asihpi_hpi_new(asihpi, 0, NULL);
snd_asihpi_hpi_new(asihpi, 0);

strcpy(card->driver, "ASIHPI");

Expand Down

0 comments on commit d18132a

Please sign in to comment.