summaryrefslogtreecommitdiffhomepage
path: root/device.h
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-09-04 15:00:25 +0200
committerFelix Fietkau <nbd@openwrt.org>2011-09-04 15:00:25 +0200
commit4e335f640fadda81aff9dd2dc06703961bea2826 (patch)
treebc9618ea20fdd6328f534488413dadd5530146ce /device.h
parentdca8c7133b1db463f6ae71ccc6d34cd12735daef (diff)
make device_claim/device_release operate on the device_user instead of the device to avoid refcount bugs
Diffstat (limited to 'device.h')
-rw-r--r--device.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/device.h b/device.h
index e11df1f..63ffb21 100644
--- a/device.h
+++ b/device.h
@@ -124,6 +124,7 @@ enum device_event {
struct device_user {
struct list_head list;
+ bool claimed;
struct device *dev;
void (*cb)(struct device_user *, enum device_event);
};
@@ -147,8 +148,8 @@ void device_add_user(struct device_user *dep, struct device *iface);
void device_remove_user(struct device_user *dep);
void device_set_present(struct device *dev, bool state);
-int device_claim(struct device *dev);
-void device_release(struct device *dev);
+int device_claim(struct device_user *dep);
+void device_release(struct device_user *dep);
int check_device_state(struct device *dev);
static inline void