Re: [PATCH 10/28] SERIO: add the sysfs driver name to all modules

2007-02-08 Thread Greg KH
On Thu, Feb 08, 2007 at 12:20:05PM -0500, Dmitry Torokhov wrote:
> Hi Greg,
> 
> On 2/7/07, Greg KH <[EMAIL PROTECTED]> wrote:
> >From: Greg Kroah-Hartman <[EMAIL PROTECTED]>
> >
> >This adds the module name to all SERIO drivers, if they are built into
> >the kernel or not.  It will show up in /sys/modules/MODULE_NAME/drivers/
> >
> 
> What is this needed for?

All modules show up today in /sys/module/ no matter if they are built
into the kernel or not.

But, if they are built as a module, the /sys/module/drivers/ link was
present.  This is not consistant, as we always want to see that link, no
matter if the driver is built in or not.  So with this change, we now
always see the links.

I also fixed the PCI and USB drivers to do this as well.

Hope this helps explain it.

thanks,

greg k-h
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 10/28] SERIO: add the sysfs driver name to all modules

2007-02-08 Thread Dmitry Torokhov

Hi Greg,

On 2/7/07, Greg KH <[EMAIL PROTECTED]> wrote:

From: Greg Kroah-Hartman <[EMAIL PROTECTED]>

This adds the module name to all SERIO drivers, if they are built into
the kernel or not.  It will show up in /sys/modules/MODULE_NAME/drivers/



What is this needed for?

--
Dmitry
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 10/28] SERIO: add the sysfs driver name to all modules

2007-02-08 Thread Dmitry Torokhov

Hi Greg,

On 2/7/07, Greg KH [EMAIL PROTECTED] wrote:

From: Greg Kroah-Hartman [EMAIL PROTECTED]

This adds the module name to all SERIO drivers, if they are built into
the kernel or not.  It will show up in /sys/modules/MODULE_NAME/drivers/



What is this needed for?

--
Dmitry
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 10/28] SERIO: add the sysfs driver name to all modules

2007-02-08 Thread Greg KH
On Thu, Feb 08, 2007 at 12:20:05PM -0500, Dmitry Torokhov wrote:
 Hi Greg,
 
 On 2/7/07, Greg KH [EMAIL PROTECTED] wrote:
 From: Greg Kroah-Hartman [EMAIL PROTECTED]
 
 This adds the module name to all SERIO drivers, if they are built into
 the kernel or not.  It will show up in /sys/modules/MODULE_NAME/drivers/
 
 
 What is this needed for?

All modules show up today in /sys/module/ no matter if they are built
into the kernel or not.

But, if they are built as a module, the /sys/module/drivers/ link was
present.  This is not consistant, as we always want to see that link, no
matter if the driver is built in or not.  So with this change, we now
always see the links.

I also fixed the PCI and USB drivers to do this as well.

Hope this helps explain it.

thanks,

greg k-h
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 10/28] SERIO: add the sysfs driver name to all modules

2007-02-07 Thread Greg KH
From: Greg Kroah-Hartman <[EMAIL PROTECTED]>

This adds the module name to all SERIO drivers, if they are built into
the kernel or not.  It will show up in /sys/modules/MODULE_NAME/drivers/

Cc: Kay Sievers <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/input/serio/serio.c |6 --
 include/linux/serio.h   |5 +
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c
index f0ce822..17c8c63 100644
--- a/drivers/input/serio/serio.c
+++ b/drivers/input/serio/serio.c
@@ -45,7 +45,7 @@ EXPORT_SYMBOL(serio_interrupt);
 EXPORT_SYMBOL(__serio_register_port);
 EXPORT_SYMBOL(serio_unregister_port);
 EXPORT_SYMBOL(serio_unregister_child_port);
-EXPORT_SYMBOL(serio_register_driver);
+EXPORT_SYMBOL(__serio_register_driver);
 EXPORT_SYMBOL(serio_unregister_driver);
 EXPORT_SYMBOL(serio_open);
 EXPORT_SYMBOL(serio_close);
