projects
/
platform
/
kernel
/
linux-starfive.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ASoC: ops: add correct range check for limiting volume
[platform/kernel/linux-starfive.git]
/
sound
/
sound_core.c
diff --git
a/sound/sound_core.c
b/sound/sound_core.c
index
4f69112
..
d81fed1
100644
(file)
--- a/
sound/sound_core.c
+++ b/
sound/sound_core.c
@@
-23,9
+23,6
@@
static inline int init_oss_soundcore(void) { return 0; }
static inline void cleanup_oss_soundcore(void) { }
#endif
static inline void cleanup_oss_soundcore(void) { }
#endif
-struct class *sound_class;
-EXPORT_SYMBOL(sound_class);
-
MODULE_DESCRIPTION("Core sound module");
MODULE_AUTHOR("Alan Cox");
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Core sound module");
MODULE_AUTHOR("Alan Cox");
MODULE_LICENSE("GPL");
@@
-37,6
+34,12
@@
static char *sound_devnode(const struct device *dev, umode_t *mode)
return kasprintf(GFP_KERNEL, "snd/%s", dev_name(dev));
}
return kasprintf(GFP_KERNEL, "snd/%s", dev_name(dev));
}
+const struct class sound_class = {
+ .name = "sound",
+ .devnode = sound_devnode,
+};
+EXPORT_SYMBOL(sound_class);
+
static int __init init_soundcore(void)
{
int rc;
static int __init init_soundcore(void)
{
int rc;
@@
-45,21
+48,19
@@
static int __init init_soundcore(void)
if (rc)
return rc;
if (rc)
return rc;
-
sound_class = class_create("sound"
);
- if (
IS_ERR(sound_class)
) {
+
rc = class_register(&sound_class
);
+ if (
rc
) {
cleanup_oss_soundcore();
cleanup_oss_soundcore();
- return
PTR_ERR(sound_class)
;
+ return
rc
;
}
}
- sound_class->devnode = sound_devnode;
-
return 0;
}
static void __exit cleanup_soundcore(void)
{
cleanup_oss_soundcore();
return 0;
}
static void __exit cleanup_soundcore(void)
{
cleanup_oss_soundcore();
- class_
destroy(
sound_class);
+ class_
unregister(&
sound_class);
}
subsys_initcall(init_soundcore);
}
subsys_initcall(init_soundcore);
@@
-276,7
+277,7
@@
retry:
}
}
}
}
- device_create(sound_class, dev, MKDEV(SOUND_MAJOR, s->unit_minor),
+ device_create(
&
sound_class, dev, MKDEV(SOUND_MAJOR, s->unit_minor),
NULL, "%s", s->name+6);
return s->unit_minor;
NULL, "%s", s->name+6);
return s->unit_minor;
@@
-302,7
+303,7
@@
static void sound_remove_unit(struct sound_unit **list, int unit)
if (!preclaim_oss)
__unregister_chrdev(SOUND_MAJOR, p->unit_minor, 1,
p->name);
if (!preclaim_oss)
__unregister_chrdev(SOUND_MAJOR, p->unit_minor, 1,
p->name);
- device_destroy(sound_class, MKDEV(SOUND_MAJOR, p->unit_minor));
+ device_destroy(
&
sound_class, MKDEV(SOUND_MAJOR, p->unit_minor));
kfree(p);
}
}
kfree(p);
}
}