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:
Peter Hutterer
2016-04-28 15:40:03 +10:00
parent e18e25d685
commit 0785bf138d
2 changed files with 8 additions and 5 deletions

View File

@@ -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;
}

View File

@@ -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;