mirror of
https://github.com/libratbag/libratbag.git
synced 2026-11-07 23:23:52 +01:00
hidpp20: fail for hidpp10 devices
hidpp10 devices have their own driver, let's not initialize them here and just fail. If a hidpp10 device is assigned the hidpp20 driver this is a bug. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
@@ -808,11 +808,9 @@ hidpp20drv_probe(struct ratbag_device *device)
|
||||
drv_data->num_resolutions = 1;
|
||||
drv_data->num_buttons = 8;
|
||||
|
||||
if (dev->proto_major >= 2) {
|
||||
rc = hidpp20drv_20_probe(device);
|
||||
if (rc)
|
||||
goto err;
|
||||
}
|
||||
rc = hidpp20drv_20_probe(device);
|
||||
if (rc)
|
||||
goto err;
|
||||
|
||||
ratbag_device_init_profiles(device,
|
||||
drv_data->num_profiles,
|
||||
@@ -823,6 +821,8 @@ hidpp20drv_probe(struct ratbag_device *device)
|
||||
err:
|
||||
free(drv_data);
|
||||
ratbag_set_drv_data(device, NULL);
|
||||
if (dev)
|
||||
hidpp20_device_destroy(dev);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
@@ -1892,6 +1892,9 @@ hidpp20_device_new(const struct hidpp_device *base, unsigned int idx)
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (dev->proto_major < 2)
|
||||
goto err;
|
||||
|
||||
rc = hidpp20_feature_set_get(dev);
|
||||
if (rc < 0)
|
||||
goto err;
|
||||
|
||||
Reference in New Issue
Block a user