summaryrefslogtreecommitdiff
path: root/drivers/misc/ibmasm/command.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2007-12-03 21:16:20 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2008-01-24 20:40:08 -0800
commita045171f875cd61f690981a78ab98fbd137c938b (patch)
tree322884aeee9d5f5413e9c874be9d0601fef61630 /drivers/misc/ibmasm/command.c
parentd7b37889650bb316f5c4ad4b0569ba897120d70d (diff)
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/command.c')
-rw-r--r--drivers/misc/ibmasm/command.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/misc/ibmasm/command.c b/drivers/misc/ibmasm/command.c
index 6497872df524..1a0e7978226a 100644
--- a/drivers/misc/ibmasm/command.c
+++ b/drivers/misc/ibmasm/command.c
@@ -26,11 +26,6 @@
#include "lowlevel.h"
static void exec_next_command(struct service_processor *sp);
-static void free_command(struct kobject *kobj);
-
-static struct kobj_type ibmasm_cmd_kobj_type = {
- .release = free_command,
-};
static atomic_t command_count = ATOMIC_INIT(0);
@@ -53,8 +48,7 @@ struct command *ibmasm_new_command(struct service_processor *sp, size_t buffer_s
}
cmd->buffer_size = buffer_size;
- kobject_init(&cmd->kobj);
- cmd->kobj.ktype = &ibmasm_cmd_kobj_type;
+ kref_init(&cmd->kref);
cmd->lock = &sp->lock;
cmd->status = IBMASM_CMD_PENDING;
@@ -67,9 +61,9 @@ struct command *ibmasm_new_command(struct service_processor *sp, size_t buffer_s
return cmd;
}
-static void free_command(struct kobject *kobj)
+void ibmasm_free_command(struct kref *kref)
{
- struct command *cmd = to_command(kobj);
+ struct command *cmd = to_command(kref);
list_del(&cmd->queue_node);
atomic_dec(&command_count);