All of lore.kernel.org
 help / color / mirror / Atom feed
From: Randy Dunlap <rdunlap@xenotime.net>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Alan Stern <stern@rowland.harvard.edu>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	linux-next@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
	Ian Abbott <abbotti@mev.co.uk>,
	Frank Mori Hess <fmhess@users.sourceforge.net>,
	devel@driverdev.osuosl.org, USB list <linux-usb@vger.kernel.org>
Subject: [PATCH] staging/comedi: fix build for USB not enabled
Date: Mon, 11 Jun 2012 16:35:50 -0700	[thread overview]
Message-ID: <4FD680D6.8010509@xenotime.net> (raw)
In-Reply-To: <20120611230723.GA25565@kroah.com>

From: Randy Dunlap <rdunlap@xenotime.net>

Calls to optional subsystems cannot be made indiscriminately.
Enclose all of the usb helper functions inside
#if IS_ENABLED(CONFIG_USB)
to fix these build errors.

(The pci helper functions are OK since there are stubs in
linux/pci.h for the called functions when PCI is not enabled.
Possibly the same could be done for the called USB functions.)

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@xenotime.net>
Cc:	Ian Abbott <abbotti@mev.co.uk>
Cc:	Frank Mori Hess <fmhess@users.sourceforge.net>
---
 drivers/staging/comedi/drivers.c |    5 +++++
 1 file changed, 5 insertions(+)

--- linux-next-20120518.orig/drivers/staging/comedi/drivers.c
+++ linux-next-20120518/drivers/staging/comedi/drivers.c
@@ -30,6 +30,7 @@
 #include <linux/pci.h>
 #include <linux/usb.h>
 #include <linux/errno.h>
+#include <linux/kconfig.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/fcntl.h>
@@ -981,6 +982,8 @@ void comedi_pci_driver_unregister(struct
 }
 EXPORT_SYMBOL_GPL(comedi_pci_driver_unregister);
 
+#if IS_ENABLED(CONFIG_USB)
+
 static int comedi_old_usb_auto_config(struct usb_interface *intf,
 				      struct comedi_driver *driver)
 {
@@ -1043,3 +1046,5 @@ void comedi_usb_driver_unregister(struct
 	comedi_driver_unregister(comedi_driver);
 }
 EXPORT_SYMBOL_GPL(comedi_usb_driver_unregister);
+
+#endif

  reply	other threads:[~2012-06-11 23:35 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-18  8:49 linux-next: Tree for May 18 Stephen Rothwell
2012-05-19  0:46 ` [PATCH -next] comedi: fix build when USB is not enabled Randy Dunlap
2012-05-19  0:50   ` Greg Kroah-Hartman
2012-05-19  0:51     ` Randy Dunlap
2012-05-19  2:04     ` [PATCH -next] usb: add usb.h stubs for CONFIG_USB " Randy Dunlap
2012-05-19  2:04       ` Randy Dunlap
     [not found]       ` <4FB6FFBF.6000509-/UHa2rfvQTnk1uMJSBkQmQ@public.gmane.org>
2012-05-19 14:16         ` Sergei Shtylyov
2012-05-19 14:16           ` Sergei Shtylyov
2012-05-19 15:45           ` Randy Dunlap
2012-05-19 16:12             ` Greg Kroah-Hartman
2012-05-19 16:12               ` Greg Kroah-Hartman
2012-05-19 16:31               ` [PATCH -next v2] " Randy Dunlap
2012-05-21 16:48                 ` H Hartley Sweeten
2012-05-19 14:30       ` [PATCH -next] " Alan Stern
2012-05-19 14:30         ` Alan Stern
2012-05-19 15:48         ` Randy Dunlap
     [not found]           ` <4FB7C0E4.4000008-/UHa2rfvQTnk1uMJSBkQmQ@public.gmane.org>
2012-06-11 23:07             ` Greg Kroah-Hartman
2012-06-11 23:07               ` Greg Kroah-Hartman
2012-06-11 23:35               ` Randy Dunlap [this message]
2012-05-19  1:02 ` linux-next: Tree for May 18 (drm drivers and vgacon) Randy Dunlap
2012-05-19 15:40   ` Dave Airlie
2012-05-19  2:16 ` linux-next: Tree for May 18 (edac) Randy Dunlap
2012-05-19 12:03   ` Mauro Carvalho Chehab
2012-05-19 15:50     ` Randy Dunlap

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4FD680D6.8010509@xenotime.net \
    --to=rdunlap@xenotime.net \
    --cc=abbotti@mev.co.uk \
    --cc=devel@driverdev.osuosl.org \
    --cc=fmhess@users.sourceforge.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    --cc=stern@rowland.harvard.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.