linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next v2] usb: dwc3: include extcon.h to fix compile error
@ 2022-05-11  2:26 Guan Jing
  2022-05-11 16:42 ` Jack Pham
  2022-05-12  7:38 ` Greg KH
  0 siblings, 2 replies; 3+ messages in thread
From: Guan Jing @ 2022-05-11  2:26 UTC (permalink / raw)
  To: balbi, gregkh; +Cc: linux-usb, linux-kernel, Guan Jing

If dwc3 is not include extcon.h, the dwc3 driver
will fail to link:

drivers/usb/dwc3/core.o: In function `dwc3_probe':
core.c:(.text+0x1095): undefined reference to `extcon_get_edev_by_phandle'
core.c:(.text+0x10bd): undefined reference to `extcon_get_extcon_dev'

Add miss #include <linux/extcon.h> to fix this error.

Fixes: 0f0101719138 ("usb: dwc3: Don't switch OTG -> peripheral if extcon is present")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Guan Jing <guanjing6@huawei.com>
---
 drivers/usb/dwc3/core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index 950e238c65bf..e619a3ef6c46 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -28,6 +28,7 @@
 #include <linux/pinctrl/consumer.h>
 #include <linux/reset.h>
 #include <linux/bitfield.h>
+#include <linux/extcon.h>
 
 #include <linux/usb/ch9.h>
 #include <linux/usb/gadget.h>
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH -next v2] usb: dwc3: include extcon.h to fix compile error
  2022-05-11  2:26 [PATCH -next v2] usb: dwc3: include extcon.h to fix compile error Guan Jing
@ 2022-05-11 16:42 ` Jack Pham
  2022-05-12  7:38 ` Greg KH
  1 sibling, 0 replies; 3+ messages in thread
From: Jack Pham @ 2022-05-11 16:42 UTC (permalink / raw)
  To: Guan Jing; +Cc: balbi, gregkh, linux-usb, linux-kernel

On Wed, May 11, 2022 at 10:26:22AM +0800, Guan Jing wrote:
> If dwc3 is not include extcon.h, the dwc3 driver
> will fail to link:

That doesn't make sense... If the header/definitions aren't present you
should certainly see errors earlier on in the compilation of the object,
not the linker.

> drivers/usb/dwc3/core.o: In function `dwc3_probe':
> core.c:(.text+0x1095): undefined reference to `extcon_get_edev_by_phandle'
> core.c:(.text+0x10bd): undefined reference to `extcon_get_extcon_dev'
> 
> Add miss #include <linux/extcon.h> to fix this error.
> 
> Fixes: 0f0101719138 ("usb: dwc3: Don't switch OTG -> peripheral if extcon is present")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Guan Jing <guanjing6@huawei.com>
> ---
>  drivers/usb/dwc3/core.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> index 950e238c65bf..e619a3ef6c46 100644
> --- a/drivers/usb/dwc3/core.c
> +++ b/drivers/usb/dwc3/core.c
> @@ -28,6 +28,7 @@
>  #include <linux/pinctrl/consumer.h>
>  #include <linux/reset.h>
>  #include <linux/bitfield.h>
> +#include <linux/extcon.h>
>  
>  #include <linux/usb/ch9.h>
>  #include <linux/usb/gadget.h>

Below this we also have

 #include <linux/usb/otg.h>

Which itself has

 #include <linux/usb/phy.h>

Which also does

 #include <linux/extcon.h>

So extcon.h would have already been included via this nesting...

Jack

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH -next v2] usb: dwc3: include extcon.h to fix compile error
  2022-05-11  2:26 [PATCH -next v2] usb: dwc3: include extcon.h to fix compile error Guan Jing
  2022-05-11 16:42 ` Jack Pham
@ 2022-05-12  7:38 ` Greg KH
  1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2022-05-12  7:38 UTC (permalink / raw)
  To: Guan Jing; +Cc: balbi, linux-usb, linux-kernel

On Wed, May 11, 2022 at 10:26:22AM +0800, Guan Jing wrote:
> If dwc3 is not include extcon.h, the dwc3 driver
> will fail to link:
> 
> drivers/usb/dwc3/core.o: In function `dwc3_probe':
> core.c:(.text+0x1095): undefined reference to `extcon_get_edev_by_phandle'
> core.c:(.text+0x10bd): undefined reference to `extcon_get_extcon_dev'
> 
> Add miss #include <linux/extcon.h> to fix this error.
> 
> Fixes: 0f0101719138 ("usb: dwc3: Don't switch OTG -> peripheral if extcon is present")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Guan Jing <guanjing6@huawei.com>
> ---
>  drivers/usb/dwc3/core.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> index 950e238c65bf..e619a3ef6c46 100644
> --- a/drivers/usb/dwc3/core.c
> +++ b/drivers/usb/dwc3/core.c
> @@ -28,6 +28,7 @@
>  #include <linux/pinctrl/consumer.h>
>  #include <linux/reset.h>
>  #include <linux/bitfield.h>
> +#include <linux/extcon.h>
>  
>  #include <linux/usb/ch9.h>
>  #include <linux/usb/gadget.h>
> -- 
> 2.17.1
> 

As Jack said, this will not fix a linker error.  I think something else
is wrong with your system as your .config file builds just fine for me.

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-05-12  7:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-11  2:26 [PATCH -next v2] usb: dwc3: include extcon.h to fix compile error Guan Jing
2022-05-11 16:42 ` Jack Pham
2022-05-12  7:38 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).