提交 c1605f2e 编写于 作者: P Pavan Savoy 提交者: Greg Kroah-Hartman

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: NPavan Savoy <pavan_savoy@ti.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 d5c97c10
......@@ -475,9 +475,9 @@ void kim_st_list_protocols(struct st_data_s *st_gdata, void *buf)
{
seq_printf(buf, "[%d]\nBT=%c\nFM=%c\nGPS=%c\n",
st_gdata->protos_registered,
st_gdata->list[ST_BT] != NULL ? 'R' : 'U',
st_gdata->list[ST_FM] != NULL ? 'R' : 'U',
st_gdata->list[ST_GPS] != NULL ? 'R' : 'U');
st_gdata->list[0x04] != NULL ? 'R' : 'U',
st_gdata->list[0x08] != NULL ? 'R' : 'U',
st_gdata->list[0x09] != NULL ? 'R' : 'U');
}
/********************************************************************/
......@@ -644,9 +644,6 @@ long st_unregister(struct st_proto_s *proto)
long st_write(struct sk_buff *skb)
{
struct st_data_s *st_gdata;
#ifdef DEBUG
unsigned char chnl_id = ST_MAX_CHANNELS;
#endif
long len;
st_kim_ref(&st_gdata, 0);
......@@ -655,14 +652,7 @@ long st_write(struct sk_buff *skb)
pr_err("data/tty unavailable to perform write");
return -EINVAL;
}
#ifdef DEBUG /* open-up skb to read the 1st byte */
chnl_id = skb->data[0];
if (unlikely(st_gdata->list[chnl_id] == NULL)) {
pr_err(" chnl_id %d not registered, and writing? ",
chnl_id);
return -EINVAL;
}
#endif
pr_debug("%d to be written", skb->len);
len = skb->len;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册