* 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:
parent
1d99d469a0
commit
215772237b
@ -48,9 +48,11 @@ remove_device_info(hid_device_info *device)
|
||||
|
||||
acquire_sem(gDeviceListLock);
|
||||
|
||||
if (sDeviceList == device)
|
||||
if (sDeviceList == device) {
|
||||
sDeviceList = device->next;
|
||||
else {
|
||||
--sDeviceCount;
|
||||
gDeviceListChanged = true;
|
||||
} else {
|
||||
hid_device_info *previous;
|
||||
for (previous = sDeviceList; previous != NULL; previous = previous->next) {
|
||||
if (previous->next == device) {
|
||||
|
@ -21,10 +21,6 @@
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
|
||||
#include <fs/devfs.h>
|
||||
#endif
|
||||
|
||||
#define MAX_BUTTONS 16
|
||||
|
||||
static status_t hid_device_added(const usb_device *dev, void **cookie);
|
||||
@ -876,13 +872,13 @@ hid_device_removed(void *cookie)
|
||||
free(device->insns);
|
||||
delete_device(device);
|
||||
} 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));
|
||||
device->active = false;
|
||||
}
|
||||
|
||||
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
|
||||
devfs_unpublish_device(device->name, true);
|
||||
#endif
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user