1
0
forked from drath/libratbag

Merge pull request #79 from whot/master

Fix a couple of error messages
This commit is contained in:
bentiss
2016-03-16 10:17:06 +01:00
6 changed files with 13 additions and 38 deletions

View File

@@ -636,13 +636,8 @@ etekcity_probe(struct ratbag_device *device)
int active_idx;
rc = ratbag_open_hidraw(device);
if (rc) {
log_error(device->ratbag,
"Can't open corresponding hidraw node: '%s' (%d)\n",
strerror(-rc),
rc);
return -ENODEV;
}
if (rc)
return rc;
if (!ratbag_hidraw_has_report(device, ETEKCITY_REPORT_ID_KEY_MAPPING)) {
ratbag_close_hidraw(device);
@@ -670,8 +665,8 @@ etekcity_probe(struct ratbag_device *device)
if (active_idx < 0) {
log_error(device->ratbag,
"Can't talk to the mouse: '%s' (%d)\n",
strerror(-rc),
rc);
strerror(-active_idx),
active_idx);
rc = -ENODEV;
goto err;
}

View File

@@ -504,16 +504,8 @@ hidpp10drv_probe(struct ratbag_device *device)
int nread = 0;
rc = ratbag_find_hidraw(device, hidpp10drv_test_hidraw);
if (rc == -ENODEV) {
return rc;
} else if (rc) {
log_error(device->ratbag,
"Can't open corresponding hidraw node: '%s' (%d)\n",
strerror(-rc),
rc);
rc = -ENODEV;
if (rc)
goto err;
}
drv_data = zalloc(sizeof(*drv_data));
hidpp_device_init(&base, device->hidraw.fd);

View File

@@ -782,15 +782,8 @@ hidpp20drv_probe(struct ratbag_device *device)
struct hidpp20_device *dev;
rc = ratbag_find_hidraw(device, hidpp20drv_test_hidraw);
if (rc == -ENODEV) {
if (rc)
return rc;
} else if (rc) {
log_error(device->ratbag,
"Can't open corresponding hidraw node: '%s' (%d)\n",
strerror(-rc),
rc);
return -ENODEV;
}
drv_data = zalloc(sizeof(*drv_data));
ratbag_set_drv_data(device, drv_data);

View File

@@ -780,13 +780,8 @@ roccat_probe(struct ratbag_device *device)
int active_idx;
rc = ratbag_open_hidraw(device);
if (rc) {
log_error(device->ratbag,
"Can't open corresponding hidraw node: '%s' (%d)\n",
strerror(-rc),
rc);
return -ENODEV;
}
if (rc)
return rc;
if (!ratbag_hidraw_has_report(device, ROCCAT_REPORT_ID_KEY_MAPPING)) {
ratbag_close_hidraw(device);
@@ -808,8 +803,8 @@ roccat_probe(struct ratbag_device *device)
if (active_idx < 0) {
log_error(device->ratbag,
"Can't talk to the mouse: '%s' (%d)\n",
strerror(-rc),
rc);
strerror(-active_idx),
active_idx);
rc = -ENODEV;
goto err;
}

View File

@@ -1424,7 +1424,6 @@ ratbag_find_hidraw_node(struct ratbag_device *device,
skip:
ratbag_close_hidraw(device);
rc = -ENODEV;
}
out:

View File

@@ -329,8 +329,9 @@ ratbag_assign_driver(struct ratbag_device *device,
device->driver = NULL;
if (rc == -ENODEV)
log_error(ratbag, "%s: no hidraw device found\n", device->name);
if (rc != -ENODEV)
log_error(ratbag, "%s: error opening hidraw node (%s)\n",
device->name, strerror(-rc));
return false;
}