2021-09-29 13:26:43

by Rikard Falkeborn

[permalink] [raw]
Subject: [PATCH 1/2] usb: cdc-wdm: Fix check for WWAN

Commit 5c912e679506 ("usb: cdc-wdm: fix build error when CONFIG_WWAN_CORE
is not set") fixed a build error when CONFIG_WWAN was set but
CONFIG_WWAN_CORE was not. Since then CONFIG_WWAN_CORE was removed and
joined with CONFIG_WWAN in commit 89212e160b81 ("net: wwan: Fix WWAN
config symbols").

Also, since CONFIG_WWAN has class tri-state instead of bool, we cannot
check if it is defined directly, but have to use IS_DEFINED() instead.

Fixes: 5c912e679506 ("usb: cdc-wdm: fix build error when CONFIG_WWAN_CORE is not set")
Cc: <[email protected]>
Signed-off-by: Rikard Falkeborn <[email protected]>
---
drivers/usb/class/cdc-wdm.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c
index 35d5908b5478..03b25aaaa1dd 100644
--- a/drivers/usb/class/cdc-wdm.c
+++ b/drivers/usb/class/cdc-wdm.c
@@ -824,7 +824,7 @@ static struct usb_class_driver wdm_class = {
};

/* --- WWAN framework integration --- */
-#ifdef CONFIG_WWAN_CORE
+#if IS_ENABLED(CONFIG_WWAN)
static int wdm_wwan_port_start(struct wwan_port *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)
/* inbuf has been copied, it is safe to check for outstanding data */
schedule_work(&desc->service_outs_intr);
}
-#else /* CONFIG_WWAN_CORE */
+#else /* CONFIG_WWAN */
static void wdm_wwan_init(struct wdm_device *desc) {}
static void wdm_wwan_deinit(struct wdm_device *desc) {}
static void wdm_wwan_rx(struct wdm_device *desc, int length) {}
-#endif /* CONFIG_WWAN_CORE */
+#endif /* CONFIG_WWAN */

/* --- error handling --- */
static void wdm_rxwork(struct work_struct *work)
--
2.33.0


2021-09-29 19:53:23

by Rikard Falkeborn

[permalink] [raw]
Subject: Re: [PATCH 1/2] usb: cdc-wdm: Fix check for WWAN

On Wed, Sep 29, 2021 at 03:21:42PM +0200, Rikard Falkeborn wrote:
> Commit 5c912e679506 ("usb: cdc-wdm: fix build error when CONFIG_WWAN_CORE
> is not set") fixed a build error when CONFIG_WWAN was set but
> CONFIG_WWAN_CORE was not. Since then CONFIG_WWAN_CORE was removed and
> joined with CONFIG_WWAN in commit 89212e160b81 ("net: wwan: Fix WWAN
> config symbols").
>
> Also, since CONFIG_WWAN has class tri-state instead of bool, we cannot
> check if it is defined directly, but have to use IS_DEFINED() instead.

That last part is wrong, sorry for the noise. I'll send a V2.

Rikard

2021-09-30 14:22:59

by Oliver Neukum

[permalink] [raw]
Subject: Re: [PATCH 1/2] usb: cdc-wdm: Fix check for WWAN


On 29.09.21 15:21, Rikard Falkeborn wrote:
> Commit 5c912e679506 ("usb: cdc-wdm: fix build error when CONFIG_WWAN_CORE
> is not set") fixed a build error when CONFIG_WWAN was set but
> CONFIG_WWAN_CORE was not. Since then CONFIG_WWAN_CORE was removed and
> joined with CONFIG_WWAN in commit 89212e160b81 ("net: wwan: Fix WWAN
> config symbols").
>
> Also, since CONFIG_WWAN has class tri-state instead of bool, we cannot
> check if it is defined directly, but have to use IS_DEFINED() instead.
>
> Fixes: 5c912e679506 ("usb: cdc-wdm: fix build error when CONFIG_WWAN_CORE is not set")
> Cc: <[email protected]>
> Signed-off-by: Rikard Falkeborn <[email protected]>
Acked-by: Oliver Neukum <[email protected]>