From f56a7fbaa6f155c654e7d01b5c4c0594f21239d6 Mon Sep 17 00:00:00 2001 From: Arne Kappen Date: Thu, 18 Aug 2016 11:35:28 +0200 Subject: device: prepare for adding device handlers dynamically - remove const from device handler struct - pass device handler type to create function Signed-off-by: Arne Kappen Signed-off-by: Felix Fietkau [cleanup] --- tunnel.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'tunnel.c') diff --git a/tunnel.c b/tunnel.c index 4a6c409..ec622d8 100644 --- a/tunnel.c +++ b/tunnel.c @@ -61,7 +61,8 @@ tunnel_reload(struct device *dev, struct blob_attr *attr) } static struct device * -tunnel_create(const char *name, struct blob_attr *attr) +tunnel_create(const char *name, struct device_type *devtype, + struct blob_attr *attr) { struct tunnel *tun; struct device *dev; @@ -71,10 +72,10 @@ tunnel_create(const char *name, struct blob_attr *attr) return NULL; dev = &tun->dev; - device_init(dev, &tunnel_device_type, name); + device_init(dev, devtype, name); tun->set_state = dev->set_state; dev->set_state = tunnel_set_state; - device_apply_config(dev, &tunnel_device_type, attr); + device_apply_config(dev, devtype, attr); device_set_present(dev, true); return dev; @@ -88,7 +89,7 @@ tunnel_free(struct device *dev) free(tun); } -const struct device_type tunnel_device_type = { +struct device_type tunnel_device_type = { .name = "IP tunnel", .config_params = &tunnel_attr_list, .reload = tunnel_reload, -- cgit v1.2.3