aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/ibmasm/command.c
diff options
context:
space:
mode:
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 @@
26#include "lowlevel.h" 26#include "lowlevel.h"
27 27
28static void exec_next_command(struct service_processor *sp); 28static void exec_next_command(struct service_processor *sp);
29static void free_command(struct kobject *kobj);
30
31static struct kobj_type ibmasm_cmd_kobj_type = {
32 .release = free_command,
33};
34 29
35static atomic_t command_count = ATOMIC_INIT(0); 30static atomic_t command_count = ATOMIC_INIT(0);
36 31
@@ -53,8 +48,7 @@ struct command *ibmasm_new_command(struct service_processor *sp, size_t buffer_s
53 } 48 }
54 cmd->buffer_size = buffer_size; 49 cmd->buffer_size = buffer_size;
55 50
56 kobject_init(&cmd->kobj); 51 kref_init(&cmd->kref);
57 cmd->kobj.ktype = &ibmasm_cmd_kobj_type;
58 cmd->lock = &sp->lock; 52 cmd->lock = &sp->lock;
59 53
60 cmd->status = IBMASM_CMD_PENDING; 54 cmd->status = IBMASM_CMD_PENDING;
@@ -67,9 +61,9 @@ struct command *ibmasm_new_command(struct service_processor *sp, size_t buffer_s
67 return cmd; 61 return cmd;
68} 62}
69 63
70static void free_command(struct kobject *kobj) 64void ibmasm_free_command(struct kref *kref)
71{ 65{
72 struct command *cmd = to_command(kobj); 66 struct command *cmd = to_command(kref);
73 67
74 list_del(&cmd->queue_node); 68 list_del(&cmd->queue_node);
75 atomic_dec(&command_count); 69 atomic_dec(&command_count);