* Fixed removing from device list with only one device info present
* Removed now unnecessary devfs calls again * Add an explanation in device_removed() git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23442 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -48,9 +48,11 @@ remove_device_info(hid_device_info *device)
|
|||||||
|
|
||||||
acquire_sem(gDeviceListLock);
|
acquire_sem(gDeviceListLock);
|
||||||
|
|
||||||
if (sDeviceList == device)
|
if (sDeviceList == device) {
|
||||||
sDeviceList = device->next;
|
sDeviceList = device->next;
|
||||||
else {
|
--sDeviceCount;
|
||||||
|
gDeviceListChanged = true;
|
||||||
|
} else {
|
||||||
hid_device_info *previous;
|
hid_device_info *previous;
|
||||||
for (previous = sDeviceList; previous != NULL; previous = previous->next) {
|
for (previous = sDeviceList; previous != NULL; previous = previous->next) {
|
||||||
if (previous->next == device) {
|
if (previous->next == device) {
|
||||||
|
|||||||
@@ -21,10 +21,6 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
|
|
||||||
#include <fs/devfs.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MAX_BUTTONS 16
|
#define MAX_BUTTONS 16
|
||||||
|
|
||||||
static status_t hid_device_added(const usb_device *dev, void **cookie);
|
static status_t hid_device_added(const usb_device *dev, void **cookie);
|
||||||
@@ -876,13 +872,13 @@ hid_device_removed(void *cookie)
|
|||||||
free(device->insns);
|
free(device->insns);
|
||||||
delete_device(device);
|
delete_device(device);
|
||||||
} else {
|
} else {
|
||||||
|
// If the input_server has opened us this will always be the case.
|
||||||
|
// We unpublish our node in the devfs which will notify the mouse
|
||||||
|
// add-on to unregister and release us.
|
||||||
DPRINTF_INFO((MY_ID "%s still open\n", device->name));
|
DPRINTF_INFO((MY_ID "%s still open\n", device->name));
|
||||||
device->active = false;
|
device->active = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
|
|
||||||
devfs_unpublish_device(device->name, true);
|
|
||||||
#endif
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user