Skip to contentSkip to conversation

can: fix return value from can_get_bittiming()

PATCH Applied Oliver Hartkopp 2 participants 2 messages Apr 23, 2014 – Apr 24, 2014 CAN network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 can: fix return value from can_get_bittiming()

When trying to set a data bitrate on non CAN FD devices the 'ip' tool answers with:

RTNETLINK answers: Unknown error 524

Rename '-ENOTSUPP' to '-EOPNOTSUPP' so that 'ip' answers correctly:

RTNETLINK answers: Operation not supported

---
 drivers/net/can/dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/can/dev.c +1 -1
index c7a2604..e318e87 100644
@@ -256,7 +256,7 @@ static int can_get_bittiming(struct net_device *dev, struct can_bittiming *bt,
 
 	/* Check if the CAN device has bit-timing parameters */
 	if (!btc)
-		return -ENOTSUPP;
+		return -EOPNOTSUPP;
 
 	/*
 	 * Depending on the given can_bittiming parameter structure the CAN
Signature · 1 line
1.9.2
maintainer Applied
#1 lore raw
Quoted 10 lines · Oliver Hartkopp

When trying to set a data bitrate on non CAN FD devices the 'ip' tool answers with:

RTNETLINK answers: Unknown error 524

Rename '-ENOTSUPP' to '-EOPNOTSUPP' so that 'ip' answers correctly:

RTNETLINK answers: Operation not supported

Applied to can/master.

Tnx,
Marc

Signature · 4 lines
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |