diff options
author | Marc Kleine-Budde <mkl@pengutronix.de> | 2023-02-01 22:27:47 +0300 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2023-02-06 15:57:27 +0300 |
commit | 6d7934719f2654587b96cbae5e326c7e33c24da8 (patch) | |
tree | c7bd0a8e7356206197ecf5faf209ca94b8d7a32a /drivers/net/can/dev | |
parent | 06742086a3d225cafa3ee9d7704bbfd28a0d01d4 (diff) | |
download | linux-6d7934719f2654587b96cbae5e326c7e33c24da8.tar.xz |
can: bittiming: can_validate_bitrate(): report error via netlink
Report an error to user space via netlink if the requested bit rate is
not supported by the device.
Link: https://lore.kernel.org/all/20230202110854.2318594-18-mkl@pengutronix.de
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/can/dev')
-rw-r--r-- | drivers/net/can/dev/bittiming.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/can/dev/bittiming.c b/drivers/net/can/dev/bittiming.c index 55714e08ca3a..0b93900b1dfa 100644 --- a/drivers/net/can/dev/bittiming.c +++ b/drivers/net/can/dev/bittiming.c @@ -124,6 +124,9 @@ can_validate_bitrate(const struct net_device *dev, const struct can_bittiming *b return 0; } + NL_SET_ERR_MSG_FMT(extack, "bitrate %u bps not supported", + bt->brp); + return -EINVAL; } |