diff options
author | Pavan Savoy <pavan_savoy@ti.com> | 2011-03-02 04:59:56 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-03-09 19:10:00 -0500 |
commit | c1605f2e3312ca149caf32129e0b25b1e7296f36 (patch) | |
tree | bce1a8aa5ed04d5949eab549f54a983a53f99360 /drivers/misc | |
parent | d5c97c1099f5617dc1ba3d1f0058d1341b1faf4c (diff) |
drivers:misc: ti-st: fix debugging code
debug code in TI-ST driver can be enabled by #defining
DEBUG in the first line of the code and in case debugfs
is mounted, the 2 entries in /sys/kernel/debug/ti-st/ will
also provide useful information.
These 2 were broken because of the recent changes to the parsing
logic and the registration mechanism of the protocol drivers,
this patch fixes them.
Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/ti-st/st_core.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/drivers/misc/ti-st/st_core.c b/drivers/misc/ti-st/st_core.c index 1847c477c0c0..486117f72c9f 100644 --- a/drivers/misc/ti-st/st_core.c +++ b/drivers/misc/ti-st/st_core.c | |||
@@ -475,9 +475,9 @@ void kim_st_list_protocols(struct st_data_s *st_gdata, void *buf) | |||
475 | { | 475 | { |
476 | seq_printf(buf, "[%d]\nBT=%c\nFM=%c\nGPS=%c\n", | 476 | seq_printf(buf, "[%d]\nBT=%c\nFM=%c\nGPS=%c\n", |
477 | st_gdata->protos_registered, | 477 | st_gdata->protos_registered, |
478 | st_gdata->list[ST_BT] != NULL ? 'R' : 'U', | 478 | st_gdata->list[0x04] != NULL ? 'R' : 'U', |
479 | st_gdata->list[ST_FM] != NULL ? 'R' : 'U', | 479 | st_gdata->list[0x08] != NULL ? 'R' : 'U', |
480 | st_gdata->list[ST_GPS] != NULL ? 'R' : 'U'); | 480 | st_gdata->list[0x09] != NULL ? 'R' : 'U'); |
481 | } | 481 | } |
482 | 482 | ||
483 | /********************************************************************/ | 483 | /********************************************************************/ |
@@ -644,9 +644,6 @@ long st_unregister(struct st_proto_s *proto) | |||
644 | long st_write(struct sk_buff *skb) | 644 | long st_write(struct sk_buff *skb) |
645 | { | 645 | { |
646 | struct st_data_s *st_gdata; | 646 | struct st_data_s *st_gdata; |
647 | #ifdef DEBUG | ||
648 | unsigned char chnl_id = ST_MAX_CHANNELS; | ||
649 | #endif | ||
650 | long len; | 647 | long len; |
651 | 648 | ||
652 | st_kim_ref(&st_gdata, 0); | 649 | st_kim_ref(&st_gdata, 0); |
@@ -655,14 +652,7 @@ long st_write(struct sk_buff *skb) | |||
655 | pr_err("data/tty unavailable to perform write"); | 652 | pr_err("data/tty unavailable to perform write"); |
656 | return -EINVAL; | 653 | return -EINVAL; |
657 | } | 654 | } |
658 | #ifdef DEBUG /* open-up skb to read the 1st byte */ | 655 | |
659 | chnl_id = skb->data[0]; | ||
660 | if (unlikely(st_gdata->list[chnl_id] == NULL)) { | ||
661 | pr_err(" chnl_id %d not registered, and writing? ", | ||
662 | chnl_id); | ||
663 | return -EINVAL; | ||
664 | } | ||
665 | #endif | ||
666 | pr_debug("%d to be written", skb->len); | 656 | pr_debug("%d to be written", skb->len); |
667 | len = skb->len; | 657 | len = skb->len; |
668 | 658 | ||