assert(m);
- if (device_for_action(d, DEVICE_ACTION_REMOVE)) {
+ if (device_for_action(d, DEVICE_ACTION_REMOVE) ||
+ sd_device_has_current_tag(d, "seat") <= 0) {
const char *syspath;
r = sd_device_get_syspath(d, &syspath);
}
seat = hashmap_get(m->seats, sn);
- master = sd_device_has_tag(d, "master-of-seat") > 0;
+ master = sd_device_has_current_tag(d, "master-of-seat") > 0;
/* Ignore non-master devices for unknown seats */
if (!master && !seat)
if (r < 0)
return r;
- if (device_for_action(d, DEVICE_ACTION_REMOVE)) {
+ if (device_for_action(d, DEVICE_ACTION_REMOVE) ||
+ sd_device_has_current_tag(d, "power-switch") <= 0) {
b = hashmap_get(m->buttons, sysname);
if (!b)
if (r < 0)
return r;
- if (sd_device_has_tag(d, "seat") <= 0)
+ if (sd_device_has_current_tag(d, "seat") <= 0)
return -ENODEV;
if (sd_device_get_property_value(d, "ID_FOR_SEAT", &id_for_seat) < 0)
/* Explicitly also check for tag 'seat' here */
if (!streq(seat, sn) ||
- sd_device_has_tag(dev_list[*i_dev], "seat") <= 0 ||
+ sd_device_has_current_tag(dev_list[*i_dev], "seat") <= 0 ||
sd_device_get_subsystem(dev_list[*i_dev], &subsystem) < 0 ||
sd_device_get_sysname(dev_list[*i_dev], &sysname) < 0) {
(*i_dev)++;
continue;
}
- is_master = sd_device_has_tag(dev_list[*i_dev], "master-of-seat") > 0;
+ is_master = sd_device_has_current_tag(dev_list[*i_dev], "master-of-seat") > 0;
if (sd_device_get_sysattr_value(dev_list[*i_dev], "name", &name) < 0)
(void) sd_device_get_sysattr_value(dev_list[*i_dev], "id", &name);
isempty(lookahead_sn))
lookahead_sn = "seat0";
- if (streq(seat, lookahead_sn) && sd_device_has_tag(dev_list[lookahead], "seat") > 0)
+ if (streq(seat, lookahead_sn) && sd_device_has_current_tag(dev_list[lookahead], "seat") > 0)
break;
}
}