aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/macintosh/windfarm_smu_controls.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/macintosh/windfarm_smu_controls.c')
-rw-r--r--drivers/macintosh/windfarm_smu_controls.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/macintosh/windfarm_smu_controls.c b/drivers/macintosh/windfarm_smu_controls.c
index a9e88edc0c72..31b750d61206 100644
--- a/drivers/macintosh/windfarm_smu_controls.c
+++ b/drivers/macintosh/windfarm_smu_controls.c
@@ -56,7 +56,7 @@ static int smu_set_fan(int pwm, u8 id, u16 value)
56{ 56{
57 struct smu_cmd cmd; 57 struct smu_cmd cmd;
58 u8 buffer[16]; 58 u8 buffer[16];
59 DECLARE_COMPLETION(comp); 59 DECLARE_COMPLETION_ONSTACK(comp);
60 int rc; 60 int rc;
61 61
62 /* Fill SMU command structure */ 62 /* Fill SMU command structure */
@@ -159,14 +159,15 @@ static struct smu_fan_control *smu_fan_create(struct device_node *node,
159 int pwm_fan) 159 int pwm_fan)
160{ 160{
161 struct smu_fan_control *fct; 161 struct smu_fan_control *fct;
162 s32 *v; u32 *reg; 162 const s32 *v;
163 char *l; 163 const u32 *reg;
164 const char *l;
164 165
165 fct = kmalloc(sizeof(struct smu_fan_control), GFP_KERNEL); 166 fct = kmalloc(sizeof(struct smu_fan_control), GFP_KERNEL);
166 if (fct == NULL) 167 if (fct == NULL)
167 return NULL; 168 return NULL;
168 fct->ctrl.ops = &smu_fan_ops; 169 fct->ctrl.ops = &smu_fan_ops;
169 l = (char *)get_property(node, "location", NULL); 170 l = get_property(node, "location", NULL);
170 if (l == NULL) 171 if (l == NULL)
171 goto fail; 172 goto fail;
172 173
@@ -223,17 +224,17 @@ static struct smu_fan_control *smu_fan_create(struct device_node *node,
223 goto fail; 224 goto fail;
224 225
225 /* Get min & max values*/ 226 /* Get min & max values*/
226 v = (s32 *)get_property(node, "min-value", NULL); 227 v = get_property(node, "min-value", NULL);
227 if (v == NULL) 228 if (v == NULL)
228 goto fail; 229 goto fail;
229 fct->min = *v; 230 fct->min = *v;
230 v = (s32 *)get_property(node, "max-value", NULL); 231 v = get_property(node, "max-value", NULL);
231 if (v == NULL) 232 if (v == NULL)
232 goto fail; 233 goto fail;
233 fct->max = *v; 234 fct->max = *v;
234 235
235 /* Get "reg" value */ 236 /* Get "reg" value */
236 reg = (u32 *)get_property(node, "reg", NULL); 237 reg = get_property(node, "reg", NULL);
237 if (reg == NULL) 238 if (reg == NULL)
238 goto fail; 239 goto fail;
239 fct->reg = *reg; 240 fct->reg = *reg;