diff mbox

drivers: misc: Remove MISC_DEVICES config option

Message ID 1325796541-11402-1-git-send-email-festevam@gmail.com
State Not Applicable, archived
Delegated to: David Miller
Headers show

Commit Message

Fabio Estevam Jan. 5, 2012, 8:49 p.m. UTC
MISC_DEVICES option alone does not select any kernel code and can cause dependency build warnings, such as:

warning: (KS8851 && AX88796_93CX6 && RTL8180 && RTL8187 && ADM8211 && RT2400PCI && RT2500PCI && RT61PCI && RT2800PCI && R8187SE) selects EEPROM_93CX6 which has unmet direct dependencies (MISC_DEVICES)

Remove MISC_DEVICES option so that any dependency on this symbol is avoided.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
This applies against linux-next

 drivers/misc/Kconfig                |   17 +++--------------
 drivers/mmc/host/Kconfig            |    1 -
 drivers/net/ethernet/micrel/Kconfig |    1 -
 3 files changed, 3 insertions(+), 16 deletions(-)

Comments

Greg KH Jan. 5, 2012, 10:39 p.m. UTC | #1
On Thu, Jan 05, 2012 at 06:49:01PM -0200, Fabio Estevam wrote:
> MISC_DEVICES option alone does not select any kernel code and can cause dependency build warnings, such as:
> 
> warning: (KS8851 && AX88796_93CX6 && RTL8180 && RTL8187 && ADM8211 && RT2400PCI && RT2500PCI && RT61PCI && RT2800PCI && R8187SE) selects EEPROM_93CX6 which has unmet direct dependencies (MISC_DEVICES)
> 
> Remove MISC_DEVICES option so that any dependency on this symbol is avoided.

Are you sure that this isn't getting confused with the
drivers/char/misc.c interface instead of the "throw a bunch of randome
drivers into drivers/misc/" issue?

Why would anything ever want to select MISC_DEVICES?  What happens if
you just remove that select line from the Kconfig?

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Larry Finger Jan. 5, 2012, 11:42 p.m. UTC | #2
On 01/05/2012 05:45 PM, Randy Dunlap wrote:
> On 01/05/2012 12:49 PM, Fabio Estevam wrote:
>> MISC_DEVICES option alone does not select any kernel code and can cause dependency build warnings, such as:
>>
>> warning: (KS8851&&  AX88796_93CX6&&  RTL8180&&  RTL8187&&  ADM8211&&  RT2400PCI&&  RT2500PCI&&  RT61PCI&&  RT2800PCI&&  R8187SE) selects EEPROM_93CX6 which has unmet direct dependencies (MISC_DEVICES)
>>
>> Remove MISC_DEVICES option so that any dependency on this symbol is avoided.
>
> I thought that one purpose of MISC_DEVICES was to allow anyone to disable all
> options under it with one click (or keystroke), but since several drivers now
> "select MISC_DEVICES", that does not work.
>
> I would like to be able to disable all MISC_DEVICES, but since that
> does not currently function, this change is OK with me.

All of the drivers in the above list select *only* one driver in the 
MISC_DEVICES category. If that one were moved outside of MISC_DEVICES, most, if 
not all,problems would go away.

Larry
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Randy.Dunlap Jan. 5, 2012, 11:45 p.m. UTC | #3
On 01/05/2012 12:49 PM, Fabio Estevam wrote:
> MISC_DEVICES option alone does not select any kernel code and can cause dependency build warnings, such as:
> 
> warning: (KS8851 && AX88796_93CX6 && RTL8180 && RTL8187 && ADM8211 && RT2400PCI && RT2500PCI && RT61PCI && RT2800PCI && R8187SE) selects EEPROM_93CX6 which has unmet direct dependencies (MISC_DEVICES)
> 
> Remove MISC_DEVICES option so that any dependency on this symbol is avoided.

I thought that one purpose of MISC_DEVICES was to allow anyone to disable all
options under it with one click (or keystroke), but since several drivers now
"select MISC_DEVICES", that does not work.

I would like to be able to disable all MISC_DEVICES, but since that
does not currently function, this change is OK with me.


> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
> This applies against linux-next
> 
>  drivers/misc/Kconfig                |   17 +++--------------
>  drivers/mmc/host/Kconfig            |    1 -
>  drivers/net/ethernet/micrel/Kconfig |    1 -
>  3 files changed, 3 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
> index 6a1a092..c779509 100644
> --- a/drivers/misc/Kconfig
> +++ b/drivers/misc/Kconfig
> @@ -2,24 +2,14 @@
>  # Misc strange devices
>  #
>  
> -# This one has to live outside of the MISC_DEVICES conditional,
> -# because it may be selected by drivers/platform/x86/hp_accel.
> +menu "Misc devices"
> +
>  config SENSORS_LIS3LV02D
>  	tristate
>  	depends on INPUT
>  	select INPUT_POLLDEV
>  	default n
>  
> -menuconfig MISC_DEVICES
> -	bool "Misc devices"
> -	---help---
> -	  Say Y here to get to see options for device drivers from various
> -	  different categories. This option alone does not add any kernel code.
> -
> -	  If you say N, all options in this submenu will be skipped and disabled.
> -
> -if MISC_DEVICES
> -
>  config AD525X_DPOT
>  	tristate "Analog Devices Digital Potentiometers"
>  	depends on (I2C || SPI) && SYSFS
> @@ -516,5 +506,4 @@ source "drivers/misc/ti-st/Kconfig"
>  source "drivers/misc/lis3lv02d/Kconfig"
>  source "drivers/misc/carma/Kconfig"
>  source "drivers/misc/altera-stapl/Kconfig"
> -
> -endif # MISC_DEVICES
> +endmenu
> diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig
> index cf444b0..00fcbed 100644
> --- a/drivers/mmc/host/Kconfig
> +++ b/drivers/mmc/host/Kconfig
> @@ -477,7 +477,6 @@ config MMC_SDHI
>  config MMC_CB710
>  	tristate "ENE CB710 MMC/SD Interface support"
>  	depends on PCI
> -	select MISC_DEVICES
>  	select CB710_CORE
>  	help
>  	  This option enables support for MMC/SD part of ENE CB710/720 Flash
> diff --git a/drivers/net/ethernet/micrel/Kconfig b/drivers/net/ethernet/micrel/Kconfig
> index 1ea811c..fe42fc0 100644
> --- a/drivers/net/ethernet/micrel/Kconfig
> +++ b/drivers/net/ethernet/micrel/Kconfig
> @@ -42,7 +42,6 @@ config KS8851
>  	select NET_CORE
>  	select MII
>  	select CRC32
> -	select MISC_DEVICES
>  	select EEPROM_93CX6
>  	---help---
>  	  SPI driver for Micrel KS8851 SPI attached network chip.
Fabio Estevam Jan. 6, 2012, 1:18 a.m. UTC | #4
On Thu, Jan 5, 2012 at 8:39 PM, Greg KH <greg@kroah.com> wrote:

> Are you sure that this isn't getting confused with the
> drivers/char/misc.c interface instead of the "throw a bunch of randome
> drivers into drivers/misc/" issue?

Sorry, I am not aware of this issue.

> Why would anything ever want to select MISC_DEVICES?  What happens if
> you just remove that select line from the Kconfig?

Yes, I don´t understand the point of allowing the selection MISC_DEVICES.

IMHO it is potential for causing dependency issues.

Thanks,

Fabio Estevam
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Greg KH Jan. 6, 2012, 5:03 a.m. UTC | #5
On Thu, Jan 05, 2012 at 11:18:28PM -0200, Fabio Estevam wrote:
> On Thu, Jan 5, 2012 at 8:39 PM, Greg KH <greg@kroah.com> wrote:
> 
> > Are you sure that this isn't getting confused with the
> > drivers/char/misc.c interface instead of the "throw a bunch of randome
> > drivers into drivers/misc/" issue?
> 
> Sorry, I am not aware of this issue.
> 
> > Why would anything ever want to select MISC_DEVICES?  What happens if
> > you just remove that select line from the Kconfig?
> 
> Yes, I don´t understand the point of allowing the selection MISC_DEVICES.
> 
> IMHO it is potential for causing dependency issues.

