Re: [PATCH -next] usb: add usb.h stubs for CONFIG_USB not enabled

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 18 May 2012, Randy Dunlap wrote:

> From: Randy Dunlap <rdunlap@xxxxxxxxxxxx>
> 
> Add stubs for some usb core functions when CONFIG_USB
> is not enabled.  This fixes these comedi build errors:
> 
> ERROR: "usb_deregister" [drivers/staging/comedi/comedi.ko] undefined!
> ERROR: "usb_register_driver" [drivers/staging/comedi/comedi.ko] undefined!
> 
> Signed-off-by: Randy Dunlap <rdunlap@xxxxxxxxxxxx>
> ---
> I am only adding the stubs that are needed for comedi to build.
> I expect that more stubs will be needed as more build errors are
> found.  It seems to me that linux/usb.h might need more (major)
> moving of lines to support more stubs in the future.

This doesn't seem like the right thing to do.  If a driver needs to 
register with the USB core then that driver should depend on 
CONFIG_USB.

On the other hand, if the driver is capable of being built without USB 
support then it should use the necessary preprocessor tests to protect 
calls to any USB routines.

Alan Stern

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux