add debug messages for device config changes
authorFelix Fietkau <nbd@openwrt.org>
Wed, 5 Oct 2011 23:13:34 +0000 (01:13 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Wed, 5 Oct 2011 23:13:34 +0000 (01:13 +0200)
device.c

index c6765b0ce174e94509cf2a935584d72d34da48fa..b40f661bf84bd500a5470e38b15a2d74e2e79203 100644 (file)
--- a/device.c
+++ b/device.c
@@ -377,17 +377,21 @@ device_create(const char *name, const struct device_type *type,
                change = device_check_config(odev, config);
                switch (change) {
                case DEV_CONFIG_APPLIED:
+                       D(DEVICE, "Device '%s': config applied\n", odev->ifname);
                        free(odev->config);
                        odev->config = config;
                        if (odev->present) {
                                device_set_present(odev, false);
                                device_set_present(odev, true);
                        }
-                       /* fall through */
+                       free(config);
+                       return odev;
                case DEV_CONFIG_NO_CHANGE:
+                       D(DEVICE, "Device '%s': no configuration change\n", odev->ifname);
                        free(config);
                        return odev;
                case DEV_CONFIG_RECREATE:
+                       D(DEVICE, "Device '%s': recreate device\n", odev->ifname);
                        break;
                }
        }