Skip to content

Commit

Permalink
Merge branch 'mctp-serial-minor-fixes'
Browse files Browse the repository at this point in the history
Jeremy Kerr says:

====================
mctp serial minor fixes

We had a few minor fixes queued for a v4 of the original series, so
they're sent here as separate changes.

v2:
 - fix ordering of cancel_work vs. unregister_netdev.
====================

Link: https://lore.kernel.org/r/20211125060739.3023442-1-jk@codeconstruct.com.au
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Jakub Kicinski committed Nov 26, 2021
2 parents 342e5f9 + d1c99f3 commit 8e25fa5
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions drivers/net/mctp/mctp-serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,14 @@ static const struct net_device_ops mctp_serial_netdev_ops = {
static void mctp_serial_setup(struct net_device *ndev)
{
ndev->type = ARPHRD_MCTP;

/* we limit at the fixed MTU, which is also the MCTP-standard
* baseline MTU, so is also our minimum
*/
ndev->mtu = MCTP_SERIAL_MTU;
ndev->max_mtu = MCTP_SERIAL_MTU;
ndev->min_mtu = MCTP_SERIAL_MTU;

ndev->hard_header_len = 0;
ndev->addr_len = 0;
ndev->tx_queue_len = DEFAULT_TX_QUEUE_LEN;
Expand All @@ -432,9 +439,6 @@ static int mctp_serial_open(struct tty_struct *tty)
if (!tty->ops->write)
return -EOPNOTSUPP;

if (tty->disc_data)
return -EEXIST;

idx = ida_alloc(&mctp_serial_ida, GFP_KERNEL);
if (idx < 0)
return idx;
Expand Down Expand Up @@ -479,6 +483,7 @@ static void mctp_serial_close(struct tty_struct *tty)
int idx = dev->idx;

unregister_netdev(dev->netdev);
cancel_work_sync(&dev->tx_work);
ida_free(&mctp_serial_ida, idx);
}

Expand Down

0 comments on commit 8e25fa5

Please sign in to comment.