[PATCH] can: dev: export can_get_state_str() function

Subsystems: can network drivers, the rest

STALE2079d LANDED

Landed in mainline as 6fe27d68b456 on 2021-01-27.

2 messages, 2 authors, 2021-01-20 · open the first message on its own page

[PATCH] can: dev: export can_get_state_str() function

From: Vincent Mailhol <hidden>
Date: 2021-01-19 18:28:46

The can_get_state_str() function is also relevant to the
drivers. Export the symbol and make it visible in the can/dev.h
header.

Signed-off-by: Vincent Mailhol <redacted>
---
 drivers/net/can/dev/dev.c | 3 ++-
 include/linux/can/dev.h   | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/can/dev/dev.c b/drivers/net/can/dev/dev.c
index f580f0ac6497..8240743599b2 100644
--- a/drivers/net/can/dev/dev.c
+++ b/drivers/net/can/dev/dev.c
@@ -74,7 +74,7 @@ static int can_rx_state_to_frame(struct net_device *dev, enum can_state state)
 	}
 }
 
-static const char *can_get_state_str(const enum can_state state)
+const char *can_get_state_str(const enum can_state state)
 {
 	switch (state) {
 	case CAN_STATE_ERROR_ACTIVE:
@@ -95,6 +95,7 @@ static const char *can_get_state_str(const enum can_state state)
 
 	return "<unknown>";
 }
+EXPORT_SYMBOL_GPL(can_get_state_str);
 
 void can_change_state(struct net_device *dev, struct can_frame *cf,
 		      enum can_state tx_state, enum can_state rx_state)
diff --git a/include/linux/can/dev.h b/include/linux/can/dev.h
index 7faf6a37d5b2..ac4d83a1ab81 100644
--- a/include/linux/can/dev.h
+++ b/include/linux/can/dev.h
@@ -123,6 +123,7 @@ void unregister_candev(struct net_device *dev);
 int can_restart_now(struct net_device *dev);
 void can_bus_off(struct net_device *dev);
 
+const char *can_get_state_str(const enum can_state state);
 void can_change_state(struct net_device *dev, struct can_frame *cf,
 		      enum can_state tx_state, enum can_state rx_state);
 
base-commit: 1105592cb8fdfcc96f2c9c693ff4106bac5fac7c
-- 
2.26.2

Re: [PATCH] can: dev: export can_get_state_str() function

From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: 2021-01-20 08:29:51

On 1/19/21 6:03 PM, Vincent Mailhol wrote:
The can_get_state_str() function is also relevant to the
drivers. Export the symbol and make it visible in the can/dev.h
header.

Signed-off-by: Vincent Mailhol <redacted>
Applied to linux-can-next/testing

regards,
Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help