From 55fc8dc7211f4d53c5254e8ef1fc740a6cc7e284 Mon Sep 17 00:00:00 2001 From: Benjamin Tissoires Date: Sat, 12 Sep 2015 23:31:45 -0400 Subject: [PATCH] roccat/etekcity: check for the presence of the key mapping report ID Removes the duplicate nodes found by the drivers. Signed-off-by: Benjamin Tissoires --- src/driver-etekcity.c | 5 +++++ src/driver-roccat.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/driver-etekcity.c b/src/driver-etekcity.c index 853aad79..471ffd35 100644 --- a/src/driver-etekcity.c +++ b/src/driver-etekcity.c @@ -771,6 +771,11 @@ etekcity_probe(struct ratbag_device *device, const struct ratbag_id id) return -ENODEV; } + if (!ratbag_hidraw_has_report(device, ETEKCITY_REPORT_ID_KEY_MAPPING)) { + ratbag_close_hidraw(device); + return -ENODEV; + } + drv_data = zalloc(sizeof(*drv_data)); ratbag_set_drv_data(device, drv_data); diff --git a/src/driver-roccat.c b/src/driver-roccat.c index 410e710c..17f2a117 100644 --- a/src/driver-roccat.c +++ b/src/driver-roccat.c @@ -784,6 +784,11 @@ roccat_probe(struct ratbag_device *device, const struct ratbag_id id) return -ENODEV; } + if (!ratbag_hidraw_has_report(device, ROCCAT_REPORT_ID_KEY_MAPPING)) { + ratbag_close_hidraw(device); + return -ENODEV; + } + drv_data = zalloc(sizeof(*drv_data)); ratbag_set_drv_data(device, drv_data);