From 6d7934719f2654587b96cbae5e326c7e33c24da8 Mon Sep 17 00:00:00 2001 From: Marc Kleine-Budde Date: Wed, 1 Feb 2023 20:27:47 +0100 Subject: 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 --- drivers/net/can/dev/bittiming.c | 3 +++ 1 file changed, 3 insertions(+) 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; } -- cgit v1.2.3