Then remove that selection.  Nothing should be depending on a misc
driver, if it is, then that implies that this is more than just a "misc"
driver, and it should be moved elsewhere.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Arnd Bergmann Jan. 6, 2012, noon UTC | #6
On Friday 06 January 2012, Greg KH wrote:
> On Thu, Jan 05, 2012 at 11:18:28PM -0200, Fabio Estevam wrote:
> > On Thu, Jan 5, 2012 at 8:39 PM, Greg KH <greg@kroah.com> wrote:
> > 
> > > Are you sure that this isn't getting confused with the
> > > drivers/char/misc.c interface instead of the "throw a bunch of randome
> > > drivers into drivers/misc/" issue?
> > 
> > Sorry, I am not aware of this issue.
> > 
> > > Why would anything ever want to select MISC_DEVICES?  What happens if
> > > you just remove that select line from the Kconfig?
> > 
> > Yes, I don´t understand the point of allowing the selection MISC_DEVICES.
> > 
> > IMHO it is potential for causing dependency issues.
> 
> Then remove that selection.  Nothing should be depending on a misc
> driver, if it is, then that implies that this is more than just a "misc"
> driver, and it should be moved elsewhere.

I think that is true for the majority of stuff we have under drivers/misc
anyway. I had done the same patch that Fabio sent a couple of months ago
but then forgot about it, so here is a wholehearted

Acked-by: Arnd Bergmann <arnd@arndb.de>

for the new patch. It fixes a real problem, and we applied a similar patch
in drivers/mfd as 8a0a8e8e already. We probably still want to find a better
home for drivers that frequently get selected by other subsystems as you
said, but that is an independent issue. I don't see why anyone would
need a way to disable all MISC drivers at once, when the only thing that
(in theory) connects them is that they are all different from everything
else.

	Arnd
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Fabio Estevam Jan. 24, 2012, 2:57 a.m. UTC | #7
Hi Greg,

On Fri, Jan 6, 2012 at 10:00 AM, Arnd Bergmann <arnd@arndb.de> wrote:

> I think that is true for the majority of stuff we have under drivers/misc
> anyway. I had done the same patch that Fabio sent a couple of months ago
> but then forgot about it, so here is a wholehearted
>
> Acked-by: Arnd Bergmann <arnd@arndb.de>
>
> for the new patch. It fixes a real problem, and we applied a similar patch
> in drivers/mfd as 8a0a8e8e already. We probably still want to find a better
> home for drivers that frequently get selected by other subsystems as you
> said, but that is an independent issue. I don't see why anyone would
> need a way to disable all MISC drivers at once, when the only thing that
> (in theory) connects them is that they are all different from everything
> else.

Do you have any objections about this patch?

Thanks,

Fabio Estevam
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Greg KH Jan. 24, 2012, 3:03 a.m. UTC | #8
On Tue, Jan 24, 2012 at 12:57:36AM -0200, Fabio Estevam wrote:
> Hi Greg,
> 
> On Fri, Jan 6, 2012 at 10:00 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> 
> > I think that is true for the majority of stuff we have under drivers/misc
> > anyway. I had done the same patch that Fabio sent a couple of months ago
> > but then forgot about it, so here is a wholehearted
> >
> > Acked-by: Arnd Bergmann <arnd@arndb.de>
> >
> > for the new patch. It fixes a real problem, and we applied a similar patch
> > in drivers/mfd as 8a0a8e8e already. We probably still want to find a better
> > home for drivers that frequently get selected by other subsystems as you
> > said, but that is an independent issue. I don't see why anyone would
> > need a way to disable all MISC drivers at once, when the only thing that
> > (in theory) connects them is that they are all different from everything
> > else.
> 
> Do you have any objections about this patch?

Yes, I said my problems with it, I don't recall it being resent
afterward, with any changes.

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Fabio Estevam Jan. 24, 2012, 3:17 a.m. UTC | #9
On Fri, Jan 6, 2012 at 3:03 AM, Greg KH <greg@kroah.com> wrote:

> Then remove that selection.  Nothing should be depending on a misc
> driver,

Yes, this is the exact issue that this patch tries to solve.

Currently all of these are dependent on MISC_DEVICES being set.

