does no longer crash, calles attach and detach
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7108 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -20,7 +20,6 @@ KernelLd ichaudio :
|
|||||||
-Bdynamic -shared
|
-Bdynamic -shared
|
||||||
:
|
:
|
||||||
:
|
:
|
||||||
add-ons/kernel/drivers/bin
|
|
||||||
;
|
;
|
||||||
|
|
||||||
SubInclude OBOS_TOP src add-ons kernel drivers audio ac97 ichaudio lala ;
|
SubInclude OBOS_TOP src add-ons kernel drivers audio ac97 ichaudio lala ;
|
||||||
|
|||||||
@@ -129,12 +129,12 @@ ich_open(const char *name, uint32 flags, void** cookie)
|
|||||||
}
|
}
|
||||||
*cookie = (void *) index;
|
*cookie = (void *) index;
|
||||||
|
|
||||||
if (drv_data[drv_count]->open_count == 0) {
|
if (drv_data[index]->open_count == 0) {
|
||||||
res = driver_info.attach(drv_data[index], &drv_data[index]->cookie);
|
res = driver_info.attach(drv_data[index], &drv_data[index]->cookie);
|
||||||
drv_data[drv_count]->open_count = (res == B_OK) ? 1 : 0;
|
drv_data[index]->open_count = (res == B_OK) ? 1 : 0;
|
||||||
} else {
|
} else {
|
||||||
res = B_OK;
|
res = B_OK;
|
||||||
drv_data[drv_count]->open_count++;
|
drv_data[index]->open_count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
release_sem(drv_sem);
|
release_sem(drv_sem);
|
||||||
@@ -161,9 +161,9 @@ ich_free(void* cookie)
|
|||||||
|
|
||||||
acquire_sem(drv_sem);
|
acquire_sem(drv_sem);
|
||||||
|
|
||||||
drv_data[drv_count]->open_count--;
|
drv_data[index]->open_count--;
|
||||||
|
|
||||||
if (drv_data[drv_count]->open_count == 0)
|
if (drv_data[index]->open_count == 0)
|
||||||
res = driver_info.detach(drv_data[index], drv_data[index]->cookie);
|
res = driver_info.detach(drv_data[index], drv_data[index]->cookie);
|
||||||
else
|
else
|
||||||
res = B_OK;
|
res = B_OK;
|
||||||
|
|||||||
Reference in New Issue
Block a user