public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] input: init struct serio_bus at compile time
@ 2006-10-23  1:22 Németh Márton
  2006-10-23  3:19 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: Németh Márton @ 2006-10-23  1:22 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, linux-kernel

From: Márton Németh <nm127@freemail.hu>

Initialize serio_bus structure at compile time instead of at runtime in serio_init().
This will speed up startup a little bit and also reduce code size.

Signed-off-by: Márton Németh <nm127@freemail.hu>

---
Patch against Linux kernel 2.6.19-rc2.


--- linux-2.6.19-rc2.orig/drivers/input/serio/serio.c	2006-10-13 18:25:04.000000000 +0200
+++ linux-2.6.19-rc2/drivers/input/serio/serio.c	2006-10-16 18:05:31.000000000 +0200
@@ -768,12 +768,6 @@ static int serio_driver_remove(struct de
  	return 0;
  }

-static struct bus_type serio_bus = {
-	.name =	"serio",
-	.probe = serio_driver_probe,
-	.remove = serio_driver_remove,
-};
-
  static void serio_add_driver(struct serio_driver *drv)
  {
  	int error;
@@ -930,15 +924,21 @@ irqreturn_t serio_interrupt(struct serio
  	return ret;
  }

+static struct bus_type serio_bus = {
+	.name =	"serio",
+	.dev_attrs = serio_device_attrs,
+	.drv_attrs = serio_driver_attrs,
+	.match = serio_bus_match,
+	.uevent = serio_uevent,
+	.probe = serio_driver_probe,
+	.remove = serio_driver_remove,
+	.resume = serio_resume,
+};
+
  static int __init serio_init(void)
  {
  	int error;

-	serio_bus.dev_attrs = serio_device_attrs;
-	serio_bus.drv_attrs = serio_driver_attrs;
-	serio_bus.match = serio_bus_match;
-	serio_bus.uevent = serio_uevent;
-	serio_bus.resume = serio_resume;
  	error = bus_register(&serio_bus);
  	if (error) {
  		printk(KERN_ERR "serio: failed to register serio bus, error: %d\n", error);

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-10-23  3:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-23  1:22 [PATCH] input: init struct serio_bus at compile time Németh Márton
2006-10-23  3:19 ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox