|
@@ -61,9 +61,6 @@ EXPORT_SYMBOL(snd_ecards_limit);
|
|
static struct snd_minor *snd_minors[SNDRV_OS_MINORS];
|
|
static struct snd_minor *snd_minors[SNDRV_OS_MINORS];
|
|
static DEFINE_MUTEX(sound_mutex);
|
|
static DEFINE_MUTEX(sound_mutex);
|
|
|
|
|
|
-extern struct class *sound_class;
|
|
|
|
-
|
|
|
|
-
|
|
|
|
#ifdef CONFIG_KMOD
|
|
#ifdef CONFIG_KMOD
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -268,11 +265,10 @@ int snd_register_device(int type, struct snd_card *card, int dev,
|
|
snd_minors[minor] = preg;
|
|
snd_minors[minor] = preg;
|
|
if (card)
|
|
if (card)
|
|
device = card->dev;
|
|
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);
|
|
mutex_unlock(&sound_mutex);
|
|
return 0;
|
|
return 0;
|
|
@@ -320,7 +316,7 @@ int snd_unregister_device(int type, struct snd_card *card, int dev)
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
}
|
|
}
|
|
|
|
|
|
- class_device_destroy(sound_class, MKDEV(major, minor));
|
|
|
|
|
|
+ device_destroy(sound_class, MKDEV(major, minor));
|
|
|
|
|
|
kfree(snd_minors[minor]);
|
|
kfree(snd_minors[minor]);
|
|
snd_minors[minor] = NULL;
|
|
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);
|
|
EXPORT_SYMBOL(snd_unregister_device);
|
|
|
|
|
|
int snd_add_device_sysfs_file(int type, struct snd_card *card, int dev,
|
|
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;
|
|
int minor, ret = -EINVAL;
|
|
- struct class_device *cdev;
|
|
|
|
|
|
+ struct device *d;
|
|
|
|
|
|
mutex_lock(&sound_mutex);
|
|
mutex_lock(&sound_mutex);
|
|
minor = find_snd_minor(type, card, dev);
|
|
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);
|
|
mutex_unlock(&sound_mutex);
|
|
return ret;
|
|
return ret;
|
|
|
|
|