source "drivers/misc/c2port/Kconfig"
source "drivers/misc/eeprom/Kconfig"
source "drivers/misc/cb710/Kconfig"
source "drivers/misc/iwmc3200top/Kconfig"
source "drivers/misc/ti-st/Kconfig"
source "drivers/misc/lis3lv02d/Kconfig"
source "drivers/misc/carma/Kconfig"
source "drivers/misc/altera-stapl/Kconfig"

With the patch applied it is possible to select all the drivers above
and we don't need to select MISC_DEVICES.

Regards,

Fabio Estevam
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Greg KH Jan. 24, 2012, 3:48 a.m. UTC | #10
On Tue, Jan 24, 2012 at 01:17:44AM -0200, Fabio Estevam wrote:
> On Fri, Jan 6, 2012 at 3:03 AM, Greg KH <greg@kroah.com> wrote:
> 
> > Then remove that selection.  Nothing should be depending on a misc
> > driver,
> 
> Yes, this is the exact issue that this patch tries to solve.

You are seriously going to have to refresh my memory, the patch is many
weeks old, and long gone from my recall.

> Currently all of these are dependent on MISC_DEVICES being set.
> 
> source "drivers/misc/c2port/Kconfig"
> source "drivers/misc/eeprom/Kconfig"
> source "drivers/misc/cb710/Kconfig"
> source "drivers/misc/iwmc3200top/Kconfig"
> source "drivers/misc/ti-st/Kconfig"
> source "drivers/misc/lis3lv02d/Kconfig"
> source "drivers/misc/carma/Kconfig"
> source "drivers/misc/altera-stapl/Kconfig"
> 
> With the patch applied it is possible to select all the drivers above
> and we don't need to select MISC_DEVICES.

Care to add this to the patch description and resend it as I really
don't remember what is going on here.

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Arnd Bergmann Jan. 24, 2012, 12:25 p.m. UTC | #11
On Tuesday 24 January 2012, Greg KH wrote:
> On Tue, Jan 24, 2012 at 01:17:44AM -0200, Fabio Estevam wrote:
> > On Fri, Jan 6, 2012 at 3:03 AM, Greg KH <greg@kroah.com> wrote:
> > 
> > > Then remove that selection.  Nothing should be depending on a misc
> > > driver,
> > 
> > Yes, this is the exact issue that this patch tries to solve.
> 
> You are seriously going to have to refresh my memory, the patch is many
> weeks old, and long gone from my recall.

It's a version of the patch that led to you and me getting listed as
maintainers. I sent the original version, see the discussion at
http://patchwork.linuxtv.org/patch/316/ with my explanation.

I now saw that my version actually looks better because it removes
a few extra 'select MISC_DEVICES' statements as well. I already
acked Fabio's patch, but maybe it's better to take my patch and
mention Fabio as well in the changelog.

> > Currently all of these are dependent on MISC_DEVICES being set.
> > 
> > source "drivers/misc/c2port/Kconfig"
> > source "drivers/misc/eeprom/Kconfig"
> > source "drivers/misc/cb710/Kconfig"
> > source "drivers/misc/iwmc3200top/Kconfig"
> > source "drivers/misc/ti-st/Kconfig"
> > source "drivers/misc/lis3lv02d/Kconfig"
> > source "drivers/misc/carma/Kconfig"
> > source "drivers/misc/altera-stapl/Kconfig"
> > 
> > With the patch applied it is possible to select all the drivers above
> > and we don't need to select MISC_DEVICES.
> 
> Care to add this to the patch description and resend it as I really
> don't remember what is going on here.

The problem is that we have plenty of drivers that 'select' a configuration
option from drivers/misc/Kconfig:

