Commit 4b5cf2b8 authored by Johan Hovold's avatar Johan Hovold

USB: serial: add sysrq break-handler dummy

Add inline sysrq break-handler dummy to allow the compiler to eliminate
further code when either console or sysrq support isn't enabled and to
clearly mark the two sysrq functions as belonging together.
Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
parent 4fbfbdb5
...@@ -585,11 +585,10 @@ int usb_serial_handle_sysrq_char(struct usb_serial_port *port, unsigned int ch) ...@@ -585,11 +585,10 @@ int usb_serial_handle_sysrq_char(struct usb_serial_port *port, unsigned int ch)
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(usb_serial_handle_sysrq_char); EXPORT_SYMBOL_GPL(usb_serial_handle_sysrq_char);
#endif
int usb_serial_handle_break(struct usb_serial_port *port) int usb_serial_handle_break(struct usb_serial_port *port)
{ {
if (!port->port.console || !IS_ENABLED(CONFIG_MAGIC_SYSRQ)) if (!port->port.console)
return 0; return 0;
if (!port->sysrq) { if (!port->sysrq) {
...@@ -600,6 +599,7 @@ int usb_serial_handle_break(struct usb_serial_port *port) ...@@ -600,6 +599,7 @@ int usb_serial_handle_break(struct usb_serial_port *port)
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(usb_serial_handle_break); EXPORT_SYMBOL_GPL(usb_serial_handle_break);
#endif
/** /**
* usb_serial_handle_dcd_change - handle a change of carrier detect state * usb_serial_handle_dcd_change - handle a change of carrier detect state
......
...@@ -369,14 +369,18 @@ extern int usb_serial_generic_prepare_write_buffer(struct usb_serial_port *port, ...@@ -369,14 +369,18 @@ extern int usb_serial_generic_prepare_write_buffer(struct usb_serial_port *port,
#if defined(CONFIG_USB_SERIAL_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) #if defined(CONFIG_USB_SERIAL_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
extern int usb_serial_handle_sysrq_char(struct usb_serial_port *port, extern int usb_serial_handle_sysrq_char(struct usb_serial_port *port,
unsigned int ch); unsigned int ch);
extern int usb_serial_handle_break(struct usb_serial_port *port);
#else #else
static inline int usb_serial_handle_sysrq_char(struct usb_serial_port *port, unsigned int ch) static inline int usb_serial_handle_sysrq_char(struct usb_serial_port *port, unsigned int ch)
{ {
return 0; return 0;
} }
static inline int usb_serial_handle_break(struct usb_serial_port *port)
{
return 0;
}
#endif #endif
extern int usb_serial_handle_break(struct usb_serial_port *port);
extern void usb_serial_handle_dcd_change(struct usb_serial_port *usb_port, extern void usb_serial_handle_dcd_change(struct usb_serial_port *usb_port,
struct tty_struct *tty, struct tty_struct *tty,
unsigned int status); unsigned int status);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment