aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/keyboard/maple_keyb.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2008-08-03 21:58:24 -0400
committerPaul Mundt <lethal@linux-sh.org>2008-08-03 21:58:24 -0400
commit617870632de6739fca0893f3e6648e9ae1bd0ddb (patch)
treecad36762206a99ee6317290f3d58d818f18f5c58 /drivers/input/keyboard/maple_keyb.c
parent63870295de9adb365cd121dab94379b8cfdf986a (diff)
maple: Kill useless private_data pointer.
We can simply wrap in to the dev_set/get_drvdata(), there's no reason to track an extra level of private data on top of the struct device. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/input/keyboard/maple_keyb.c')
-rw-r--r--drivers/input/keyboard/maple_keyb.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/input/keyboard/maple_keyb.c b/drivers/input/keyboard/maple_keyb.c
index 3f5151a0fd15..22f17a593be7 100644
--- a/drivers/input/keyboard/maple_keyb.c
+++ b/drivers/input/keyboard/maple_keyb.c
@@ -139,7 +139,7 @@ static void dc_scan_kbd(struct dc_kbd *kbd)
139static void dc_kbd_callback(struct mapleq *mq) 139static void dc_kbd_callback(struct mapleq *mq)
140{ 140{
141 struct maple_device *mapledev = mq->dev; 141 struct maple_device *mapledev = mq->dev;
142 struct dc_kbd *kbd = mapledev->private_data; 142 struct dc_kbd *kbd = maple_get_drvdata(mapledev);
143 unsigned long *buf = mq->recvbuf; 143 unsigned long *buf = mq->recvbuf;
144 144
145 /* 145 /*
@@ -175,8 +175,6 @@ static int probe_maple_kbd(struct device *dev)
175 goto fail; 175 goto fail;
176 } 176 }
177 177
178 mdev->private_data = kbd;
179
180 kbd->dev = idev; 178 kbd->dev = idev;
181 memcpy(kbd->keycode, dc_kbd_keycode, sizeof(kbd->keycode)); 179 memcpy(kbd->keycode, dc_kbd_keycode, sizeof(kbd->keycode));
182 180
@@ -204,27 +202,30 @@ static int probe_maple_kbd(struct device *dev)
204 MAPLE_FUNC_KEYBOARD); 202 MAPLE_FUNC_KEYBOARD);
205 203
206 mdev->driver = mdrv; 204 mdev->driver = mdrv;
205
206 maple_set_drvdata(mdev, kbd);
207
207 return error; 208 return error;
208 209
209fail: 210fail:
210 input_free_device(idev); 211 input_free_device(idev);
211 kfree(kbd); 212 kfree(kbd);
212 mdev->private_data = NULL; 213 maple_set_drvdata(mdev, NULL);
213 return error; 214 return error;
214} 215}
215 216
216static int remove_maple_kbd(struct device *dev) 217static int remove_maple_kbd(struct device *dev)
217{ 218{
218 struct maple_device *mdev = to_maple_dev(dev); 219 struct maple_device *mdev = to_maple_dev(dev);
219 struct dc_kbd *kbd; 220 struct dc_kbd *kbd = maple_get_drvdata(mdev);
220 221
221 mutex_lock(&maple_keyb_mutex); 222 mutex_lock(&maple_keyb_mutex);
222 223
223 kbd = mdev->private_data;
224 mdev->private_data = NULL;
225 input_unregister_device(kbd->dev); 224 input_unregister_device(kbd->dev);
226 kfree(kbd); 225 kfree(kbd);
227 226
227 maple_set_drvdata(mdev, NULL);
228
228 mutex_unlock(&maple_keyb_mutex); 229 mutex_unlock(&maple_keyb_mutex);
229 return 0; 230 return 0;
230} 231}