mirror of
https://github.com/libratbag/libratbag.git
synced 2026-11-07 23:23:52 +01:00
Drop the 'device' argument from libratbag_device_set_active_profile
The profile is bound to a device anyway. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
@@ -585,9 +585,9 @@ ratbag_device_has_capability(const struct ratbag_device *device,
|
||||
}
|
||||
|
||||
LIBRATBAG_EXPORT int
|
||||
ratbag_device_set_active_profile(struct ratbag_device *device,
|
||||
struct ratbag_profile *profile)
|
||||
ratbag_device_set_active_profile(struct ratbag_profile *profile)
|
||||
{
|
||||
struct ratbag_device *device = profile->device;
|
||||
int rc;
|
||||
|
||||
assert(device->driver->write_profile);
|
||||
|
||||
@@ -344,14 +344,12 @@ ratbag_device_get_active_profile(struct ratbag_device *ratbag);
|
||||
*
|
||||
* This function sets the currently active profile to the one provided.
|
||||
*
|
||||
* @param ratbag A previously initialized ratbag context
|
||||
* @param profile The profile to make the active profile.
|
||||
*
|
||||
* @return 0 on success or nonzero otherwise.
|
||||
*/
|
||||
int
|
||||
ratbag_device_set_active_profile(struct ratbag_device *ratbag,
|
||||
struct ratbag_profile *profile);
|
||||
ratbag_device_set_active_profile(struct ratbag_profile *profile);
|
||||
|
||||
/**
|
||||
* @ingroup device
|
||||
|
||||
@@ -339,7 +339,7 @@ ratbag_cmd_switch_profile(struct ratbag *ratbag, uint32_t flags, int argc, char
|
||||
}
|
||||
|
||||
if (active_profile != profile) {
|
||||
rc = ratbag_device_set_active_profile(device, profile);
|
||||
rc = ratbag_device_set_active_profile(profile);
|
||||
if (!rc)
|
||||
printf("Switched '%s' to profile '%d'\n",
|
||||
ratbag_device_get_name(device), index);
|
||||
@@ -418,7 +418,7 @@ ratbag_cmd_switch_etekcity(struct ratbag *ratbag, uint32_t flags, int argc, char
|
||||
if (!commit)
|
||||
goto out;
|
||||
|
||||
rc = ratbag_device_set_active_profile(device, profile);
|
||||
rc = ratbag_device_set_active_profile(profile);
|
||||
if (!rc)
|
||||
printf("Switched the current profile of '%s' to %sreport the volume keys\n",
|
||||
ratbag_device_get_name(device),
|
||||
@@ -489,7 +489,7 @@ ratbag_cmd_change_button(struct ratbag *ratbag, uint32_t flags, int argc, char *
|
||||
goto out;
|
||||
}
|
||||
|
||||
rc = ratbag_device_set_active_profile(device, profile);
|
||||
rc = ratbag_device_set_active_profile(profile);
|
||||
if (rc) {
|
||||
error("Unable to apply the current profile: %s (%d)\n",
|
||||
strerror(-rc),
|
||||
|
||||
Reference in New Issue
Block a user