public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alex Chiang <achiang@hp.com>
To: lenb@kernel.org
Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 1/2] ACPI: acpi_device_register() should call device_register()
Date: Thu, 14 May 2009 08:31:32 -0600	[thread overview]
Message-ID: <20090514143132.18569.36441.stgit@bob.kio> (raw)
In-Reply-To: <20090514142941.18569.75813.stgit@bob.kio>

There is no apparent reason for acpi_device_register() to manually
register a new device in two steps (initialize then add).

Just call device_register() directly.

Signed-off-by: Alex Chiang <achiang@hp.com>
---

 drivers/acpi/scan.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 8ff510b..b8f5c00 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -530,11 +530,10 @@ static int acpi_device_register(struct acpi_device *device,
 	if (device->parent)
 		device->dev.parent = &parent->dev;
 	device->dev.bus = &acpi_bus_type;
-	device_initialize(&device->dev);
 	device->dev.release = &acpi_device_release;
-	result = device_add(&device->dev);
+	result = device_register(&device->dev);
 	if(result) {
-		dev_err(&device->dev, "Error adding device\n");
+		dev_err(&device->dev, "Error registering device\n");
 		goto end;
 	}
 


  reply	other threads:[~2009-05-14 20:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-14 14:31 [PATCH 0/2] cleanups in drivers/acpi/scan.c Alex Chiang
2009-05-14 14:31 ` Alex Chiang [this message]
2009-06-18  2:57   ` [PATCH 1/2] ACPI: acpi_device_register() should call device_register() Len Brown
2009-05-14 14:31 ` [PATCH 2/2] ACPI: clean up whitespace in drivers/acpi/scan.c Alex Chiang
2009-06-18  2:59   ` Len Brown

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=20090514143132.18569.36441.stgit@bob.kio \
    --to=achiang@hp.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --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