diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-12-11 09:20:59 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-12-15 21:18:45 -0500 |
commit | 579e7d60ba0035228aadad69eb2ffeb138c51311 (patch) | |
tree | 0872698fe02dba92cead8e9d9a7ca7e7f38e1291 /drivers/media/video/cx231xx/cx231xx-input.c | |
parent | 38ef6aa884e3fd389f7d444b8dd36c16832e36b4 (diff) |
V4L/DVB (13617): ir: move input_register_device() to happen inside ir_input_register()
We'll need to register a sysfs class for the IR devices. As such, the better
is to have the input_register_device()/input_unregister_device() inside
the ir register/unregister functions.
Also, solves a naming problem with V4L ir_input_init() function, that were,
in fact, registering a device.
While here, do a few cleanups at budget-ci IR logic.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx231xx/cx231xx-input.c')
-rw-r--r-- | drivers/media/video/cx231xx/cx231xx-input.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/media/video/cx231xx/cx231xx-input.c b/drivers/media/video/cx231xx/cx231xx-input.c index 5eba1ec1205b..15826f98b688 100644 --- a/drivers/media/video/cx231xx/cx231xx-input.c +++ b/drivers/media/video/cx231xx/cx231xx-input.c | |||
@@ -197,8 +197,7 @@ int cx231xx_ir_init(struct cx231xx *dev) | |||
197 | usb_make_path(dev->udev, ir->phys, sizeof(ir->phys)); | 197 | usb_make_path(dev->udev, ir->phys, sizeof(ir->phys)); |
198 | strlcat(ir->phys, "/input0", sizeof(ir->phys)); | 198 | strlcat(ir->phys, "/input0", sizeof(ir->phys)); |
199 | 199 | ||
200 | err = ir_input_init(input_dev, &ir->ir, IR_TYPE_OTHER, | 200 | err = ir_input_init(input_dev, &ir->ir, IR_TYPE_OTHER); |
201 | dev->board.ir_codes); | ||
202 | if (err < 0) | 201 | if (err < 0) |
203 | goto err_out_free; | 202 | goto err_out_free; |
204 | 203 | ||
@@ -217,7 +216,7 @@ int cx231xx_ir_init(struct cx231xx *dev) | |||
217 | cx231xx_ir_start(ir); | 216 | cx231xx_ir_start(ir); |
218 | 217 | ||
219 | /* all done */ | 218 | /* all done */ |
220 | err = input_register_device(ir->input); | 219 | err = ir_input_register(ir->input, dev->board.ir_codes); |
221 | if (err) | 220 | if (err) |
222 | goto err_out_stop; | 221 | goto err_out_stop; |
223 | 222 | ||
@@ -226,8 +225,6 @@ err_out_stop: | |||
226 | cx231xx_ir_stop(ir); | 225 | cx231xx_ir_stop(ir); |
227 | dev->ir = NULL; | 226 | dev->ir = NULL; |
228 | err_out_free: | 227 | err_out_free: |
229 | ir_input_unregister(input_dev); | ||
230 | input_free_device(input_dev); | ||
231 | kfree(ir); | 228 | kfree(ir); |
232 | return err; | 229 | return err; |
233 | } | 230 | } |
@@ -242,7 +239,6 @@ int cx231xx_ir_fini(struct cx231xx *dev) | |||
242 | 239 | ||
243 | cx231xx_ir_stop(ir); | 240 | cx231xx_ir_stop(ir); |
244 | ir_input_unregister(ir->input); | 241 | ir_input_unregister(ir->input); |
245 | input_unregister_device(ir->input); | ||
246 | kfree(ir); | 242 | kfree(ir); |
247 | 243 | ||
248 | /* done */ | 244 | /* done */ |