From patchwork Tue Jun 16 19:28:51 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin Chary X-Patchwork-Id: 30668 X-Patchwork-Delegate: lenb@kernel.org 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 n5GJVQiQ004683 for ; Tue, 16 Jun 2009 19:31:37 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753623AbZFPTbc (ORCPT ); Tue, 16 Jun 2009 15:31:32 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755422AbZFPTbc (ORCPT ); Tue, 16 Jun 2009 15:31:32 -0400 Received: from iksaif.net ([88.191.73.63]:60977 "EHLO iksaif.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753623AbZFPTb0 (ORCPT ); Tue, 16 Jun 2009 15:31:26 -0400 Received: from localhost.localdomain (cxr69-11-88-180-139-205.fbx.proxad.net [88.180.139.205]) (Authenticated sender: corentincj@iksaif.net) by iksaif.net (Postfix) with ESMTPA id A4670C90036; Tue, 16 Jun 2009 21:33:55 +0200 (CEST) From: Corentin Chary To: lenb@kernel.org Cc: linux-acpi@vger.kernel.org, Corentin Chary Subject: [PATCH 10/15] eeepc-laptop: right parent device Date: Tue, 16 Jun 2009 21:28:51 +0200 Message-Id: <1245180536-28009-11-git-send-email-corentincj@iksaif.net> X-Mailer: git-send-email 1.6.3.1 In-Reply-To: <1245180536-28009-10-git-send-email-corentincj@iksaif.net> References: <1245180536-28009-1-git-send-email-corentincj@iksaif.net> <1245180536-28009-2-git-send-email-corentincj@iksaif.net> <1245180536-28009-3-git-send-email-corentincj@iksaif.net> <1245180536-28009-4-git-send-email-corentincj@iksaif.net> <1245180536-28009-5-git-send-email-corentincj@iksaif.net> <1245180536-28009-6-git-send-email-corentincj@iksaif.net> <1245180536-28009-7-git-send-email-corentincj@iksaif.net> <1245180536-28009-8-git-send-email-corentincj@iksaif.net> <1245180536-28009-9-git-send-email-corentincj@iksaif.net> <1245180536-28009-10-git-send-email-corentincj@iksaif.net> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Signed-off-by: Corentin Chary --- drivers/platform/x86/eeepc-laptop.c | 34 ++++++++++++++++++---------------- 1 files changed, 18 insertions(+), 16 deletions(-) diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c index 7b7c750..7121239 100644 --- a/drivers/platform/x86/eeepc-laptop.c +++ b/drivers/platform/x86/eeepc-laptop.c @@ -1061,18 +1061,6 @@ static int __init eeepc_laptop_init(void) acpi_bus_unregister_driver(&eeepc_hotk_driver); return -ENODEV; } - dev = acpi_get_physical_device(ehotk->device->handle); - - if (!acpi_video_backlight_support()) { - result = eeepc_backlight_init(dev); - if (result) - goto fail_backlight; - } else - pr_info("Backlight controlled by ACPI video driver\n"); - - result = eeepc_hwmon_init(dev); - if (result) - goto fail_hwmon; eeepc_enable_camera(); @@ -1093,12 +1081,30 @@ static int __init eeepc_laptop_init(void) if (result) goto fail_sysfs; + dev = &platform_device->dev; + + if (!acpi_video_backlight_support()) { + result = eeepc_backlight_init(dev); + if (result) + goto fail_backlight; + } else + pr_info("Backlight controlled by ACPI video " + "driver\n"); + + result = eeepc_hwmon_init(dev); + if (result) + goto fail_hwmon; + result = eeepc_rfkill_init(dev); if (result) goto fail_rfkill; return 0; fail_rfkill: + eeepc_hwmon_exit(); +fail_hwmon: + eeepc_backlight_exit(); +fail_backlight: sysfs_remove_group(&platform_device->dev.kobj, &platform_attribute_group); fail_sysfs: @@ -1108,10 +1114,6 @@ fail_platform_device2: fail_platform_device1: platform_driver_unregister(&platform_driver); fail_platform_driver: - eeepc_hwmon_exit(); -fail_hwmon: - eeepc_backlight_exit(); -fail_backlight: eeepc_input_exit(); return result; }