@@ -789,12 +789,14 @@ static void serio_attach_driver(struct serio_driver *drv)
drv->driver.name, error);
 }
 
-int serio_register_driver(struct serio_driver *drv)
+int __serio_register_driver(struct serio_driver *drv, struct module *owner, 
const char *mod_name)
 {
int manual_bind = drv->manual_bind;
int error;
 
drv->driver.bus = _bus;
+   drv->driver.owner = owner;
+   drv->driver.mod_name = mod_name;
 
/*
 * Temporarily disable automatic binding because probing
diff --git a/include/linux/serio.h b/include/linux/serio.h
index 0f478a8..ac2c70e 100644
--- a/include/linux/serio.h
+++ b/include/linux/serio.h
@@ -86,6 +86,11 @@ static inline void serio_register_port(struct serio *serio)
 void serio_unregister_port(struct serio *serio);
 void serio_unregister_child_port(struct serio *serio);
 
+int __serio_register_driver(struct serio_driver *drv, struct module *owner, 
const char *mod_name);
+static inline int serio_register_driver(struct serio_driver *drv)
+{
+   return __serio_register_driver(drv, THIS_MODULE, KBUILD_MODNAME);
+}
 int serio_register_driver(struct serio_driver *drv);
 void serio_unregister_driver(struct serio_driver *drv);
 
-- 
1.4.4.4

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 10/28] SERIO: add the sysfs driver name to all modules

2007-02-07 Thread Greg KH
From: Greg Kroah-Hartman [EMAIL PROTECTED]

This adds the module name to all SERIO drivers, if they are built into
the kernel or not.  It will show up in /sys/modules/MODULE_NAME/drivers/

Cc: Kay Sievers [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]
---
 drivers/input/serio/serio.c |6 --
 include/linux/serio.h   |5 +
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c
index f0ce822..17c8c63 100644
--- a/drivers/input/serio/serio.c
+++ b/drivers/input/serio/serio.c
@@ -45,7 +45,7 @@ EXPORT_SYMBOL(serio_interrupt);
 EXPORT_SYMBOL(__serio_register_port);
 EXPORT_SYMBOL(serio_unregister_port);
 EXPORT_SYMBOL(serio_unregister_child_port);
-EXPORT_SYMBOL(serio_register_driver);
+EXPORT_SYMBOL(__serio_register_driver);
 EXPORT_SYMBOL(serio_unregister_driver);
 EXPORT_SYMBOL(serio_open);
 EXPORT_SYMBOL(serio_close);
@@ -789,12 +789,14 @@ static void serio_attach_driver(struct serio_driver *drv)
drv-driver.name, error);
 }
 
-int serio_register_driver(struct serio_driver *drv)
+int __serio_register_driver(struct serio_driver *drv, struct module *owner, 
const char *mod_name)
 {
int manual_bind = drv-manual_bind;
int error;
 
drv-driver.bus = serio_bus;
+   drv-driver.owner = owner;
+   drv-driver.mod_name = mod_name;
 
/*
 * Temporarily disable automatic binding because probing
diff --git a/include/linux/serio.h b/include/linux/serio.h
index 0f478a8..ac2c70e 100644
--- a/include/linux/serio.h
+++ b/include/linux/serio.h
@@ -86,6 +86,11 @@ static inline void serio_register_port(struct serio *serio)
 void serio_unregister_port(struct serio *serio);
 void serio_unregister_child_port(struct serio *serio);
 
+int __serio_register_driver(struct serio_driver *drv, struct module *owner, 
const char *mod_name);
+static inline int serio_register_driver(struct serio_driver *drv)
+{
+   return __serio_register_driver(drv, THIS_MODULE, KBUILD_MODNAME);
+}
 int serio_register_driver(struct serio_driver *drv);
 void serio_unregister_driver(struct serio_driver *drv);
 
-- 
1.4.4.4

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/