aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/ibmasm/ibmasm.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/misc/ibmasm/ibmasm.h')
-rw-r--r--drivers/misc/ibmasm/ibmasm.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/misc/ibmasm/ibmasm.h b/drivers/misc/ibmasm/ibmasm.h
index 653a7d096a8b..ecce4ffd3e23 100644
--- a/drivers/misc/ibmasm/ibmasm.h
+++ b/drivers/misc/ibmasm/ibmasm.h
@@ -95,12 +95,17 @@ struct command {
95 size_t buffer_size; 95 size_t buffer_size;
96 int status; 96 int status;
97 struct kobject kobj; 97 struct kobject kobj;
98 spinlock_t *lock;
98}; 99};
99#define to_command(c) container_of(c, struct command, kobj) 100#define to_command(c) container_of(c, struct command, kobj)
100 101
101static inline void command_put(struct command *cmd) 102static inline void command_put(struct command *cmd)
102{ 103{
104 unsigned long flags;
105
106 spin_lock_irqsave(cmd->lock, flags);
103 kobject_put(&cmd->kobj); 107 kobject_put(&cmd->kobj);
108 spin_unlock_irqrestore(cmd->lock, flags);
104} 109}
105 110
106static inline void command_get(struct command *cmd) 111static inline void command_get(struct command *cmd)
@@ -159,7 +164,7 @@ struct service_processor {
159}; 164};
160 165
161/* command processing */ 166/* command processing */
162extern struct command *ibmasm_new_command(size_t buffer_size); 167extern struct command *ibmasm_new_command(struct service_processor *sp, size_t buffer_size);
163extern void ibmasm_exec_command(struct service_processor *sp, struct command *cmd); 168extern void ibmasm_exec_command(struct service_processor *sp, struct command *cmd);
164extern void ibmasm_wait_for_response(struct command *cmd, int timeout); 169extern void ibmasm_wait_for_response(struct command *cmd, int timeout);
165extern void ibmasm_receive_command_response(struct service_processor *sp, void *response, size_t size); 170extern void ibmasm_receive_command_response(struct service_processor *sp, void *response, size_t size);