Remove the get_active_profile driver hook

Long-term we should have probe() and read_profile(), the latter of which
should read each profile and fill in _all_ information.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer
2015-08-28 12:04:18 +10:00
parent f5340d31e3
commit aa27fbae8d
4 changed files with 4 additions and 26 deletions

View File

@@ -744,7 +744,6 @@ struct ratbag_driver etekcity_driver = {
.remove = etekcity_remove,
.read_profile = etekcity_read_profile,
.write_profile = etekcity_write_profile,
.get_active_profile = etekcity_current_profile,
.set_active_profile = etekcity_set_current_profile,
.has_capability = etekcity_has_capability,
.read_button = etekcity_read_button,

View File

@@ -104,22 +104,6 @@ hidpp10drv_has_capability(const struct ratbag_device *device, enum ratbag_capabi
return 0;
}
static int
hidpp10drv_current_profile(struct ratbag_device *device)
{
struct hidpp10drv_data *drv_data;
struct hidpp10_device *hidpp10;
int8_t profile;
int rc;
drv_data = ratbag_get_drv_data(device);
hidpp10 = drv_data->dev;
rc = hidpp10_get_current_profile(hidpp10, &profile);
return rc >= 0 ? profile : rc;
}
static int
hidpp10drv_set_current_profile(struct ratbag_device *device, unsigned int index)
{
@@ -284,7 +268,6 @@ struct ratbag_driver hidpp10_driver = {
.remove = hidpp10drv_remove,
.read_profile = hidpp10drv_read_profile,
.write_profile = hidpp10drv_write_profile,
.get_active_profile = hidpp10drv_current_profile,
.set_active_profile = hidpp10drv_set_current_profile,
.has_capability = hidpp10drv_has_capability,
.read_button = hidpp10drv_read_button,

View File

@@ -313,6 +313,10 @@ hidpp20drv_read_profile(struct ratbag_profile *profile, unsigned int index)
hidpp20drv_read_resolution_dpi(profile);
hidpp20drv_read_special_key_mouse(device);
profile->is_active = false;
if ((int)index == hidpp20drv_current_profile(device))
profile->is_active = true;
}
static int
@@ -496,7 +500,6 @@ struct ratbag_driver hidpp20_driver = {
.remove = hidpp20drv_remove,
.read_profile = hidpp20drv_read_profile,
.write_profile = hidpp20drv_write_profile,
.get_active_profile = hidpp20drv_current_profile,
.set_active_profile = hidpp20drv_set_current_profile,
.has_capability = hidpp20drv_has_capability,
.read_button = hidpp20drv_read_button,

View File

@@ -119,13 +119,6 @@ struct ratbag_driver {
*/
int (*write_profile)(struct ratbag_profile *profile);
/** called when the user of libratbag wants to know which
* current profile is in use.
*
* It is fundamentally racy.
*/
int (*get_active_profile)(struct ratbag_device *device);
/** called to mark a previously writen profile as active.
*
* There should be no need to write the profile here, a