diff mbox series

[11/14] media: wl128x-radio: fix skb debug printing

Message ID 20181221011752.25627-12-sre@kernel.org (mailing list archive)
State New, archived
Headers show
Series Add support for FM radio in hcill and kill TI_ST | expand

Commit Message

Sebastian Reichel Dec. 21, 2018, 1:17 a.m. UTC
From: Sebastian Reichel <sebastian.reichel@collabora.com>

This fixes incorrect code in the TX/RX skb debug print
function and add stubs in receive/transmit packet path.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
---
 drivers/media/radio/wl128x/fmdrv_common.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

Comments

Pavel Machek Dec. 22, 2018, 7:30 p.m. UTC | #1
On Fri 2018-12-21 02:17:49, Sebastian Reichel wrote:
> From: Sebastian Reichel <sebastian.reichel@collabora.com>
> 
> This fixes incorrect code in the TX/RX skb debug print
> function and add stubs in receive/transmit packet path.
> 
> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>

Acked-by: Pavel Machek <pavel@ucw.cz>


> @@ -228,7 +228,7 @@ inline void dump_rx_skb_data(struct sk_buff *skb)
>  
>  	evt_hdr = (struct fm_event_msg_hdr *)skb->data;
>  	printk(KERN_INFO ">> hdr:%02x len:%02x sts:%02x numhci:%02x opcode:%02x type:%s dlen:%02x",
> -	       evt_hdr->hdr, evt_hdr->len,
> +	       evt_hdr->header, evt_hdr->len,
>  	       evt_hdr->status, evt_hdr->num_fm_hci_cmds, evt_hdr->op,
>  	       (evt_hdr->rd_wr) ? "RD" : "WR", evt_hdr->dlen);

Would conversion to dev_info() make sense?
diff mbox series

Patch

diff --git a/drivers/media/radio/wl128x/fmdrv_common.c b/drivers/media/radio/wl128x/fmdrv_common.c
index 473ec5738a11..c20d518af4f3 100644
--- a/drivers/media/radio/wl128x/fmdrv_common.c
+++ b/drivers/media/radio/wl128x/fmdrv_common.c
@@ -195,7 +195,7 @@  static inline void fm_irq_timeout_stage(struct fmdev *fmdev, u8 stage)
 
 #ifdef FM_DUMP_TXRX_PKT
  /* To dump outgoing FM Channel-8 packets */
-inline void dump_tx_skb_data(struct sk_buff *skb)
+static void dump_tx_skb_data(struct sk_buff *skb)
 {
 	int len, len_org;
 	u8 index;
@@ -220,7 +220,7 @@  inline void dump_tx_skb_data(struct sk_buff *skb)
 }
 
  /* To dump incoming FM Channel-8 packets */
-inline void dump_rx_skb_data(struct sk_buff *skb)
+static void dump_rx_skb_data(struct sk_buff *skb)
 {
 	int len, len_org;
 	u8 index;
@@ -228,7 +228,7 @@  inline void dump_rx_skb_data(struct sk_buff *skb)
 
 	evt_hdr = (struct fm_event_msg_hdr *)skb->data;
 	printk(KERN_INFO ">> hdr:%02x len:%02x sts:%02x numhci:%02x opcode:%02x type:%s dlen:%02x",
-	       evt_hdr->hdr, evt_hdr->len,
+	       evt_hdr->header, evt_hdr->len,
 	       evt_hdr->status, evt_hdr->num_fm_hci_cmds, evt_hdr->op,
 	       (evt_hdr->rd_wr) ? "RD" : "WR", evt_hdr->dlen);
 
@@ -243,6 +243,9 @@  inline void dump_rx_skb_data(struct sk_buff *skb)
 	}
 	printk(KERN_CONT "\n");
 }
+#else
+static void dump_tx_skb_data(struct sk_buff *skb) {}
+static void dump_rx_skb_data(struct sk_buff *skb) {}
 #endif
 
 void fmc_update_region_info(struct fmdev *fmdev, u8 region_to_set)
@@ -369,6 +372,7 @@  static void send_tasklet(unsigned long arg)
 	fmdev->resp_comp = fm_cb(skb)->completion;
 
 	/* Write FM packet to ST driver */
+	dump_tx_skb_data(skb);
 	len = g_st_write(skb);
 	if (len < 0) {
 		kfree_skb(skb);
@@ -1454,6 +1458,8 @@  static long fm_st_receive(void *arg, struct sk_buff *skb)
 	}
 
 	memcpy(skb_push(skb, 1), &skb->cb[0], 1);
+	dump_rx_skb_data(skb);
+
 	skb_queue_tail(&fmdev->rx_q, skb);
 	tasklet_schedule(&fmdev->rx_task);