Skip to content

Commit

Permalink
can: bittiming: can_validate_bitrate(): report error via netlink
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Marc Kleine-Budde committed Feb 6, 2023
1 parent 0674208 commit 6d79347
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/can/dev/bittiming.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 6d79347

Please sign in to comment.