linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Randy Dunlap <randy.dunlap@oracle.com>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: linux-next@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
	Greg KH <gregkh@suse.de>, Sebastian Haas <haas@ems-wuensche.com>
Subject: [PATCH -next] cpc-usb: fix PROC_FS dependency
Date: Fri, 22 May 2009 09:30:29 -0700	[thread overview]
Message-ID: <4A16D325.4030202@oracle.com> (raw)
In-Reply-To: <20090522185110.3f95b03e.sfr@canb.auug.org.au>

From: Randy Dunlap <randy.dunlap@oracle.com>

The proper way to check for and enforce a kconfig symbol
dependency is via Kconfig files, not by using #error in
a source file followed by 9 other compile errors.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Sebastian Haas <haas@ems-wuensche.com>
---
 drivers/staging/cpc-usb/Kconfig       |    2 +-
 drivers/staging/cpc-usb/cpc-usb_drv.c |   10 +---------
 2 files changed, 2 insertions(+), 10 deletions(-)

--- linux-next-20090522.orig/drivers/staging/cpc-usb/cpc-usb_drv.c
+++ linux-next-20090522/drivers/staging/cpc-usb/cpc-usb_drv.c
@@ -27,12 +27,8 @@
 #include <linux/completion.h>
 #include <asm/uaccess.h>
 #include <linux/usb.h>
-
 #include <linux/version.h>
-
-#ifdef CONFIG_PROC_FS
-#   include <linux/proc_fs.h>
-#endif
+#include <linux/proc_fs.h>
 
 #include "cpc.h"
 
@@ -57,10 +53,6 @@ MODULE_LICENSE("GPL v2");
 #define USB_CPCUSB_M16C_PRODUCT_ID    0x0888
 #define USB_CPCUSB_LPC2119_PRODUCT_ID 0x0444
 
-#ifndef CONFIG_PROC_FS
-#error "PROCFS needed"
-#endif
-
 #define CPC_USB_PROC_DIR     CPC_PROC_DIR "cpc-usb"
 
 static struct proc_dir_entry *procDir;
--- linux-next-20090522.orig/drivers/staging/cpc-usb/Kconfig
+++ linux-next-20090522/drivers/staging/cpc-usb/Kconfig
@@ -1,4 +1,4 @@
 config USB_CPC
 	tristate "CPC CAN USB driver"
-	depends on USB
+	depends on USB && PROC_FS
 	default n



-- 
~Randy
LPC 2009, Sept. 23-25, Portland, Oregon
http://linuxplumbersconf.org/2009/

  parent reply	other threads:[~2009-05-22 16:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-22  8:51 linux-next: Tree for May 22 Stephen Rothwell
2009-05-22 16:05 ` linux-next: Tree for May 22 (staging/) Randy Dunlap
2009-05-22 16:30 ` Randy Dunlap [this message]
2009-05-22 16:36   ` [PATCH -next] cpc-usb: fix PROC_FS dependency Randy Dunlap
2009-05-25  4:51     ` Sebastian Haas

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=4A16D325.4030202@oracle.com \
    --to=randy.dunlap@oracle.com \
    --cc=gregkh@suse.de \
    --cc=haas@ems-wuensche.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    /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 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).