Skip to content

Commit

Permalink
wan: cosa: remove dead cosa_net_ioctl() function
Browse files Browse the repository at this point in the history
The ndo_do_ioctl callback is never called with the COSAIO* commands,
so this is never used. Call the hdlc_ioctl function directly instead.

Any user space code that relied on this function working as intended
has never worked in a mainline kernel since before linux-1.0.

Cc: "Jan \"Yenya\" Kasprzak" <kas@fi.muni.cz>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Arnd Bergmann authored and David S. Miller committed Jul 27, 2021
1 parent 73d74f6 commit 8fb75b7
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions drivers/net/wan/cosa.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ static netdev_tx_t cosa_net_tx(struct sk_buff *skb, struct net_device *d);
static char *cosa_net_setup_rx(struct channel_data *channel, int size);
static int cosa_net_rx_done(struct channel_data *channel);
static int cosa_net_tx_done(struct channel_data *channel, int size);
static int cosa_net_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);

/* Character device */
static char *chrdev_setup_rx(struct channel_data *channel, int size);
Expand Down Expand Up @@ -415,7 +414,7 @@ static const struct net_device_ops cosa_ops = {
.ndo_open = cosa_net_open,
.ndo_stop = cosa_net_close,
.ndo_start_xmit = hdlc_start_xmit,
.ndo_do_ioctl = cosa_net_ioctl,
.ndo_do_ioctl = hdlc_ioctl,
.ndo_tx_timeout = cosa_net_timeout,
};

Expand Down Expand Up @@ -1169,18 +1168,6 @@ static int cosa_ioctl_common(struct cosa_data *cosa,
return -ENOIOCTLCMD;
}

static int cosa_net_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{
int rv;
struct channel_data *chan = dev_to_chan(dev);

rv = cosa_ioctl_common(chan->cosa, chan, cmd,
(unsigned long)ifr->ifr_data);
if (rv != -ENOIOCTLCMD)
return rv;
return hdlc_ioctl(dev, ifr, cmd);
}

static long cosa_chardev_ioctl(struct file *file, unsigned int cmd,
unsigned long arg)
{
Expand Down

0 comments on commit 8fb75b7

Please sign in to comment.