Title: [4054] trunk/drivers/char: Fix Bug [#3767] ppifcd fails with -t
- Revision
- 4054
- Author
- hennerich
- Date
- 2007-12-18 01:39:37 -0600 (Tue, 18 Dec 2007)
Log Message
Fix Bug [#3767] ppifcd fails with -t
Diffstat
bfin_ppifcd.c | 7 +++++--
bfin_ppifcd.h | 2 +-
2 files changed, 6 insertions(+), 3 deletions(-)
Modified Paths
Diff
Modified: trunk/drivers/char/bfin_ppifcd.c (4053 => 4054)
--- trunk/drivers/char/bfin_ppifcd.c 2007-12-18 06:42:24 UTC (rev 4053)
+++ trunk/drivers/char/bfin_ppifcd.c 2007-12-18 07:39:37 UTC (rev 4054)
@@ -75,7 +75,7 @@
unsigned short ppi_control;
unsigned short ppi_status;
unsigned short ppi_delay;
- unsigned short ppi_trigger_gpio;
+ short ppi_trigger_gpio;
struct fasync_struct *fasyc;
wait_queue_head_t *rx_avail;
} ppi_device_t;
@@ -406,7 +406,7 @@
bfin_write_PPI_CONTROL(bfin_read_PPI_CONTROL() | PORT_EN);
SSYNC();
- if (pdev->ppi_trigger_gpio < NO_TRIGGER) {
+ if (pdev->ppi_trigger_gpio > NO_TRIGGER) {
gpio_set_value(pdev->ppi_trigger_gpio, 1);
udelay(1);
gpio_set_value(pdev->ppi_trigger_gpio, 0);
@@ -567,6 +567,9 @@
free_irq(IRQ_PPI_ERROR, filp->private_data);
+ if (pdev->ppi_trigger_gpio > NO_TRIGGER)
+ gpio_free(pdev->ppi_trigger_gpio);
+
ppifcd_reg_reset(pdev);
pdev->opened = 0;
spin_unlock_irqrestore(&ppifcd_lock, flags);
Modified: trunk/drivers/char/bfin_ppifcd.h (4053 => 4054)
--- trunk/drivers/char/bfin_ppifcd.h 2007-12-18 06:42:24 UTC (rev 4053)
+++ trunk/drivers/char/bfin_ppifcd.h 2007-12-18 07:39:37 UTC (rev 4054)
@@ -61,7 +61,7 @@
#define TRIGGER_PF14 14
#define TRIGGER_PF15 15
-#define NO_TRIGGER 16
+#define NO_TRIGGER (-1)
/* Some Sensor Sepcific Defaults */
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
http://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits