- if (list_empty(&dev->users)) {
- /* all references have gone away, remove this interface */
- dev->type->free(dev);
+ if (!config_diff(tb, tb1, &device_attr_list, NULL))
+ return DEV_CONFIG_NO_CHANGE;
+
+ device_init_settings(dev, tb);
+ return DEV_CONFIG_APPLIED;
+}
+
+static enum dev_change_type
+device_check_config(struct device *dev, struct blob_attr *attr)
+{
+ if (dev->type->reload)
+ return dev->type->reload(dev, attr);
+
+ return device_reload_config(dev, attr);
+}
+
+static void
+device_replace(struct device *dev, struct device *odev)
+{
+ struct device_user *dep, *tmp;
+ bool present = odev->present;
+
+ if (present)
+ device_set_present(odev, false);
+
+ list_for_each_entry_safe(dep, tmp, &odev->users, list) {
+ list_move_tail(&dep->list, &dev->users);
+ dep->dev = dev;