Commit Graph

13 Commits (bfbf0c851fb02695f1a88435f7776b10370ece69)

Author SHA1 Message Date
Marc Kleine-Budde 95f12594a6 mcp251xfd-regmap: do_mcp251xfd_regmap_read(): fix compiler warning in a more straight forward way
Link: d294cd928c (r139957294)
Suggested-by: Oliver Hartkopp <socketcan@hartkopp.net>
2024-03-19 13:01:46 +01:00
Marc Kleine-Budde d294cd928c mcp251xfd-regmap: fix compiler warning
Fix the following compiler warning:

| mcp251xfd/mcp251xfd-regmap.c:38:4: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]
|                         fscanf(reg_file, "%*[^\n]\n");
|                         ^~~~~~ ~~~~~~~~~~~~~~~~~~~~~

Reported-by: https://github.com/Chaitanya84
Link: https://github.com/linux-can/can-utils/pull/506
2024-03-19 09:30:59 +01:00
Marc Kleine-Budde f3b35e8e80 mcp251xfd-dump: add support for dumps created with Linux kernel >= v5.18 2023-01-03 20:31:54 +01:00
Marc Kleine-Budde b4042d0205 mcp251xfd-dump: add test data 2023-01-03 20:31:54 +01:00
Marc Kleine-Budde 0847fb34b4 mcp251xfd-gen-testdata: add script to generate mcp251xfd-dump data 2023-01-03 20:18:47 +01:00
Marc Kleine-Budde ceb9761544 mcp251xfd-dump: regmap: skip lines that cannot be read 2023-01-03 15:46:07 +01:00
Marc Kleine-Budde 088176e4e0 mcp251xfd-dump: fail if no registers can be read from regmap file 2023-01-03 15:46:07 +01:00
Marc Kleine-Budde 0b84a782c2 mcp251xfd-dump: fix comparison of integer expressions of different signedness warning
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2022-12-07 16:32:41 +01:00
Vincent Mailhol 0cfd56d613 lib: add pr_debug() macro
Add the pr_debug() macro so that:

  #ifdef DEBUG
  	printf("foo");
  #endif

can be replaced by:

  	pr_debug("foo");

Apply the pr_debug() macro wherever relevant.

Currently, there is no consensus whether debug messages should be
printed on stdout or stderr. Most of the modules: canbusload.c,
candump.c and canlogserver.c use stdout but
mcp251xfd/mcp251xfd-dev-coredump.c uses stderr. Harmonize the behavior
by following the major trend and make
mcp251xfd/mcp251xfd-dev-coredump.c also output to stdout.

slcanpty.c does a #define DEBUG, meaning that debug is always turned
on for this file. Remove this and make debug an option like every
other files.

Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
Link: https://lore.kernel.org/all/20221114163848.3398-5-mailhol.vincent@wanadoo.fr
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2022-11-15 09:49:52 +01:00
Marc Kleine-Budde 0ccc3fed91 mcp251xfd-dump: add dump for IOCON register 2022-02-09 08:29:53 +01:00
Rosen Penev 7dd714907b
mcp251xfd: add missing libgen.h header
Needed for the basename() function under musl.
2021-12-15 18:00:39 -08:00
Marc Kleine-Budde 1792aebd8b mcp251xfd: add sample dev-coredump udev rule
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2021-02-13 23:36:43 +01:00
Marc Kleine-Budde 66de96d337 mcp251xfd-dump: add tool to decode chip and driver state of mcp251xfd
It works on dev coredump data generated by the mcp251xfd driver in
case of failures, as well as on regmap based register dumps.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2021-02-13 23:36:43 +01:00