From: Adrian Bunk <bunk@stusta.de>
To: Greg KH <greg@kroah.com>
Cc: Alan Stern <stern@rowland.harvard.edu>,
Andrew Morton <akpm@osdl.org>, Pete Zaitcev <zaitcev@redhat.com>,
linux-kernel@vger.kernel.org,
linux-usb-devel@lists.sourceforge.net,
mdharm-usb@one-eyed-alien.net
Subject: [-mm patch] USB_LIBUSUAL shouldn't be user-visible
Date: Tue, 8 Nov 2005 01:47:16 +0100 [thread overview]
Message-ID: <20051108004716.GJ3847@stusta.de> (raw)
In-Reply-To: <20051107222840.GB26417@kroah.com>
On Mon, Nov 07, 2005 at 02:28:40PM -0800, Greg KH wrote:
> On Mon, Nov 07, 2005 at 05:26:10PM -0500, Alan Stern wrote:
> > On Mon, 7 Nov 2005, Greg KH wrote:
> >
> > > On Mon, Nov 07, 2005 at 10:10:28PM +0100, Adrian Bunk wrote:
> > > > On Sun, Nov 06, 2005 at 06:24:47PM -0800, Andrew Morton wrote:
> > > > >...
> > > > > Changes since 2.6.14-rc5-mm1:
> > > > >...
> > > > > +gregkh-usb-usb-libusual.patch
> > > > >
> > > > > USB tree updates
> > > > >...
> > > >
> > > > IMHO, CONFIG_USB_LIBUSUAL shouldn't be a user-visible variable but
> > > > should be automatically enabled when it makes sense.
> > >
> > > The trick is, when does it "make sense"?
> > >
> > > Anyone have any ideas?
> >
> > The simplest answer is to configure it whenever usb-storage and ub are
> > both configured. libusual has no purpose otherwise.
>
> Ok, care to write up the Kconfig for that?
Patch below.
The more I think about it, the more I think that this might be a bit too
complicated.
What about letting the two drivers always use libusual?
> thanks,
>
> greg k-h
cu
Adrian
<-- snip -->
This patch changes CONFIG_USB_LIBUSUAL to be no longer user-visible.
If both drivers are built and at least one of them is built statically
into the kernel, libusual is built statically into the kernel.
If both drivers are built modular, libusual is built modular.
If one or zero of the two drivers are built, libusual is not built.
The additional CONFIG_USB_LIBUSUAL_BUILT is only present because I do
really dislike writing
#if defined(CONFIG_USB_LIBUSUAL) || defined(CONFIG_USB_LIBUSUAL_MODULE)
and I've already seen several places where people have gotten this
wrong.
Signed-off-by: Adrian Bunk <bunk@stusta.de>
---
drivers/block/Kconfig | 3 ---
drivers/block/ub.c | 4 ++--
drivers/usb/Makefile | 1 +
drivers/usb/storage/Kconfig | 17 ++++++-----------
drivers/usb/storage/Makefile | 4 +---
drivers/usb/storage/usb.c | 4 ++--
include/linux/usb_usual.h | 4 ++--
--- linux-2.6.14-mm1-full/drivers/usb/storage/Kconfig.old 2005-11-08 00:52:18.000000000 +0100
+++ linux-2.6.14-mm1-full/drivers/usb/storage/Kconfig 2005-11-08 01:23:55.000000000 +0100
@@ -126,15 +126,10 @@
cuts)
config USB_LIBUSUAL
- bool "The shared table of common (or usual) storage devices"
- depends on USB
- help
- This module contains a table of common (or usual) devices
- for usb-storage and ub drivers, and allows to switch binding
- of these devices without rebuilding modules.
+ tristate
+ default y if ((USB_STORAGE=y && BLK_DEV_UB) || (BLK_DEV_UB=y && USB_STORAGE))
+ default m if (USB_STORAGE && BLK_DEV_UB)
+ select USB_LIBUSUAL_BUILT
- Typical syntax of /etc/modprobe.conf is:
-
- options libusual bias="ub"
-
- If unsure, say N.
+config USB_LIBUSUAL_BUILT
+ bool
--- linux-2.6.14-mm1-full/drivers/usb/storage/Makefile.old 2005-11-08 00:53:46.000000000 +0100
+++ linux-2.6.14-mm1-full/drivers/usb/storage/Makefile 2005-11-08 01:23:55.000000000 +0100
@@ -23,6 +23,4 @@
usb-storage-objs := scsiglue.o protocol.o transport.o usb.o \
initializers.o $(usb-storage-obj-y)
-ifneq ($(CONFIG_USB_LIBUSUAL),)
- obj-$(CONFIG_USB) += libusual.o
-endif
+obj-$(CONFIG_USB_LIBUSUAL) += libusual.o
--- linux-2.6.14-mm1-full/drivers/usb/Makefile.old 2005-11-08 01:31:00.000000000 +0100
+++ linux-2.6.14-mm1-full/drivers/usb/Makefile 2005-11-08 01:31:26.000000000 +0100
@@ -22,6 +22,7 @@
obj-$(CONFIG_USB_PRINTER) += class/
obj-$(CONFIG_USB_STORAGE) += storage/
+obj-$(CONFIG_USB_LIBUSUAL) += storage/
obj-$(CONFIG_USB_AIPTEK) += input/
obj-$(CONFIG_USB_ATI_REMOTE) += input/
--- linux-2.6.14-mm1-full/drivers/block/Kconfig.old 2005-11-08 00:54:56.000000000 +0100
+++ linux-2.6.14-mm1-full/drivers/block/Kconfig 2005-11-08 01:23:55.000000000 +0100
@@ -358,9 +358,6 @@
This driver supports certain USB attached storage devices
such as flash keys.
- If you enable this driver, it is recommended to avoid conflicts
- with usb-storage by enabling USB_LIBUSUAL.
-
If unsure, say N.
config BLK_DEV_RAM
--- linux-2.6.14-mm1-full/include/linux/usb_usual.h.old 2005-11-08 00:56:15.000000000 +0100
+++ linux-2.6.14-mm1-full/include/linux/usb_usual.h 2005-11-08 01:23:55.000000000 +0100
@@ -107,7 +107,7 @@
/*
*/
-#ifdef CONFIG_USB_LIBUSUAL
+#ifdef CONFIG_USB_LIBUSUAL_BUILT
extern struct usb_device_id storage_usb_ids[];
extern void usb_usual_set_present(int type);
@@ -118,6 +118,6 @@
#define usb_usual_set_present(t) do { } while(0)
#define usb_usual_clear_present(t) do { } while(0)
#define usb_usual_check_type(id, t) (0)
-#endif /* CONFIG_USB_LIBUSUAL */
+#endif /* CONFIG_USB_LIBUSUAL_BUILT */
#endif /* __LINUX_USB_USUAL_H */
--- linux-2.6.14-mm1-full/drivers/usb/storage/usb.c.old 2005-11-08 00:57:30.000000000 +0100
+++ linux-2.6.14-mm1-full/drivers/usb/storage/usb.c 2005-11-08 01:23:55.000000000 +0100
@@ -116,7 +116,7 @@
* The entries in this table correspond, line for line,
* with the entries of us_unusual_dev_list[].
*/
-#ifndef CONFIG_USB_LIBUSUAL
+#ifndef CONFIG_USB_LIBUSUAL_BUILT
#define UNUSUAL_DEV(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax, \
vendorName, productName,useProtocol, useTransport, \
@@ -138,7 +138,7 @@
};
MODULE_DEVICE_TABLE (usb, storage_usb_ids);
-#endif /* CONFIG_USB_LIBUSUAL */
+#endif /* CONFIG_USB_LIBUSUAL_BUILT */
/* This is the list of devices we recognize, along with their flag data */
--- linux-2.6.14-mm1-full/drivers/block/ub.c.old 2005-11-08 00:57:52.000000000 +0100
+++ linux-2.6.14-mm1-full/drivers/block/ub.c 2005-11-08 01:23:55.000000000 +0100
@@ -413,7 +413,7 @@
/*
*/
-#ifdef CONFIG_USB_LIBUSUAL
+#ifdef CONFIG_USB_LIBUSUAL_BUILT
#define ub_usb_ids storage_usb_ids
#else
@@ -424,7 +424,7 @@
};
MODULE_DEVICE_TABLE(usb, ub_usb_ids);
-#endif /* CONFIG_USB_LIBUSUAL */
+#endif /* CONFIG_USB_LIBUSUAL_BUILT */
/*
* Find me a way to identify "next free minor" for add_disk(),
next prev parent reply other threads:[~2005-11-08 0:47 UTC|newest]
Thread overview: 65+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-07 2:24 2.6.14-mm1 Andrew Morton
2005-11-07 3:25 ` 2.6.14-mm1 Christoph Hellwig
2005-11-07 6:12 ` 2.6.14-mm1 Andrew Morton
2005-11-07 6:34 ` 2.6.14-mm1 Herbert Xu
2005-11-07 3:30 ` 2.6.14-mm1 Christoph Hellwig
2005-11-07 12:18 ` 2.6.14-mm1 Roman Zippel
2005-11-07 17:02 ` 2.6.14-mm1 Christoph Hellwig
2005-11-07 17:23 ` 2.6.14-mm1 Roman Zippel
2005-11-07 12:41 ` 2.6.14-mm1 Geert Uytterhoeven
2005-11-07 4:04 ` 2.6.14-mm1 Brice Goglin
2005-11-07 4:10 ` 2.6.14-mm1 Reuben Farrelly
2005-11-07 6:07 ` 2.6.14-mm1 Andrew Morton
2005-11-07 8:24 ` 2.6.14-mm1 Benoit Boissinot
2005-11-07 9:54 ` 2.6.14-mm1 Reuben Farrelly
2005-11-07 10:09 ` 2.6.14-mm1 Andrew Morton
2005-11-07 10:26 ` 2.6.14-mm1 Neil Brown
2005-11-07 10:37 ` 2.6.14-mm1 Andrew Morton
2005-11-07 10:44 ` 2.6.14-mm1 Reuben Farrelly
2005-11-07 18:52 ` 2.6.14-mm1 Andrew Morton
2005-11-07 19:27 ` 2.6.14-mm1 Alan Stern
2005-11-07 21:43 ` 2.6.14-mm1 J.A. Magallon
2005-11-08 0:07 ` 2.6.14-mm1 J.A. Magallon
2005-11-08 14:21 ` 2.6.14-mm1 James Bottomley
2005-11-09 0:30 ` 2.6.14-mm1 Reuben Farrelly
2005-11-07 12:00 ` 2.6.14-mm1 Jiri Slaby
2005-11-07 15:04 ` 2.6.14-mm1 Dustin Kirkland
2005-11-07 15:11 ` 2.6.14-mm1 Jiri Slaby
2005-11-07 16:15 ` 2.6.14-mm1 Alexander E. Patrakov
2005-11-07 19:52 ` 2.6.14-mm1 Andrew Morton
2005-11-07 20:07 ` 2.6.14-mm1 Greg KH
2005-11-07 20:30 ` 2.6.14-mm1 Dmitry Torokhov
2005-11-07 20:21 ` 2.6.14-mm1 Valdis.Kletnieks
2005-11-07 20:40 ` 2.6.14-mm1 Dmitry Torokhov
2005-11-07 20:46 ` 2.6.14-mm1 Andrew Morton
2005-11-11 9:32 ` 2.6.14-mm1 Alexander E. Patrakov
[not found] ` <437472DA.4090001@linuxfromscratch.org>
2005-11-11 11:50 ` 2.6.14-mm1 Alexander E. Patrakov
2005-11-07 17:37 ` 2.6.14-mm1: drivers/pci/hotplug/: namespace clashes Adrian Bunk
2005-11-07 18:41 ` Rajesh Shah
2005-11-07 20:03 ` Adrian Bunk
2005-11-07 21:37 ` Rajesh Shah
2005-11-07 21:10 ` 2.6.14-mm1: Why is USB_LIBUSUAL user-visible? Adrian Bunk
2005-11-07 21:52 ` Greg KH
2005-11-07 22:26 ` [linux-usb-devel] " Alan Stern
2005-11-07 22:28 ` Greg KH
2005-11-08 0:47 ` Adrian Bunk [this message]
2005-11-09 22:28 ` [-mm patch] USB_LIBUSUAL shouldn't be user-visible Greg KH
2005-11-10 6:41 ` Pete Zaitcev
2005-11-10 10:56 ` Adrian Bunk
2005-11-10 23:46 ` Greg KH
2005-11-11 2:09 ` Adrian Bunk
2005-11-11 6:13 ` Greg KH
2005-11-11 9:31 ` Pete Zaitcev
2005-11-10 12:11 ` Reuben Farrelly
2005-11-11 9:14 ` Pete Zaitcev
2005-11-07 23:34 ` 2.6.14-mm1: Why is USB_LIBUSUAL user-visible? Pete Zaitcev
2005-11-07 22:28 ` 2.6.14-mm1 - cpufreq build problem Rafael J. Wysocki
2005-11-08 4:36 ` [-mm patch] __deprecated_for_modules the lookup_hash() prototype Adrian Bunk
2005-11-10 13:07 ` 2.6.14-mm1 Serge Hallyn
[not found] ` <OFE00FE25C.725B5669-ON872570B5.0066EFF0-862570B5.00679646@us.ibm.com>
2005-11-11 17:59 ` 2.6.14-mm1 Serge Hallyn
2005-11-14 17:05 ` 2.6.14-mm1 Greg KH
2005-11-12 0:31 ` 2.6.14-mm1 Michal Piotrowski
2005-11-12 0:51 ` 2.6.14-mm1 Andrew Morton
2005-11-12 1:30 ` 2.6.14-mm1 Michal Piotrowski
2005-11-12 1:47 ` 2.6.14-mm1 Andrew Morton
2005-11-12 18:00 ` 2.6.14-mm1 Michal Piotrowski
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=20051108004716.GJ3847@stusta.de \
--to=bunk@stusta.de \
--cc=akpm@osdl.org \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb-devel@lists.sourceforge.net \
--cc=mdharm-usb@one-eyed-alien.net \
--cc=stern@rowland.harvard.edu \
--cc=zaitcev@redhat.com \
/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