$ git ls-files drivers/misc/ | grep Kconfig | xargs grep ^config | while read DUMMY OPTION ; do git ls-files | grep Kconfig | grep -v drivers/misc | xargs grep "\<select\>.*\<$OPTION\>" ; done
drivers/platform/x86/Kconfig:   select SENSORS_LIS3LV02D
drivers/memstick/host/Kconfig:  select TIFM_CORE
drivers/mmc/host/Kconfig:       select TIFM_CORE
drivers/media/video/cx23885/Kconfig:    select ALTERA_STAPL
drivers/mmc/host/Kconfig:       select CB710_CORE
arch/arm/mach-davinci/Kconfig:  select EEPROM_AT24
arch/arm/mach-davinci/Kconfig:  select EEPROM_AT24
arch/arm/mach-davinci/Kconfig:  select EEPROM_AT24
arch/arm/mach-davinci/Kconfig:  select EEPROM_AT24
arch/arm/mach-davinci/Kconfig:  select EEPROM_AT24
arch/arm/mach-davinci/Kconfig:  select EEPROM_AT24
arch/arm/mach-s3c2440/Kconfig:  select EEPROM_AT24
arch/unicore32/Kconfig: select EEPROM_AT24
drivers/net/ethernet/8390/Kconfig:      select EEPROM_93CX6
drivers/net/ethernet/micrel/Kconfig:    select EEPROM_93CX6
drivers/net/wireless/Kconfig:   select EEPROM_93CX6
drivers/net/wireless/rt2x00/Kconfig:    select EEPROM_93CX6
drivers/net/wireless/rt2x00/Kconfig:    select EEPROM_93CX6
drivers/net/wireless/rt2x00/Kconfig:    select EEPROM_93CX6
drivers/net/wireless/rt2x00/Kconfig:    select EEPROM_93CX6
drivers/net/wireless/rtl818x/Kconfig:   select EEPROM_93CX6
drivers/net/wireless/rtl818x/Kconfig:   select EEPROM_93CX6
drivers/staging/rtl8187se/Kconfig:      select EEPROM_93CX6
drivers/net/wimax/i2400m/Kconfig:       select IWMC3200TOP
drivers/net/wireless/iwmc3200wifi/Kconfig:      select IWMC3200TOP
drivers/media/radio/wl128x/Kconfig:     select TI_ST if NET && GPIOLIB

If MISC_DEVICES is disabled, this causes a build-time warning about missing
dependencies in a select statement. Some people have resorted to adding
'select MISC_DEVICES', but that has the unintended side-effect of unhiding
all other misc drivers when one of the dependent options is enabled.

	Arnd
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index 6a1a092..c779509 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -2,24 +2,14 @@ 
 # Misc strange devices
 #
 
-# This one has to live outside of the MISC_DEVICES conditional,
-# because it may be selected by drivers/platform/x86/hp_accel.
+menu "Misc devices"
+
 config SENSORS_LIS3LV02D
 	tristate
 	depends on INPUT
 	select INPUT_POLLDEV
 	default n
 
-menuconfig MISC_DEVICES
-	bool "Misc devices"
-	---help---
-	  Say Y here to get to see options for device drivers from various
-	  different categories. This option alone does not add any kernel code.
-
-	  If you say N, all options in this submenu will be skipped and disabled.
-
-if MISC_DEVICES
-
 config AD525X_DPOT
 	tristate "Analog Devices Digital Potentiometers"
 	depends on (I2C || SPI) && SYSFS
@@ -516,5 +506,4 @@  source "drivers/misc/ti-st/Kconfig"
 source "drivers/misc/lis3lv02d/Kconfig"
 source "drivers/misc/carma/Kconfig"
 source "drivers/misc/altera-stapl/Kconfig"
-
-endif # MISC_DEVICES
+endmenu
diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig
index cf444b0..00fcbed 100644
--- a/drivers/mmc/host/Kconfig
+++ b/drivers/mmc/host/Kconfig
@@ -477,7 +477,6 @@  config MMC_SDHI
 config MMC_CB710
 	tristate "ENE CB710 MMC/SD Interface support"
 	depends on PCI
-	select MISC_DEVICES
 	select CB710_CORE
 	help
 	  This option enables support for MMC/SD part of ENE CB710/720 Flash
diff --git a/drivers/net/ethernet/micrel/Kconfig b/drivers/net/ethernet/micrel/Kconfig
index 1ea811c..fe42fc0 100644
--- a/drivers/net/ethernet/micrel/Kconfig
+++ b/drivers/net/ethernet/micrel/Kconfig
@@ -42,7 +42,6 @@  config KS8851
 	select NET_CORE
 	select MII
 	select CRC32
-	select MISC_DEVICES
 	select EEPROM_93CX6
 	---help---
 	  SPI driver for Micrel KS8851 SPI attached network chip.