summaryrefslogtreecommitdiffhomepage
path: root/device.h
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-04-05 03:48:59 +0200
committerFelix Fietkau <nbd@openwrt.org>2011-04-05 03:48:59 +0200
commitb18fb36bd3c7615733c351c99691e1139f386c0c (patch)
treebb6d8d5c1015379fcf9864c3bda5d7b0c9d4ac2b /device.h
parent6443a383c54dee0cd3b9858801e0b765147a4ef4 (diff)
add a helper function for freeing a device
Diffstat (limited to 'device.h')
-rw-r--r--device.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/device.h b/device.h
index bfd044a..79aec32 100644
--- a/device.h
+++ b/device.h
@@ -82,6 +82,12 @@ struct device_hotplug_ops {
int (*del)(struct device *main, struct device *member);
};
+static inline void
+free_device(struct device *dev)
+{
+ dev->type->free(dev);
+}
+
void init_virtual_device(struct device *dev, const struct device_type *type, const char *name);
int init_device(struct device *iface, const struct device_type *type, const char *ifname);
void cleanup_device(struct device *iface);