Skip to content

Commit

Permalink
can: m_can: m_can_class_allocate_dev(): remove impossible error retur…
Browse files Browse the repository at this point in the history
…n judgment

If the CAN net device has been successfully allocated, its private
data structure is impossible to be empty, remove this redundant error
return judgment.

Link: https://lore.kernel.org/r/20210205072559.13241-2-xulin.sun@windriver.com
Signed-off-by: Xulin Sun <xulin.sun@windriver.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
  • Loading branch information
Xulin Sun authored and Marc Kleine-Budde committed Mar 30, 2021
1 parent 58b29aa commit 8fa1220
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions drivers/net/can/m_can/m_can.c
Original file line number Diff line number Diff line change
Expand Up @@ -1787,11 +1787,6 @@ struct m_can_classdev *m_can_class_allocate_dev(struct device *dev,
}

class_dev = netdev_priv(net_dev);
if (!class_dev) {
dev_err(dev, "Failed to init netdev cdevate");
goto out;
}

class_dev->net = net_dev;
class_dev->dev = dev;
SET_NETDEV_DEV(net_dev, dev);
Expand Down

0 comments on commit 8fa1220

Please sign in to comment.