diff options
author | Takashi Iwai <tiwai@suse.de> | 2014-01-29 12:51:12 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-02-12 10:58:20 +0100 |
commit | 393aa9c1cc514774332d7bc861307a76206e358d (patch) | |
tree | b419a57e8af4b904247c0ffd3a7f0cc924bf2278 /include/sound/core.h | |
parent | ALSA: Drop unused name argument in snd_register_oss_device() (diff) | |
download | linux-393aa9c1cc514774332d7bc861307a76206e358d.tar.xz linux-393aa9c1cc514774332d7bc861307a76206e358d.zip |
ALSA: Mandate to pass a device pointer at card creation time
This is a part of preliminary works for modernizing the ALSA device
structure. So far, we set card->dev at later point after the object
creation. Because of this, the core layer doesn't always know which
device is being handled before it's actually registered, and it makes
impossible to show the device in error messages, for example. The
first goal is to achieve a proper struct device initialization at the
very beginning of probing.
As a first step, this patch introduces snd_card_new() function (yes
there was the same named function in the very past), in order to
receive the parent device pointer from the very beginning.
snd_card_create() is marked as deprecated.
At this point, there is no functional change other than that. The
actual change of the device creation scheme will follow later.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'include/sound/core.h')
-rw-r--r-- | include/sound/core.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/include/sound/core.h b/include/sound/core.h index d0cee2c8c04f..e946b2428ea0 100644 --- a/include/sound/core.h +++ b/include/sound/core.h @@ -283,9 +283,16 @@ int snd_card_locked(int card); extern int (*snd_mixer_oss_notify_callback)(struct snd_card *card, int cmd); #endif -int snd_card_create(int idx, const char *id, - struct module *module, int extra_size, - struct snd_card **card_ret); +int snd_card_new(struct device *parent, int idx, const char *xid, + struct module *module, int extra_size, + struct snd_card **card_ret); + +static inline int __deprecated +snd_card_create(int idx, const char *id, struct module *module, int extra_size, + struct snd_card **ret) +{ + return snd_card_new(NULL, idx, id, module, extra_size, ret); +} int snd_card_disconnect(struct snd_card *card); int snd_card_free(struct snd_card *card); |