After all components are assigned, register the card instance
by calling snd_card_register()
. Access
to the device files is enabled at this point. That is, before
snd_card_register()
is called, the
components are safely inaccessible from external side. If this
call fails, exit the probe function after releasing the card via
snd_card_free()
.
For releasing the card instance, you can call simply
snd_card_free()
. As mentioned earlier, all
components are released automatically by this call.
For a device which allows hotplugging, you can use
snd_card_free_when_closed
. This one will
postpone the destruction until all devices are closed.