Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F140122421
D50409.id155652.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D50409.id155652.diff
View Options
diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c
--- a/sys/dev/sound/pcm/sound.c
+++ b/sys/dev/sound/pcm/sound.c
@@ -57,8 +57,6 @@
SYSCTL_NODE(_hw, OID_AUTO, snd, CTLFLAG_RD | CTLFLAG_MPSAFE, 0,
"Sound driver");
-static void pcm_sysinit(device_t);
-
/**
* @brief Unit number allocator for syncgroup IDs
*/
@@ -351,41 +349,6 @@
return (sysctl_handle_int(oidp, &mode, 0, req));
}
-static void
-pcm_sysinit(device_t dev)
-{
- struct snddev_info *d = device_get_softc(dev);
-
- sysctl_ctx_init(&d->play_sysctl_ctx);
- d->play_sysctl_tree = SYSCTL_ADD_NODE(&d->play_sysctl_ctx,
- SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "play",
- CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "playback channels node");
- sysctl_ctx_init(&d->rec_sysctl_ctx);
- d->rec_sysctl_tree = SYSCTL_ADD_NODE(&d->rec_sysctl_ctx,
- SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "rec",
- CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "recording channels node");
-
- /* XXX: a user should be able to set this with a control tool, the
- sysadmin then needs min+max sysctls for this */
- SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev),
- SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
- OID_AUTO, "buffersize", CTLFLAG_RD, &d->bufsz, 0, "allocated buffer size");
- SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
- SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
- "bitperfect", CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, d,
- sizeof(d), sysctl_dev_pcm_bitperfect, "I",
- "bit-perfect playback/recording (0=disable, 1=enable)");
- SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
- SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
- "mode", CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, d, sizeof(d),
- sysctl_dev_pcm_mode, "I",
- "mode (1=mixer, 2=play, 4=rec. The values are OR'ed if more than "
- "one mode is supported)");
- vchan_initsys(dev);
- if (d->flags & SD_F_EQ)
- feeder_eq_initsys(dev);
-}
-
/*
* Basic initialization so that drivers can use pcm_addchan() before
* pcm_register().
@@ -455,7 +418,34 @@
* Create all sysctls once SD_F_REGISTERED is set else
* tunable sysctls won't work:
*/
- pcm_sysinit(dev);
+ sysctl_ctx_init(&d->play_sysctl_ctx);
+ d->play_sysctl_tree = SYSCTL_ADD_NODE(&d->play_sysctl_ctx,
+ SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "play",
+ CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "playback channels node");
+ sysctl_ctx_init(&d->rec_sysctl_ctx);
+ d->rec_sysctl_tree = SYSCTL_ADD_NODE(&d->rec_sysctl_ctx,
+ SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "rec",
+ CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "recording channels node");
+
+ /* XXX: a user should be able to set this with a control tool, the
+ sysadmin then needs min+max sysctls for this */
+ SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev),
+ SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
+ OID_AUTO, "buffersize", CTLFLAG_RD, &d->bufsz, 0, "allocated buffer size");
+ SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
+ SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
+ "bitperfect", CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, d,
+ sizeof(d), sysctl_dev_pcm_bitperfect, "I",
+ "bit-perfect playback/recording (0=disable, 1=enable)");
+ SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
+ SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
+ "mode", CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, d, sizeof(d),
+ sysctl_dev_pcm_mode, "I",
+ "mode (1=mixer, 2=play, 4=rec. The values are OR'ed if more than "
+ "one mode is supported)");
+ vchan_initsys(dev);
+ if (d->flags & SD_F_EQ)
+ feeder_eq_initsys(dev);
if (snd_unit_auto < 0)
snd_unit_auto = (snd_unit < 0) ? 1 : 0;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 21, 1:12 PM (8 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27113571
Default Alt Text
D50409.id155652.diff (3 KB)
Attached To
Mode
D50409: sound: Merge pcm_sysinit() with pcm_register()
Attached
Detach File
Event Timeline
Log In to Comment