Commit 5c912e67 authored by Wei Yongjun's avatar Wei Yongjun Committed by Greg Kroah-Hartman

usb: cdc-wdm: fix build error when CONFIG_WWAN_CORE is not set

Gcc report build error as following when CONFIG_WWAN_CORE is not set:

x86_64-linux-gnu-ld: drivers/usb/class/cdc-wdm.o: in function `wdm_disconnect':
cdc-wdm.c:(.text+0xb2a): undefined reference to `wwan_remove_port'
x86_64-linux-gnu-ld: drivers/usb/class/cdc-wdm.o: in function `wdm_in_callback':
cdc-wdm.c:(.text+0xf23): undefined reference to `wwan_port_rx'
x86_64-linux-gnu-ld: drivers/usb/class/cdc-wdm.o: in function `wdm_wwan_port_stop':
cdc-wdm.c:(.text+0x127d): undefined reference to `wwan_port_get_drvdata'
x86_64-linux-gnu-ld: drivers/usb/class/cdc-wdm.o: in function `wdm_wwan_port_tx':
cdc-wdm.c:(.text+0x12d9): undefined reference to `wwan_port_get_drvdata'
x86_64-linux-gnu-ld: cdc-wdm.c:(.text+0x13c1): undefined reference to `wwan_port_txoff'
x86_64-linux-gnu-ld: drivers/usb/class/cdc-wdm.o: in function `wdm_wwan_port_start':
cdc-wdm.c:(.text+0x13e0): undefined reference to `wwan_port_get_drvdata'
x86_64-linux-gnu-ld: cdc-wdm.c:(.text+0x1431): undefined reference to `wwan_port_txon'
x86_64-linux-gnu-ld: drivers/usb/class/cdc-wdm.o: in function `wdm_wwan_port_tx_complete':
cdc-wdm.c:(.text+0x14a4): undefined reference to `wwan_port_txon'
x86_64-linux-gnu-ld: drivers/usb/class/cdc-wdm.o: in function `wdm_create.cold':
cdc-wdm.c:(.text.unlikely+0x209): undefined reference to `wwan_create_port'

Using CONFIG_WWAN_CORE instead of CONFIG_WWAN to avoid build error.

Fixes: cac6fb01 ("usb: class: cdc-wdm: WWAN framework integration")
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Reviewed-by: default avatarLoic Poulain <loic.poulain@linaro.org>
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Link: https://lore.kernel.org/r/20210521021010.2490930-1-weiyongjun1@huawei.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1f958f3d
...@@ -824,7 +824,7 @@ static struct usb_class_driver wdm_class = { ...@@ -824,7 +824,7 @@ static struct usb_class_driver wdm_class = {
}; };
/* --- WWAN framework integration --- */ /* --- WWAN framework integration --- */
#ifdef CONFIG_WWAN #ifdef CONFIG_WWAN_CORE
static int wdm_wwan_port_start(struct wwan_port *port) static int wdm_wwan_port_start(struct wwan_port *port)
{ {
struct wdm_device *desc = wwan_port_get_drvdata(port); struct wdm_device *desc = wwan_port_get_drvdata(port);
...@@ -963,11 +963,11 @@ static void wdm_wwan_rx(struct wdm_device *desc, int length) ...@@ -963,11 +963,11 @@ static void wdm_wwan_rx(struct wdm_device *desc, int length)
/* inbuf has been copied, it is safe to check for outstanding data */ /* inbuf has been copied, it is safe to check for outstanding data */
schedule_work(&desc->service_outs_intr); schedule_work(&desc->service_outs_intr);
} }
#else /* CONFIG_WWAN */ #else /* CONFIG_WWAN_CORE */
static void wdm_wwan_init(struct wdm_device *desc) {} static void wdm_wwan_init(struct wdm_device *desc) {}
static void wdm_wwan_deinit(struct wdm_device *desc) {} static void wdm_wwan_deinit(struct wdm_device *desc) {}
static void wdm_wwan_rx(struct wdm_device *desc, int length) {} static void wdm_wwan_rx(struct wdm_device *desc, int length) {}
#endif /* CONFIG_WWAN */ #endif /* CONFIG_WWAN_CORE */
/* --- error handling --- */ /* --- error handling --- */
static void wdm_rxwork(struct work_struct *work) static void wdm_rxwork(struct work_struct *work)
......
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