can: dev: export can_get_state_str() function
authorVincent Mailhol <mailhol.vincent@wanadoo.fr>
Tue, 19 Jan 2021 17:03:55 +0000 (02:03 +0900)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Wed, 27 Jan 2021 09:01:46 +0000 (10:01 +0100)
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.

Link: https://lore.kernel.org/r/20210119170355.12040-1-mailhol.vincent@wanadoo.fr
Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/dev/dev.c
include/linux/can/dev.h

index 01e4a194f187e272c5374775b1577f4154d441b0..d9281ae853f8ee5c75bdcb3770703dee9913f1a3 100644 (file)
@@ -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)
index 7faf6a37d5b2b8a9450804277bf321654c15f72b..ac4d83a1ab81c0151a4478ed575f34895feb57e3 100644 (file)
@@ -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);