public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Németh Márton" <nm127@freemail.hu>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@atrey.karlin.mff.cuni.cz, linux-kernel@vger.kernel.org
Subject: [PATCH] input: init struct serio_bus at compile time
Date: Mon, 23 Oct 2006 03:22:14 +0200	[thread overview]
Message-ID: <453C1946.1080803@freemail.hu> (raw)

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);

             reply	other threads:[~2006-10-23  1:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-23  1:22 Németh Márton [this message]
2006-10-23  3:19 ` [PATCH] input: init struct serio_bus at compile time Dmitry Torokhov

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=453C1946.1080803@freemail.hu \
    --to=nm127@freemail.hu \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@atrey.karlin.mff.cuni.cz \
    --cc=linux-kernel@vger.kernel.org \
    /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