Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
e8095bf2
Commit
e8095bf2
authored
Apr 20, 2003
by
Christoph Hellwig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] devfs: sound
parent
36a674f3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
34 deletions
+19
-34
sound/core/sound.c
sound/core/sound.c
+2
-16
sound/sound_core.c
sound/sound_core.c
+17
-18
No files found.
sound/core/sound.c
View file @
e8095bf2
...
@@ -68,10 +68,6 @@ static struct list_head snd_minors_hash[SNDRV_CARDS];
...
@@ -68,10 +68,6 @@ static struct list_head snd_minors_hash[SNDRV_CARDS];
static
DECLARE_MUTEX
(
sound_mutex
);
static
DECLARE_MUTEX
(
sound_mutex
);
#ifdef CONFIG_DEVFS_FS
static
devfs_handle_t
devfs_handle
=
NULL
;
#endif
#ifdef CONFIG_KMOD
#ifdef CONFIG_KMOD
/**
/**
...
@@ -343,15 +339,7 @@ static int __init alsa_sound_init(void)
...
@@ -343,15 +339,7 @@ static int __init alsa_sound_init(void)
if
((
err
=
snd_oss_init_module
())
<
0
)
if
((
err
=
snd_oss_init_module
())
<
0
)
return
err
;
return
err
;
#endif
#endif
#ifdef CONFIG_DEVFS_FS
devfs_mk_dir
(
"snd"
);
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0)
devfs_handle
=
devfs_mk_dir
(
NULL
,
"snd"
,
3
,
NULL
);
#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,5,67)
devfs_handle
=
devfs_mk_dir
(
NULL
,
"snd"
,
NULL
);
#else
devfs_handle
=
devfs_mk_dir
(
"snd"
);
#endif
#endif
if
(
register_chrdev
(
major
,
"alsa"
,
&
snd_fops
))
{
if
(
register_chrdev
(
major
,
"alsa"
,
&
snd_fops
))
{
snd_printk
(
KERN_ERR
"unable to register native major device number %d
\n
"
,
major
);
snd_printk
(
KERN_ERR
"unable to register native major device number %d
\n
"
,
major
);
return
-
EIO
;
return
-
EIO
;
...
@@ -404,9 +392,7 @@ static void __exit alsa_sound_exit(void)
...
@@ -404,9 +392,7 @@ static void __exit alsa_sound_exit(void)
#endif
#endif
if
(
unregister_chrdev
(
major
,
"alsa"
)
!=
0
)
if
(
unregister_chrdev
(
major
,
"alsa"
)
!=
0
)
snd_printk
(
KERN_ERR
"unable to unregister major device number %d
\n
"
,
major
);
snd_printk
(
KERN_ERR
"unable to unregister major device number %d
\n
"
,
major
);
#ifdef CONFIG_DEVFS_FS
devfs_remove
(
"snd"
);
devfs_unregister
(
devfs_handle
);
#endif
}
}
module_init
(
alsa_sound_init
)
module_init
(
alsa_sound_init
)
...
...
sound/sound_core.c
View file @
e8095bf2
...
@@ -54,7 +54,7 @@ struct sound_unit
...
@@ -54,7 +54,7 @@ struct sound_unit
int
unit_minor
;
int
unit_minor
;
struct
file_operations
*
unit_fops
;
struct
file_operations
*
unit_fops
;
struct
sound_unit
*
next
;
struct
sound_unit
*
next
;
devfs_handle_t
de
;
char
name
[
32
]
;
};
};
#ifdef CONFIG_SOUND_MSNDCLAS
#ifdef CONFIG_SOUND_MSNDCLAS
...
@@ -151,30 +151,29 @@ static spinlock_t sound_loader_lock = SPIN_LOCK_UNLOCKED;
...
@@ -151,30 +151,29 @@ static spinlock_t sound_loader_lock = SPIN_LOCK_UNLOCKED;
static
int
sound_insert_unit
(
struct
sound_unit
**
list
,
struct
file_operations
*
fops
,
int
index
,
int
low
,
int
top
,
const
char
*
name
,
umode_t
mode
)
static
int
sound_insert_unit
(
struct
sound_unit
**
list
,
struct
file_operations
*
fops
,
int
index
,
int
low
,
int
top
,
const
char
*
name
,
umode_t
mode
)
{
{
struct
sound_unit
*
s
=
kmalloc
(
sizeof
(
*
s
),
GFP_KERNEL
);
int
r
;
int
r
;
struct
sound_unit
*
s
=
(
struct
sound_unit
*
)
kmalloc
(
sizeof
(
struct
sound_unit
),
GFP_KERNEL
);
char
name_buf
[
32
];
if
(
s
==
NULL
)
if
(
!
s
)
return
-
ENOMEM
;
return
-
ENOMEM
;
spin_lock
(
&
sound_loader_lock
);
spin_lock
(
&
sound_loader_lock
);
r
=
__sound_insert_unit
(
s
,
list
,
fops
,
index
,
low
,
top
);
r
=
__sound_insert_unit
(
s
,
list
,
fops
,
index
,
low
,
top
);
spin_unlock
(
&
sound_loader_lock
);
spin_unlock
(
&
sound_loader_lock
);
if
(
r
<
0
)
if
(
r
<
0
)
{
goto
fail
;
kfree
(
s
);
else
if
(
r
<
SOUND_STEP
)
return
r
;
sprintf
(
s
->
name
,
"sound/%s"
,
name
);
}
if
(
r
<
SOUND_STEP
)
sprintf
(
name_buf
,
"sound/%s"
,
name
);
else
else
sprintf
(
name_buf
,
"sound/%s%d"
,
name
,
r
/
SOUND_STEP
);
sprintf
(
s
->
name
,
"sound/%s%d"
,
name
,
r
/
SOUND_STEP
);
s
->
de
=
devfs_register
(
NULL
,
name_buf
,
DEVFS_FL_NONE
,
SOUND_MAJOR
,
s
->
unit_minor
,
devfs_register
(
NULL
,
s
->
name
,
0
,
SOUND_MAJOR
,
s
->
unit_minor
,
S_IFCHR
|
mode
,
fops
,
NULL
);
S_IFCHR
|
mode
,
fops
,
NULL
);
return
r
;
fail:
kfree
(
s
);
return
r
;
return
r
;
}
}
...
@@ -192,7 +191,7 @@ static void sound_remove_unit(struct sound_unit **list, int unit)
...
@@ -192,7 +191,7 @@ static void sound_remove_unit(struct sound_unit **list, int unit)
p
=
__sound_remove_unit
(
list
,
unit
);
p
=
__sound_remove_unit
(
list
,
unit
);
spin_unlock
(
&
sound_loader_lock
);
spin_unlock
(
&
sound_loader_lock
);
if
(
p
)
{
if
(
p
)
{
devfs_
unregister
(
p
->
d
e
);
devfs_
remove
(
p
->
nam
e
);
kfree
(
p
);
kfree
(
p
);
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment