Remove an useless empty line

Signed-off-by: Antonio Ospite <ao2@amarulasolutions.com>
Better error message

Signed-off-by: Antonio Ospite <ao2@amarulasolutions.com>
Don't memset the address of a buffer, its name is already its address

Signed-off-by: Antonio Ospite <ao2@amarulasolutions.com>
Fix incorrect use of memset

Fix a parameter inversion in the use of memset(), spotted by "sparse":

  pcm.c:149:31: warning: memset with byte count of 0

Signed-off-by: Antonio Ospite <ao2@amarulasolutions.com>
Use the "card" variable, it was assigned and never used

Signed-off-by: Antonio Ospite <ao2@amarulasolutions.com>
Move hiface_pcm_abort() and hiface_pcm_destroy() before hiface_pcm_init()

This is because, in a following commit, we will reference
hiface_pcm_destroy() in a new function hiface_pcm_free() and use the
latter in hiface_pcm_init().

No functionality changes are introduced, just code moved from one place
of the file to another.

Signed-off-by: Antonio Ospite <ao2@amarulasolutions.com>
Use pcm->private_free to cleanup the pcm resources

ALSA will take care to do the cleanup at the right time.

Signed-off-by: Antonio Ospite <ao2@amarulasolutions.com>
Remove the "control" infrastructure as we don't use actual ALSA controls

Calling usb_control_msg() directly in hiface_pcm_set_rate() is enough.

Signed-off-by: Antonio Ospite <ao2@amarulasolutions.com>
Cleanup error paths, don't use hiface_chip_destroy()

The problem with hiface_chip_destroy() was this:

  - On disconnect ALSA is responsible of freeing the card by calling
    snd_card_free() itself, as requested by snd_card_free_when_closed(),
    which in turn calls hiface_dev_free().

  - hiface_dev_free() was then calling snd_card_free() again which
    resulted in recursion.

NOTE: in the error paths of hiface_chip_probe() we just need to call
snd_card_free() and not kfree(chip), as ALSA will take care of invoking
hiface_dev_free() for us which frees the chip data.

While at it, move the mutex_unlock(&register_mutex) right after
snd_card_register() as the mutex name suggests this protect multiple
registrations, and BTW snd-usb-audio does so too.

Signed-off-by: Antonio Ospite <ao2@amarulasolutions.com>