View | Details | Raw Unified | Return to bug 25799
Collapse All | Expand All

(-)sound.c (-3 / +11 lines)
Lines 90-96 Link Here
90
90
91
#ifdef USING_DEVFS
91
#ifdef USING_DEVFS
92
int snd_unit;
92
int snd_unit;
93
TUNABLE_INT_DECL("hw.snd.unit", 0, snd_unit);
93
TUNABLE_INT_DECL("hw.snd.unit", -1, snd_unit);
94
#endif
94
#endif
95
95
96
SYSCTL_NODE(_hw, OID_AUTO, snd, CTLFLAG_RD, 0, "Sound driver");
96
SYSCTL_NODE(_hw, OID_AUTO, snd, CTLFLAG_RD, 0, "Sound driver");
Lines 193-200 Link Here
193
	}
193
	}
194
194
195
	unit = snd_unit;
195
	unit = snd_unit;
196
	if (unit < 0 || unit > devclass_get_maxunit(pcm_devclass))
196
	if (unit == -1) {
197
		return;
197
		/* find the first unit */
198
		for(unit = 0;
199
		    unit <= devclass_get_maxunit(pcm_devclass); ++unit)
200
			if (devclass_get_softc(pcm_devclass, unit) != NULL)
201
				break;
202
	} else {
203
		if (unit < 0 || unit > devclass_get_maxunit(pcm_devclass))
204
			return;
205
	}
198
	if (devclass_get_softc(pcm_devclass, unit) == NULL)
206
	if (devclass_get_softc(pcm_devclass, unit) == NULL)
199
		return;
207
		return;

Return to bug 25799