From patchwork Tue Feb 20 05:24:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TWljaGHFgiBLxJlwaWXFhA==?= X-Patchwork-Id: 10229417 X-Patchwork-Delegate: dvhart@infradead.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 31E5C602DC for ; Tue, 20 Feb 2018 05:26:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 23BB826E97 for ; Tue, 20 Feb 2018 05:26:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 184B3283A5; Tue, 20 Feb 2018 05:26:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C1F2C26E97 for ; Tue, 20 Feb 2018 05:26:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751104AbeBTFZH (ORCPT ); Tue, 20 Feb 2018 00:25:07 -0500 Received: from mail-lf0-f66.google.com ([209.85.215.66]:38783 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750799AbeBTFZE (ORCPT ); Tue, 20 Feb 2018 00:25:04 -0500 Received: by mail-lf0-f66.google.com with SMTP id g72so2447778lfg.5 for ; Mon, 19 Feb 2018 21:25:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kempniu.pl; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=L2lTq8+Y6UGG8g+KQF0k/gc/e0Y1NMOLdNknnB43aVY=; b=l1AH+SBUoHln9xE+Ct6KNF2YwQlQNGtPqPQE8wjuGeGWzEPDAFU5lkWbtRcMj+Pgx2 2I+8vAbWZNlhV0mOCpEzXiPWp805oid+2l+cY+YDSynVATr8bQOBQWuwx9C31clmEewI kYpB9+0BjF+oRyvQTdm1bUwNt02r+zSnGFL1k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=L2lTq8+Y6UGG8g+KQF0k/gc/e0Y1NMOLdNknnB43aVY=; b=koybUPXR+XpcFs5GQkH3GGPCdG2v4tiNmhbzF+QTrX0s3VJkn7vOqyQKBvTnSe8nPS 1bjQos8q6IX5GWC1D4iKDFAYMerifzMQQNg2FhEQ+A+jQv0A6vuCnkmEILLTZjyu/D6P kA9/EK8WgOhtnF6FS40ZJz7x4tW25s31YxsQ1YJNA8kOTKPzfyHChogn1lL89QvfTeka FXqF6WkMq9oLktBBuISzNAv6t71zH9Gg+wcucJGKLwI8qbiK8ebgti/f3wXuPWriYWof p4ZXaSwprFVGb5lllhEUJiuCUu06bPg+1XqIKB7l18wjTAz2a9wOyNMrRgNc9FeeiR/t xOdw== X-Gm-Message-State: APf1xPD7tQiVTnmeHszSa+QH+J9kKa7bYydZNWWoTlMYNJGRwiH6BTxw LiQR2bLaaqcpCCwxL9yuJz3Piw== X-Google-Smtp-Source: AH8x2272hbU6xyobmXn3wDBt23V8pqzJw9z/AqdLiELAMa0DVljUWP7QiYGZ5VrQveRPaE44xX3CyQ== X-Received: by 10.25.25.9 with SMTP id 9mr4275512lfz.3.1519104303049; Mon, 19 Feb 2018 21:25:03 -0800 (PST) Received: from kmp-mobile.hq.kempniu.pl (kmp-mobile.hq.kempniu.pl. [2001:470:64df:111::1b01]) by smtp.googlemail.com with ESMTPSA id b27sm3978286ljb.84.2018.02.19.21.25.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Feb 2018 21:25:02 -0800 (PST) From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= To: Jonathan Woithe , Darren Hart , Andy Shevchenko Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/7] platform/x86: fujitsu-laptop: Defer input device registration Date: Tue, 20 Feb 2018 06:24:49 +0100 Message-Id: <20180220052454.11134-3-kernel@kempniu.pl> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180220052454.11134-1-kernel@kempniu.pl> References: <20180220052454.11134-1-kernel@kempniu.pl> MIME-Version: 1.0 Sender: platform-driver-x86-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Only register input devices after the device-specific data structures they access are fully initialized. Signed-off-by: Michał Kępień --- drivers/platform/x86/fujitsu-laptop.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c index b5f782807bfa..7f30a427a16c 100644 --- a/drivers/platform/x86/fujitsu-laptop.c +++ b/drivers/platform/x86/fujitsu-laptop.c @@ -399,10 +399,6 @@ static int acpi_fujitsu_bl_add(struct acpi_device *device) strcpy(acpi_device_class(device), ACPI_FUJITSU_CLASS); device->driver_data = priv; - ret = acpi_fujitsu_bl_input_setup(device); - if (ret) - return ret; - pr_info("ACPI: %s [%s]\n", acpi_device_name(device), acpi_device_bid(device)); @@ -410,6 +406,10 @@ static int acpi_fujitsu_bl_add(struct acpi_device *device) priv->max_brightness = FUJITSU_LCD_N_LEVELS; get_lcd_level(device); + ret = acpi_fujitsu_bl_input_setup(device); + if (ret) + return ret; + ret = fujitsu_backlight_register(device); if (ret) return ret; @@ -795,10 +795,6 @@ static int acpi_fujitsu_laptop_add(struct acpi_device *device) goto err_stop; } - ret = acpi_fujitsu_laptop_input_setup(device); - if (ret) - goto err_free_fifo; - pr_info("ACPI: %s [%s]\n", acpi_device_name(device), acpi_device_bid(device)); @@ -833,6 +829,10 @@ static int acpi_fujitsu_laptop_add(struct acpi_device *device) fujitsu_bl->bl_device->props.power = FB_BLANK_UNBLANK; } + ret = acpi_fujitsu_laptop_input_setup(device); + if (ret) + goto err_free_fifo; + ret = acpi_fujitsu_laptop_leds_register(device); if (ret) goto err_free_fifo;