Skip to contentSkip to conversation

floppy: Provide a PNP device table in the module.

PATCH In review Scott James Remnant 3 participants 5 messages Mar 6, 2009 – Mar 7, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 floppy: Provide a PNP device table in the module.

The missing device table means that the floppy module is not auto-loaded, even when the appropriate PNP device (0700) is found.

We don't actually use the table in the module, since the device doesn't have a struct pnp_driver, but it's sufficient to cause an alias in the module that udev/modprobe will use.

---
 drivers/block/floppy.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
drivers/block/floppy.c +8 -0
index 83d8ed3..7aa1264 100644
@@ -177,6 +177,7 @@ static int print_unex = 1;
 #include <linux/interrupt.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
+#include <linux/mod_devicetable.h>
 #include <linux/buffer_head.h>	/* for invalidate_buffers() */
 #include <linux/mutex.h>
 
@@ -4598,6 +4599,13 @@ MODULE_AUTHOR("Alain L. Knaff");
 MODULE_SUPPORTED_DEVICE("fd");
 MODULE_LICENSE("GPL");
 
+/* This doesn't actually get used other than for module information */
+static const struct pnp_device_id floppy_pnpids[] = {
+	{ "PNP0700", 0 },
+	{ }
+};
+MODULE_DEVICE_TABLE(pnp, floppy_pnpids);
+
 #else
 
 __setup("floppy=", floppy_setup);
Signature · 1 line
1.6.0.5
Acked-by on v1 1/1
#1 lore raw
Quoted 26 lines · Scott James Remnant

The missing device table means that the floppy module is not auto-loaded, even when the appropriate PNP device (0700) is found.

We don't actually use the table in the module, since the device doesn't have a struct pnp_driver, but it's sufficient to cause an alias in the module that udev/modprobe will use.

---
 drivers/block/floppy.c |    8 ++++++++

 1 files changed, 8 insertions(+), 0 deletions(-)
drivers/block/floppy.c +1 -0
index 83d8ed3..7aa1264 100644
@@ -177,6 +177,7 @@ static int print_unex = 1;
  #include <linux/interrupt.h>
  #include <linux/init.h>
  #include <linux/platform_device.h>
+#include <linux/mod_devicetable.h>
  #include <linux/buffer_head.h> /* for invalidate_buffers() */
  #include <linux/mutex.h>
 

drivers/block/floppy.c MODULE_AUTHOR("Alain L. Knaff"); · line 4608

Quoted 10 lines
drivers/block/floppy.c +7 -0
@@ -4598,6 +4599,13 @@ MODULE_AUTHOR("Alain L. Knaff");
  MODULE_SUPPORTED_DEVICE("fd");
  MODULE_LICENSE("GPL");
 
+/* This doesn't actually get used other than for module information */
+static const struct pnp_device_id floppy_pnpids[] = {
+       { "PNP0700", 0 },
+       { }
+};
+MODULE_DEVICE_TABLE(pnp, floppy_pnpids);
+

Looks good to me. Thanks for doing that.

Kay

#2 lore raw
In reply to Scott James Remnant
Quoted 2 lines · On Fri, 6 Mar 2009 17:50:47 +0000 Scott James Remnant <[email protected]>…

The missing device table means that the floppy module is not auto-loaded, even when the appropriate PNP device (0700) is found.

Is this a regression? Did 2.6.28 autoload OK?

Quoted 26 lines

We don't actually use the table in the module, since the device doesn't have a struct pnp_driver, but it's sufficient to cause an alias in the module that udev/modprobe will use.

---
 drivers/block/floppy.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
drivers/block/floppy.c +1 -0
index 83d8ed3..7aa1264 100644
@@ -177,6 +177,7 @@ static int print_unex = 1;
 #include <linux/interrupt.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
+#include <linux/mod_devicetable.h>
 #include <linux/buffer_head.h>	/* for invalidate_buffers() */
 #include <linux/mutex.h>
 
@@ -4598,6 +4599,13 @@ MODULE_AUTHOR("Alain L. Knaff");
 MODULE_SUPPORTED_DEVICE("fd");
 MODULE_LICENSE("GPL");
 

drivers/block/floppy.c MODULE_AUTHOR("Alain L. Knaff"); · line 4611

Quoted 10 lines
drivers/block/floppy.c +7 -0
+/* This doesn't actually get used other than for module information */
+static const struct pnp_device_id floppy_pnpids[] = {
+	{ "PNP0700", 0 },
+	{ }
+};
+MODULE_DEVICE_TABLE(pnp, floppy_pnpids);
+
 #else
 
 __setup("floppy=", floppy_setup);

Either way, this looks like 2.6.29 stuff.

#3 lore raw
Quoted 7 lines · Andrew Morton
Quoted 2 lines · On Fri, 6 Mar 2009 17:50:47 +0000 Scott James Remnant <[email protected]>…

The missing device table means that the floppy module is not auto-loaded, even when the appropriate PNP device (0700) is found.

Is this a regression?  Did 2.6.28 autoload OK?

No, it was never autoloaded by a kernel supplied alias. We ship special modprobe rules which define the alias, and this is part of an ongoing effort to move that information where it belongs, into the module itself.

Thanks,
Kay

#4 lore raw
Quoted 7 lines · On Sat, 7 Mar 2009 00:52:50 +0100 Kay Sievers <[email protected]> wrote:
Quoted 6 lines · Andrew Morton
Quoted 2 lines · On Fri, 6 Mar 2009 17:50:47 +0000 Scott James Remnant <[email protected]>…

The missing device table means that the floppy module is not auto-loaded, even when the appropriate PNP device (0700) is found.

Quoted 7 lines
Quoted 1 line

Is this a regression? __Did 2.6.28 autoload OK?

No, it was never autoloaded by a kernel supplied alias. We ship special modprobe rules which define the alias, and this is part of an ongoing effort to move that information where it belongs, into the module itself.

OK, thanks, I tossed it onto the 2.6.30 pile.