dm: usb.h: Always declare usb func. prototypes when CONFIG_DM_USB=y
PATCH 1/1 dm: usb.h: Always declare usb func. prototypes when CONFIG_DM_USB=y
When CONFIG_DM_USB=y the various usb functions are available regardless of any controller drivers being enabled, so always the usb function prototypes when CONFIG_DM_USB=y.
This fixes compile warnings due to missing prototypes on ARCHs where the ARCH Kconfig always enables CONFIG_DM_USB and various usb drivers.
One could argue that in the case of no controllers CONFIG_DM_USB should not be set, but this problem is typically seen during bringup of boards which do actually have usb controllers.
--- include/usb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/usb.h +1 -1
@@ -180,7 +180,7 @@ enum usb_init_type {defined (CONFIG_USB_MUSB_DSPS ) ||defined (CONFIG_USB_MUSB_AM35X ) || \defined (CONFIG_USB_MUSB_OMAP2PLUS ) ||defined (CONFIG_USB_MUSB_SUNXI ) || \defined (CONFIG_USB_XHCI ) ||defined (CONFIG_USB_DWC2 ) || \ - defined(CONFIG_USB_EMUL) + defined(CONFIG_USB_EMUL) || defined(CONFIG_DM_USB)int usb_lowlevel_init (int index,enum usb_init_type init,void **controller);int usb_lowlevel_stop (int index);
Signature · 1 line
2.4.2
PATCH 1/1 dm: usb.h: Always declare usb func. prototypes when CONFIG_DM_USB=y
Quoted 21 lines · Hans de Goede
When
CONFIG_DM_USB=ythe various usb functions are available regardless of any controller drivers being enabled, so always the usb function prototypes whenCONFIG_DM_USB=y.This fixes compile warnings due to missing prototypes on ARCHs where the ARCH
Kconfigalways enablesCONFIG_DM_USBand various usb drivers.One could argue that in the case of no controllers
CONFIG_DM_USBshould not be set, but this problem is typically seen during bringup of boards which do actually have usb controllers.Signed-off-by Hans de Goede <[email protected]>--- include/usb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/usb.h +0
-0
include/usb.h enum usb_init_type { · line 181
Quoted 2 lines
include/usb.h +0
-0@@ -180,7 +180,7 @@ enum usb_init_type {defined (CONFIG_USB_MUSB_DSPS ) ||defined (CONFIG_USB_MUSB_AM35X ) || \ defined(CONFIG_USB_MUSB_OMAP2PLUS) || defined(CONFIG_USB_MUSB_SUNXI) ||
\
include/usb.h enum usb_init_type { · line 183
Quoted 3 lines
include/usb.h +1
-1defined (CONFIG_USB_XHCI ) ||defined (CONFIG_USB_DWC2 ) || \ -defined (CONFIG_USB_EMUL ) +defined (CONFIG_USB_EMUL ) ||defined (CONFIG_DM_USB )
What would happen in case we instead dropped this horrible ifdef altogether, do you think it'd break anything ?
include/usb.h enum usb_init_type { · line 185
Quoted 2 lines
include/usb.h +0
-0int usb_lowlevel_init (int index,enum usb_init_type init,void **controller);int usb_lowlevel_stop (int index);
Best regards,
Marek Vasut
PATCH 1/1 dm: usb.h: Always declare usb func. prototypes when CONFIG_DM_USB=y
Hi,
Quoted 25 lines · Marek Vasut
Quoted 21 lines · Hans de Goede
When
CONFIG_DM_USB=ythe various usb functions are available regardless of any controller drivers being enabled, so always the usb function prototypes whenCONFIG_DM_USB=y.This fixes compile warnings due to missing prototypes on ARCHs where the ARCH
Kconfigalways enablesCONFIG_DM_USBand various usb drivers.One could argue that in the case of no controllers
CONFIG_DM_USBshould not be set, but this problem is typically seen during bringup of boards which do actually have usb controllers.Signed-off-by Hans de Goede <[email protected]>--- include/usb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/usb.h +0
-0include/usb.h enum usb_init_type { · line 181
Quoted 2 lines
include/usb.h +0
-0@@ -180,7 +180,7 @@ enum usb_init_type {defined (CONFIG_USB_MUSB_DSPS ) ||defined (CONFIG_USB_MUSB_AM35X ) || \ defined(CONFIG_USB_MUSB_OMAP2PLUS) || defined(CONFIG_USB_MUSB_SUNXI) ||\
Quoted 6 lines
include/usb.h enum usb_init_type { · line 183
Quoted 3 lines
include/usb.h +1
-1defined (CONFIG_USB_XHCI ) ||defined (CONFIG_USB_DWC2 ) || \ -defined (CONFIG_USB_EMUL ) +defined (CONFIG_USB_EMUL ) ||defined (CONFIG_DM_USB )What would happen in case we instead dropped this horrible ifdef altogether, do you think it'd break anything ?
I've not audited the code, but I believe that it only declares a bunch of function prototypes, so I think that dropping the entire #ifdef is fine.
Regards,
Hans
PATCH 1/1 dm: usb.h: Always declare usb func. prototypes when CONFIG_DM_USB=y
Quoted 41 lines · Hans de Goede
Hi,
Quoted 30 lines · Marek Vasut
Quoted 22 lines · Hans de Goede
When
CONFIG_DM_USB=ythe various usb functions are available regardless of any controller drivers being enabled, so always the usb function prototypes whenCONFIG_DM_USB=y.This fixes compile warnings due to missing prototypes on ARCHs where the ARCH
Kconfigalways enablesCONFIG_DM_USBand various usb drivers.One could argue that in the case of no controllers
CONFIG_DM_USBshould not be set, but this problem is typically seen during bringup of boards which do actually have usb controllers.Signed-off-by Hans de Goede <[email protected]>---
include/usb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/usb.h +0
-0include/usb.h enum usb_init_type { · line 183
Quoted 4 lines
include/usb.h +0
-0@@ -180,7 +180,7 @@ enum usb_init_type {defined (CONFIG_USB_MUSB_DSPS ) ||defined (CONFIG_USB_MUSB_AM35X ) || \defined (CONFIG_USB_MUSB_OMAP2PLUS ) ||defined (CONFIG_USB_MUSB_SUNXI ) ||\
Quoted 7 lines
include/usb.h enum usb_init_type { · line 183
Quoted 4 lines
include/usb.h +1
-1defined (CONFIG_USB_XHCI ) ||defined (CONFIG_USB_DWC2 ) || \ -defined (CONFIG_USB_EMUL ) +defined (CONFIG_USB_EMUL ) ||defined (CONFIG_DM_USB )What would happen in case we instead dropped this horrible ifdef altogether, do you think it'd break anything ?
Quoted 3 lines
I've not audited the code, but I believe that it only declares a bunch of function prototypes, so I think that dropping the entire #ifdef is fine.
So do I :)
Best regards,
Marek Vasut
PATCH 1/1 dm: usb.h: Always declare usb func. prototypes when CONFIG_DM_USB=y
Hi,
Quoted 42 lines · Marek Vasut
Quoted 41 lines · Hans de Goede
Hi,
Quoted 37 lines · Marek Vasut
Quoted 22 lines · Hans de Goede
When
CONFIG_DM_USB=ythe various usb functions are available regardless of any controller drivers being enabled, so always the usb function prototypes whenCONFIG_DM_USB=y.This fixes compile warnings due to missing prototypes on ARCHs where the ARCH
Kconfigalways enablesCONFIG_DM_USBand various usb drivers.One could argue that in the case of no controllers
CONFIG_DM_USBshould not be set, but this problem is typically seen during bringup of boards which do actually have usb controllers.Signed-off-by Hans de Goede <[email protected]>---
include/usb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/usb.h +0
-0include/usb.h enum usb_init_type { · line 183
Quoted 4 lines
include/usb.h +0
-0@@ -180,7 +180,7 @@ enum usb_init_type {defined (CONFIG_USB_MUSB_DSPS ) ||defined (CONFIG_USB_MUSB_AM35X ) || \defined (CONFIG_USB_MUSB_OMAP2PLUS ) ||defined (CONFIG_USB_MUSB_SUNXI ) ||\
include/usb.h enum usb_init_type { · line 183
Quoted 4 lines
include/usb.h +1
-1defined (CONFIG_USB_XHCI ) ||defined (CONFIG_USB_DWC2 ) || \ -defined (CONFIG_USB_EMUL ) +defined (CONFIG_USB_EMUL ) ||defined (CONFIG_DM_USB )What would happen in case we instead dropped this horrible ifdef altogether, do you think it'd break anything ?
Quoted 5 lines
Quoted 3 lines
I've not audited the code, but I believe that it only declares a bunch of function prototypes, so I think that dropping the entire #ifdef is fine.
So do I :)
I was actually hoping that you would do it :)
Regards,
Hans
PATCH 1/1 dm: usb.h: Always declare usb func. prototypes when CONFIG_DM_USB=y
Quoted 25 lines · Hans de Goede
Hi,
Quoted 22 lines · Marek Vasut
Quoted 21 lines · Hans de Goede
Hi,
Quoted 18 lines · Marek Vasut
Quoted 17 lines · Hans de Goede
When
CONFIG_DM_USB=ythe various usb functions are available regardless of any controller drivers being enabled, so always the usb function prototypes whenCONFIG_DM_USB=y.This fixes compile warnings due to missing prototypes on ARCHs where the ARCH
Kconfigalways enablesCONFIG_DM_USBand various usb drivers.One could argue that in the case of no controllers
CONFIG_DM_USBshould not be set, but this problem is typically seen during bringup of boards which do actually have usb controllers.Signed-off-by Hans de Goede <[email protected]>---
include/usb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
include/usb.h enum usb_init_type { · line 181
Quoted 7 lines
include/usb.h +0
-0@@ -180,7 +180,7 @@ enum usb_init_type {defined (CONFIG_USB_MUSB_DSPS ) ||defined (CONFIG_USB_MUSB_AM35X )
|| > >>>> \ defined(CONFIG_USB_MUSB_OMAP2PLUS) || > >>>> defined(CONFIG_USB_MUSB_SUNXI)
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 10 lines
\
include/usb.h enum usb_init_type { · line 183
Quoted 4 lines
include/usb.h +1
-1defined (CONFIG_USB_XHCI ) ||defined (CONFIG_USB_DWC2 ) || \ -defined (CONFIG_USB_EMUL ) +defined (CONFIG_USB_EMUL ) ||defined (CONFIG_DM_USB )What would happen in case we instead dropped this horrible ifdef altogether, do you think it'd break anything ?
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
I've not audited the code, but I believe that it only declares a bunch of function prototypes, so I think that dropping the entire #ifdef is fine.
So do I :)
I was actually hoping that you would do it :)
So V2 is coming ? :)
Best regards,
Marek Vasut