summaryrefslogtreecommitdiff
path: root/target/linux/brcm2708/patches-3.10/0103-lirc_rpi-Don-t-register-with-lirc_dev-if-we-can-t-cl.patch
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2014-02-28 20:30:08 +0000
committerFlorian Fainelli <florian@openwrt.org>2014-02-28 20:30:08 +0000
commitbb39b8d99aae1f7eb13a97bd874838da91080de6 (patch)
tree3046f53937c0bc5dc13e2b2ab7b688a1932199bf /target/linux/brcm2708/patches-3.10/0103-lirc_rpi-Don-t-register-with-lirc_dev-if-we-can-t-cl.patch
parentc6c0d09f85c211560a1405441925681cfa25e8b1 (diff)
downloadmtk-20170518-bb39b8d99aae1f7eb13a97bd874838da91080de6.zip
mtk-20170518-bb39b8d99aae1f7eb13a97bd874838da91080de6.tar.gz
mtk-20170518-bb39b8d99aae1f7eb13a97bd874838da91080de6.tar.bz2
brcm2708: update against latest rpi-3.10.y branch
Update our copies of the brcm2708 patches to the latest rpi-3.10-y rebased against linux-3.10.y stable (3.10.32). This should hopefully make it easier for us in the future to leverage the raspberry/rpi-* branches. Signed-off-by: Florian Fainelli <florian@openwrt.org> SVN-Revision: 39770
Diffstat (limited to 'target/linux/brcm2708/patches-3.10/0103-lirc_rpi-Don-t-register-with-lirc_dev-if-we-can-t-cl.patch')
-rw-r--r--target/linux/brcm2708/patches-3.10/0103-lirc_rpi-Don-t-register-with-lirc_dev-if-we-can-t-cl.patch58
1 files changed, 58 insertions, 0 deletions
diff --git a/target/linux/brcm2708/patches-3.10/0103-lirc_rpi-Don-t-register-with-lirc_dev-if-we-can-t-cl.patch b/target/linux/brcm2708/patches-3.10/0103-lirc_rpi-Don-t-register-with-lirc_dev-if-we-can-t-cl.patch
new file mode 100644
index 0000000..9e026df
--- /dev/null
+++ b/target/linux/brcm2708/patches-3.10/0103-lirc_rpi-Don-t-register-with-lirc_dev-if-we-can-t-cl.patch
@@ -0,0 +1,58 @@
+From 72ce4c24efeac1b3260b3b10ec7cbc2701dcef5a Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Du=C5=A1an=20Dragi=C4=87?= <dragic.dusan@gmail.com>
+Date: Wed, 25 Sep 2013 18:44:05 +0200
+Subject: [PATCH 103/174] lirc_rpi: Don't register with lirc_dev if we can't
+ claim gpio pins
+
+Currently the lirc_rpi module always registers a new lirc device.
+In case the gpio pins can't be claimed it exits without unregistering.
+
+Skip registering with lirc_dev if pins can't be claimed.
+Also, don't free gpio pins that we haven't claimed.
+---
+ drivers/staging/media/lirc/lirc_rpi.c | 13 +++++++------
+ 1 file changed, 7 insertions(+), 6 deletions(-)
+
+--- a/drivers/staging/media/lirc/lirc_rpi.c
++++ b/drivers/staging/media/lirc/lirc_rpi.c
+@@ -590,8 +590,6 @@ static int __init lirc_rpi_init(void)
+
+ static void lirc_rpi_exit(void)
+ {
+- gpio_free(gpio_out_pin);
+- gpio_free(gpio_in_pin);
+ platform_device_unregister(lirc_rpi_dev);
+ platform_driver_unregister(&lirc_rpi_driver);
+ lirc_buffer_free(&rbuf);
+@@ -623,6 +621,10 @@ static int __init lirc_rpi_init_module(v
+ goto exit_rpi;
+ }
+
++ result = init_port();
++ if (result < 0)
++ goto exit_rpi;
++
+ driver.features = LIRC_CAN_SET_SEND_DUTY_CYCLE |
+ LIRC_CAN_SET_SEND_CARRIER |
+ LIRC_CAN_SEND_PULSE |
+@@ -640,10 +642,6 @@ static int __init lirc_rpi_init_module(v
+
+ printk(KERN_INFO LIRC_DRIVER_NAME ": driver registered!\n");
+
+- result = init_port();
+- if (result < 0)
+- goto exit_rpi;
+-
+ return 0;
+
+ exit_rpi:
+@@ -654,6 +652,9 @@ static int __init lirc_rpi_init_module(v
+
+ static void __exit lirc_rpi_exit_module(void)
+ {
++ gpio_free(gpio_out_pin);
++ gpio_free(gpio_in_pin);
++
+ lirc_rpi_exit();
+
+ lirc_unregister_driver(driver.minor);