summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
Diffstat (limited to 'sound')
-rw-r--r--sound/Kconfig4
-rw-r--r--sound/core/init.c8
-rw-r--r--sound/core/pcm.c7
-rw-r--r--sound/core/sound.c22
-rw-r--r--sound/oss/cs46xx.c6
-rw-r--r--sound/oss/soundcard.c16
-rw-r--r--sound/sound_core.c6
7 files changed, 37 insertions, 32 deletions
diff --git a/sound/Kconfig b/sound/Kconfig
index e0d791a..95949b6 100644
--- a/sound/Kconfig
+++ b/sound/Kconfig
@@ -64,11 +64,11 @@ source "sound/arm/Kconfig"
source "sound/mips/Kconfig"
-# the following will depenend on the order of config.
+# the following will depend on the order of config.
# here assuming USB is defined before ALSA
source "sound/usb/Kconfig"
-# the following will depenend on the order of config.
+# the following will depend on the order of config.
# here assuming PCMCIA is defined before ALSA
source "sound/pcmcia/Kconfig"
diff --git a/sound/core/init.c b/sound/core/init.c
index 3058d62..6152a75 100644
--- a/sound/core/init.c
+++ b/sound/core/init.c
@@ -361,6 +361,8 @@ static int snd_card_do_free(struct snd_card *card)
snd_printk(KERN_WARNING "unable to free card info\n");
/* Not fatal error */
}
+ if (card->dev)
+ device_unregister(card->dev);
kfree(card);
return 0;
}
@@ -495,6 +497,12 @@ int snd_card_register(struct snd_card *card)
int err;
snd_assert(card != NULL, return -EINVAL);
+ if (!card->dev) {
+ card->dev = device_create(sound_class, card->parent, 0,
+ "card%i", card->number);
+ if (IS_ERR(card->dev))
+ card->dev = NULL;
+ }
if ((err = snd_device_register_all(card)) < 0)
return err;
mutex_lock(&snd_card_mutex);
diff --git a/sound/core/pcm.c b/sound/core/pcm.c
index fbbbcd2..5ac6e19 100644
--- a/sound/core/pcm.c
+++ b/sound/core/pcm.c
@@ -910,7 +910,8 @@ void snd_pcm_detach_substream(struct snd_pcm_substream *substream)
substream->pstr->substream_opened--;
}
-static ssize_t show_pcm_class(struct class_device *class_device, char *buf)
+static ssize_t show_pcm_class(struct device *dev,
+ struct device_attribute *attr, char *buf)
{
struct snd_pcm *pcm;
const char *str;
@@ -921,7 +922,7 @@ static ssize_t show_pcm_class(struct class_device *class_device, char *buf)
[SNDRV_PCM_CLASS_DIGITIZER] = "digitizer",
};
- if (! (pcm = class_get_devdata(class_device)) ||
+ if (! (pcm = dev_get_drvdata(dev)) ||
pcm->dev_class > SNDRV_PCM_CLASS_LAST)
str = "none";
else
@@ -929,7 +930,7 @@ static ssize_t show_pcm_class(struct class_device *class_device, char *buf)
return snprintf(buf, PAGE_SIZE, "%s\n", str);
}
-static struct class_device_attribute pcm_attrs =
+static struct device_attribute pcm_attrs =
__ATTR(pcm_class, S_IRUGO, show_pcm_class, NULL);
static int snd_pcm_dev_register(struct snd_device *device)
diff --git a/sound/core/sound.c b/sound/core/sound.c
index efa476c..2827420 100644
--- a/sound/core/sound.c
+++ b/sound/core/sound.c
@@ -61,9 +61,6 @@ EXPORT_SYMBOL(snd_ecards_limit);
static struct snd_minor *snd_minors[SNDRV_OS_MINORS];
static DEFINE_MUTEX(sound_mutex);
-extern struct class *sound_class;
-
-
#ifdef CONFIG_KMOD
/**
@@ -268,11 +265,10 @@ int snd_register_device(int type, struct snd_card *card, int dev,
snd_minors[minor] = preg;
if (card)
device = card->dev;
- preg->class_dev = class_device_create(sound_class, NULL,
- MKDEV(major, minor),
- device, "%s", name);
- if (preg->class_dev)
- class_set_devdata(preg->class_dev, private_data);
+ preg->dev = device_create(sound_class, device, MKDEV(major, minor),
+ "%s", name);
+ if (preg->dev)
+ dev_set_drvdata(preg->dev, private_data);
mutex_unlock(&sound_mutex);
return 0;
@@ -320,7 +316,7 @@ int snd_unregister_device(int type, struct snd_card *card, int dev)
return -EINVAL;
}
- class_device_destroy(sound_class, MKDEV(major, minor));
+ device_destroy(sound_class, MKDEV(major, minor));
kfree(snd_minors[minor]);
snd_minors[minor] = NULL;
@@ -331,15 +327,15 @@ int snd_unregister_device(int type, struct snd_card *card, int dev)
EXPORT_SYMBOL(snd_unregister_device);
int snd_add_device_sysfs_file(int type, struct snd_card *card, int dev,
- const struct class_device_attribute *attr)
+ struct device_attribute *attr)
{
int minor, ret = -EINVAL;
- struct class_device *cdev;
+ struct device *d;
mutex_lock(&sound_mutex);
minor = find_snd_minor(type, card, dev);
- if (minor >= 0 && (cdev = snd_minors[minor]->class_dev) != NULL)
- ret = class_device_create_file(cdev, attr);
+ if (minor >= 0 && (d = snd_minors[minor]->dev) != NULL)
+ ret = device_create_file(d, attr);
mutex_unlock(&sound_mutex);
return ret;
diff --git a/sound/oss/cs46xx.c b/sound/oss/cs46xx.c
index 6e3c41f..b1c5d82 100644
--- a/sound/oss/cs46xx.c
+++ b/sound/oss/cs46xx.c
@@ -779,7 +779,7 @@ static unsigned int cs_set_adc_rate(struct cs_state *state, unsigned int rate)
rate = 48000 / 9;
/*
- * We can not capture at at rate greater than the Input Rate (48000).
+ * We cannot capture at at rate greater than the Input Rate (48000).
* Return an error if an attempt is made to stray outside that limit.
*/
if (rate > 48000)
@@ -4754,8 +4754,8 @@ static int cs_hardware_init(struct cs_card *card)
mdelay(5 * cs_laptop_wait); /* Shouldnt be needed ?? */
/*
-* If we are resuming under 2.2.x then we can not schedule a timeout.
-* so, just spin the CPU.
+* If we are resuming under 2.2.x then we cannot schedule a timeout,
+* so just spin the CPU.
*/
if (card->pm.flags & CS46XX_PM_IDLE) {
/*
diff --git a/sound/oss/soundcard.c b/sound/oss/soundcard.c
index 2344d09..75c5e74 100644
--- a/sound/oss/soundcard.c
+++ b/sound/oss/soundcard.c
@@ -557,17 +557,17 @@ static int __init oss_init(void)
sound_dmap_flag = (dmabuf > 0 ? 1 : 0);
for (i = 0; i < sizeof (dev_list) / sizeof *dev_list; i++) {
- class_device_create(sound_class, NULL,
- MKDEV(SOUND_MAJOR, dev_list[i].minor),
- NULL, "%s", dev_list[i].name);
+ device_create(sound_class, NULL,
+ MKDEV(SOUND_MAJOR, dev_list[i].minor),
+ "%s", dev_list[i].name);
if (!dev_list[i].num)
continue;
for (j = 1; j < *dev_list[i].num; j++)
- class_device_create(sound_class, NULL,
- MKDEV(SOUND_MAJOR, dev_list[i].minor + (j*0x10)),
- NULL, "%s%d", dev_list[i].name, j);
+ device_create(sound_class, NULL,
+ MKDEV(SOUND_MAJOR, dev_list[i].minor + (j*0x10)),
+ "%s%d", dev_list[i].name, j);
}
if (sound_nblocks >= 1024)
@@ -581,11 +581,11 @@ static void __exit oss_cleanup(void)
int i, j;
for (i = 0; i < sizeof (dev_list) / sizeof *dev_list; i++) {
- class_device_destroy(sound_class, MKDEV(SOUND_MAJOR, dev_list[i].minor));
+ device_destroy(sound_class, MKDEV(SOUND_MAJOR, dev_list[i].minor));
if (!dev_list[i].num)
continue;
for (j = 1; j < *dev_list[i].num; j++)
- class_device_destroy(sound_class, MKDEV(SOUND_MAJOR, dev_list[i].minor + (j*0x10)));
+ device_destroy(sound_class, MKDEV(SOUND_MAJOR, dev_list[i].minor + (j*0x10)));
}
unregister_sound_special(1);
diff --git a/sound/sound_core.c b/sound/sound_core.c
index 5322c50..8f1ced4 100644
--- a/sound/sound_core.c
+++ b/sound/sound_core.c
@@ -170,8 +170,8 @@ static int sound_insert_unit(struct sound_unit **list, const struct file_operati
else
sprintf(s->name, "sound/%s%d", name, r / SOUND_STEP);
- class_device_create(sound_class, NULL, MKDEV(SOUND_MAJOR, s->unit_minor),
- dev, s->name+6);
+ device_create(sound_class, dev, MKDEV(SOUND_MAJOR, s->unit_minor),
+ s->name+6);
return r;
fail:
@@ -193,7 +193,7 @@ static void sound_remove_unit(struct sound_unit **list, int unit)
p = __sound_remove_unit(list, unit);
spin_unlock(&sound_loader_lock);
if (p) {
- class_device_destroy(sound_class, MKDEV(SOUND_MAJOR, p->unit_minor));
+ device_destroy(sound_class, MKDEV(SOUND_MAJOR, p->unit_minor));
kfree(p);
}
}
OpenPOWER on IntegriCloud