diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2007-12-04 05:16:20 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-01-25 05:40:08 +0100 |
commit | a045171f875cd61f690981a78ab98fbd137c938b (patch) | |
tree | 322884aeee9d5f5413e9c874be9d0601fef61630 /drivers/misc/ibmasm/ibmasm.h | |
parent | sysfs: remove SPIN_LOCK_UNLOCKED (diff) | |
download | linux-a045171f875cd61f690981a78ab98fbd137c938b.tar.xz linux-a045171f875cd61f690981a78ab98fbd137c938b.zip |
kobject: convert ibmasm to use kref, not kobject
The IBM asm driver is using a kobject only for reference counting,
nothing else. So switch it to use a kref instead, which is all that is
needed, and is much smaller.
Cc: Max Asböck <amax@us.ibm.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/misc/ibmasm/ibmasm.h')
-rw-r--r-- | drivers/misc/ibmasm/ibmasm.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/misc/ibmasm/ibmasm.h b/drivers/misc/ibmasm/ibmasm.h index de860bc6d3f5..4d8a4e248b34 100644 --- a/drivers/misc/ibmasm/ibmasm.h +++ b/drivers/misc/ibmasm/ibmasm.h @@ -31,6 +31,7 @@ #include <linux/slab.h> #include <linux/module.h> #include <linux/interrupt.h> +#include <linux/kref.h> #include <linux/device.h> #include <linux/input.h> @@ -92,24 +93,25 @@ struct command { unsigned char *buffer; size_t buffer_size; int status; - struct kobject kobj; + struct kref kref; spinlock_t *lock; }; -#define to_command(c) container_of(c, struct command, kobj) +#define to_command(c) container_of(c, struct command, kref) +void ibmasm_free_command(struct kref *kref); static inline void command_put(struct command *cmd) { unsigned long flags; spinlock_t *lock = cmd->lock; spin_lock_irqsave(lock, flags); - kobject_put(&cmd->kobj); + kref_put(&cmd->kref, ibmasm_free_command); spin_unlock_irqrestore(lock, flags); } static inline void command_get(struct command *cmd) { - kobject_get(&cmd->kobj); + kref_get(&cmd->kref); } |