From mboxrd@z Thu Jan 1 00:00:00 1970 From: Randy Dunlap Subject: Re: [PATCH -next] usb: add usb.h stubs for CONFIG_USB not enabled Date: Sat, 19 May 2012 08:48:52 -0700 Message-ID: <4FB7C0E4.4000008@xenotime.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from oproxy8-pub.bluehost.com ([69.89.22.20]:48892 "HELO oproxy8-pub.bluehost.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1753547Ab2ESPsp (ORCPT ); Sat, 19 May 2012 11:48:45 -0400 In-Reply-To: Sender: linux-next-owner@vger.kernel.org List-ID: To: Alan Stern Cc: Greg Kroah-Hartman , Stephen Rothwell , linux-next@vger.kernel.org, LKML , Ian Abbott , Frank Mori Hess , devel@driverdev.osuosl.org, USB list On 05/19/2012 07:30 AM, Alan Stern wrote: > On Fri, 18 May 2012, Randy Dunlap wrote: > >> From: Randy Dunlap >> >> 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 >> --- >> 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. Yeah, my first patch (not on linux-usb list) to staging/comedi/drivers.c just surrounded the usb helper functions with IS_ENABLED(CONFIG_USB). I'm fine with that patch, but Greg said that he wanted stubs... -- ~Randy