---
name: "snd_card_new"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/snd_card_new"
---

# snd\_card\_new(9)

create and initialize a soundcard structure

## NAME

snd\_card\_new - create and initialize a soundcard structure

## SYNOPSIS

**int snd\_card\_new(struct device \*** *parent***, int** *idx***, const char \*** *xid***, struct module \*** *module***, int** *extra\_size***, struct snd\_card \*\*** *card\_ret***);**

## ARGUMENTS

*parent*

the parent device object

*idx*

card index (address) \[0 ... (SNDRV\_CARDS-1)\]

*xid*

card identification (ASCII string)

*module*

top level module for locking

*extra\_size*

allocate this extra size after the main soundcard structure

*card\_ret*

the pointer to store the created card instance

## DESCRIPTION

Creates and initializes a soundcard structure.

The function allocates snd\_card instance via kzalloc with the given space for the driver to use freely. The allocated struct is stored in the given card\_ret pointer.

## RETURN

Zero if successful or a negative error code.

## COPYRIGHT
