updated on Thu Jan 12 04:00:44 UTC 2012
[aur-mirror.git] / lirc-bede / lirc_wpc8769l.patch
blobe4e2a049b67a3ecbd45ddb80b91abe007dddf219
1 From 413e83bf504fe9a9a177f27742220cfcb184b034 Mon Sep 17 00:00:00 2001
2 From: =?utf8?q?Juan=20Jes=C3=BAs=20Garc=C3=ADa=20de=20Soria=20Lucena?= <skandalfo@gmail.com>
3 Date: Wed, 30 Mar 2011 16:46:35 -0400
4 Subject: [PATCH] Make lirc_wpc8769l functional again
6 Signed-off-by: Jarod Wilson <jarod@redhat.com>
7 ---
8 drivers/lirc_wpc8769l/lirc_wpc8769l.c | 28 +++++++++++++++++-----------
9 1 files changed, 17 insertions(+), 11 deletions(-)
11 diff --git a/drivers/lirc_wpc8769l/lirc_wpc8769l.c b/drivers/lirc_wpc8769l/lirc_wpc8769l.c
12 index f820d11..4d04063 100644
13 --- a/drivers/lirc_wpc8769l/lirc_wpc8769l.c
14 +++ b/drivers/lirc_wpc8769l/lirc_wpc8769l.c
15 @@ -816,10 +816,6 @@ static int set_use_inc(void *data)
16 /* Reset last timeout value. */
17 lastus = 0;
19 - /* Init the read buffer. */
20 - if (lirc_buffer_init(&rbuf, sizeof(lirc_t), RBUF_LEN) < 0)
21 - return -ENOMEM;
23 /* Acquire the IRQ. */
24 result = request_irq(irq, irq_handler,
25 IRQF_DISABLED | IRQF_SHARED,
26 @@ -863,9 +859,6 @@ static void set_use_dec(void *data)
27 /* Free the IRQ. */
28 free_irq(irq, THIS_MODULE);
29 dprintk("Freed IRQ %d\n", irq);
31 - /* Free the RX buffer. */
32 - lirc_buffer_free(&rbuf);
35 static struct lirc_driver driver = {
36 @@ -1065,19 +1058,29 @@ static int __init lirc_wpc8769l_module_init(void)
37 /* Do load-time checks. */
38 wpc8769l_power_up_and_check_if_we_woke_us_up();
40 + /* Init the read buffer. */
41 + if (lirc_buffer_init(&rbuf, sizeof(lirc_t), RBUF_LEN) < 0) {
42 + rc = -ENOMEM;
43 + goto exit_platform_exit;
44 + }
46 /* Configure the driver hooks. */
47 driver.features = LIRC_CAN_REC_MODE2;
48 + driver.dev = &lirc_wpc8769l_platform_dev->dev;
49 driver.minor = lirc_register_driver(&driver);
50 if (driver.minor < 0) {
51 eprintk("lirc_register_driver failed!\n");
52 rc = -EIO;
53 - goto exit_platform_exit;
54 + goto exit_release_buffer;
57 iprintk("Driver loaded.\n");
59 return 0; /* Everything OK. */
61 +exit_release_buffer:
62 + lirc_buffer_free(&rbuf);
64 exit_platform_exit:
65 lirc_wpc8769l_platform_exit();
67 @@ -1095,12 +1098,15 @@ module_init(lirc_wpc8769l_module_init);
69 static void __exit lirc_wpc8769l_module_exit(void)
71 - /* Unregister the platform driver and device. */
72 - lirc_wpc8769l_platform_exit();
74 /* Unregister the LIRC driver. */
75 lirc_unregister_driver(driver.minor);
77 + /* Free the buffer. */
78 + lirc_buffer_free(&rbuf);
80 + /* Unregister the platform driver and device. */
81 + lirc_wpc8769l_platform_exit();
83 /* Release the second range. */
84 if (baseport2)
85 release_region(baseport2, WPC8769L_IO_REGION_2_SIZE);
86 --
87 1.7.0.1