| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (C) ST-Ericsson AB 2010 |
|---|
| 3 | 4 | * Author: Sjur Brendeland |
|---|
| 4 | | - * License terms: GNU General Public License (GPL) version 2 |
|---|
| 5 | 5 | */ |
|---|
| 6 | 6 | |
|---|
| 7 | 7 | #include <linux/hardirq.h> |
|---|
| .. | .. |
|---|
| 94 | 94 | } |
|---|
| 95 | 95 | static inline void debugfs_init(struct ser_device *ser, struct tty_struct *tty) |
|---|
| 96 | 96 | { |
|---|
| 97 | | - ser->debugfs_tty_dir = |
|---|
| 98 | | - debugfs_create_dir(tty->name, debugfsdir); |
|---|
| 99 | | - if (!IS_ERR(ser->debugfs_tty_dir)) { |
|---|
| 100 | | - debugfs_create_blob("last_tx_msg", 0400, |
|---|
| 101 | | - ser->debugfs_tty_dir, |
|---|
| 102 | | - &ser->tx_blob); |
|---|
| 97 | + ser->debugfs_tty_dir = debugfs_create_dir(tty->name, debugfsdir); |
|---|
| 103 | 98 | |
|---|
| 104 | | - debugfs_create_blob("last_rx_msg", 0400, |
|---|
| 105 | | - ser->debugfs_tty_dir, |
|---|
| 106 | | - &ser->rx_blob); |
|---|
| 99 | + debugfs_create_blob("last_tx_msg", 0400, ser->debugfs_tty_dir, |
|---|
| 100 | + &ser->tx_blob); |
|---|
| 107 | 101 | |
|---|
| 108 | | - debugfs_create_x32("ser_state", 0400, |
|---|
| 109 | | - ser->debugfs_tty_dir, |
|---|
| 110 | | - (u32 *)&ser->state); |
|---|
| 102 | + debugfs_create_blob("last_rx_msg", 0400, ser->debugfs_tty_dir, |
|---|
| 103 | + &ser->rx_blob); |
|---|
| 111 | 104 | |
|---|
| 112 | | - debugfs_create_x8("tty_status", 0400, |
|---|
| 113 | | - ser->debugfs_tty_dir, |
|---|
| 114 | | - &ser->tty_status); |
|---|
| 105 | + debugfs_create_xul("ser_state", 0400, ser->debugfs_tty_dir, |
|---|
| 106 | + &ser->state); |
|---|
| 115 | 107 | |
|---|
| 116 | | - } |
|---|
| 108 | + debugfs_create_x8("tty_status", 0400, ser->debugfs_tty_dir, |
|---|
| 109 | + &ser->tty_status); |
|---|
| 110 | + |
|---|
| 117 | 111 | ser->tx_blob.data = ser->tx_data; |
|---|
| 118 | 112 | ser->tx_blob.size = 0; |
|---|
| 119 | 113 | ser->rx_blob.data = ser->rx_data; |
|---|
| .. | .. |
|---|
| 257 | 251 | if (skb->len == 0) { |
|---|
| 258 | 252 | struct sk_buff *tmp = skb_dequeue(&ser->head); |
|---|
| 259 | 253 | WARN_ON(tmp != skb); |
|---|
| 260 | | - if (in_interrupt()) |
|---|
| 261 | | - dev_kfree_skb_irq(skb); |
|---|
| 262 | | - else |
|---|
| 263 | | - kfree_skb(skb); |
|---|
| 254 | + dev_consume_skb_any(skb); |
|---|
| 264 | 255 | } |
|---|
| 265 | 256 | } |
|---|
| 266 | 257 | /* Send flow off if queue is empty */ |
|---|
| .. | .. |
|---|
| 275 | 266 | return tty_wr; |
|---|
| 276 | 267 | } |
|---|
| 277 | 268 | |
|---|
| 278 | | -static int caif_xmit(struct sk_buff *skb, struct net_device *dev) |
|---|
| 269 | +static netdev_tx_t caif_xmit(struct sk_buff *skb, struct net_device *dev) |
|---|
| 279 | 270 | { |
|---|
| 280 | 271 | struct ser_device *ser; |
|---|
| 281 | 272 | |
|---|