From patchwork Fri Oct 16 21:15:14 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Chiang X-Patchwork-Id: 54422 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9GLGqwv002493 for ; Fri, 16 Oct 2009 21:16:52 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754591AbZJPVPN (ORCPT ); Fri, 16 Oct 2009 17:15:13 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752117AbZJPVPN (ORCPT ); Fri, 16 Oct 2009 17:15:13 -0400 Received: from g5t0007.atlanta.hp.com ([15.192.0.44]:29125 "EHLO g5t0007.atlanta.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751586AbZJPVPK (ORCPT ); Fri, 16 Oct 2009 17:15:10 -0400 Received: from g4t0018.houston.hp.com (g4t0018.houston.hp.com [16.234.32.27]) by g5t0007.atlanta.hp.com (Postfix) with ESMTP id 12D64140FD; Fri, 16 Oct 2009 21:15:15 +0000 (UTC) Received: from ldl (linux.corp.hp.com [15.11.146.101]) by g4t0018.houston.hp.com (Postfix) with ESMTP id E38A81006C; Fri, 16 Oct 2009 21:15:14 +0000 (UTC) Received: from localhost (ldl.fc.hp.com [127.0.0.1]) by ldl (Postfix) with ESMTP id CADE8CF0018; Fri, 16 Oct 2009 15:15:14 -0600 (MDT) Received: from ldl ([127.0.0.1]) by localhost (ldl.fc.hp.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Ww+8LRby2eOr; Fri, 16 Oct 2009 15:15:14 -0600 (MDT) Received: from eh.fc.hp.com (eh.fc.hp.com [15.11.146.105]) by ldl (Postfix) with ESMTP id B6E6ACF000A; Fri, 16 Oct 2009 15:15:14 -0600 (MDT) Received: from bob.kio (localhost [127.0.0.1]) by eh.fc.hp.com (Postfix) with ESMTP id B656626172; Fri, 16 Oct 2009 15:15:14 -0600 (MDT) Subject: [PATCH v3 4/6] ACPI: dock: dock_add - hoist up platform_device_register_simple() To: lenb@kernel.org From: Alex Chiang Cc: shaohua.li@intel.com, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org Date: Fri, 16 Oct 2009 15:15:14 -0600 Message-ID: <20091016211514.12126.61664.stgit@bob.kio> In-Reply-To: <20091016211323.12126.58457.stgit@bob.kio> References: <20091016211323.12126.58457.stgit@bob.kio> User-Agent: StGit/0.14.3.386.gb02d MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c index 766eccb..939babe 100644 --- a/drivers/acpi/dock.c +++ b/drivers/acpi/dock.c @@ -948,11 +948,18 @@ static int dock_add(acpi_handle handle) struct dock_station *dock_station; struct platform_device *dock_device; + dock_device = + platform_device_register_simple("dock", + dock_station_count, NULL, 0); + if (IS_ERR(dock_device)) + return PTR_ERR(dock_device); + /* allocate & initialize the dock_station private data */ dock_station = kzalloc(sizeof(*dock_station), GFP_KERNEL); if (!dock_station) return -ENOMEM; dock_station->handle = handle; + dock_station->dock_device = dock_device; dock_station->last_dock_time = jiffies - HZ; INIT_LIST_HEAD(&dock_station->dependent_devices); INIT_LIST_HEAD(&dock_station->hotplug_devices); @@ -961,15 +968,6 @@ static int dock_add(acpi_handle handle) mutex_init(&dock_station->hp_lock); ATOMIC_INIT_NOTIFIER_HEAD(&dock_notifier_list); - /* initialize platform device stuff */ - dock_station->dock_device = - platform_device_register_simple("dock", - dock_station_count, NULL, 0); - dock_device = dock_station->dock_device; - if (IS_ERR(dock_device)) { - ret = PTR_ERR(dock_device); - goto out; - } platform_device_add_data(dock_device, &dock_station, sizeof(struct dock_station *));