From patchwork Sun Feb 11 21:07:22 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: 10211547 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 BA1DB602CB for ; Sun, 11 Feb 2018 21:09:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AB10328800 for ; Sun, 11 Feb 2018 21:09:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9EA972884C; Sun, 11 Feb 2018 21:09:43 +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=ham 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 257B628800 for ; Sun, 11 Feb 2018 21:09:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932194AbeBKVHm (ORCPT ); Sun, 11 Feb 2018 16:07:42 -0500 Received: from mail-lf0-f67.google.com ([209.85.215.67]:41141 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932132AbeBKVHk (ORCPT ); Sun, 11 Feb 2018 16:07:40 -0500 Received: by mail-lf0-f67.google.com with SMTP id f136so17908700lff.8 for ; Sun, 11 Feb 2018 13:07:39 -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=FT50dtib/M3KKjoXERJ2YNvLODnEO1KJQosztPcra6CS2NgPSiuKR3DEgsVtq7b3/p 1A1U/xnwiYZcGkjL3QGYhskc6Tfhjg/P5BIL/HL/0GiY/BrfxeNNK3dL/QsbCIrWnPRk 7qXUVgCpHQpcEmmV4a0FS152gLA+Cl+iXdHYA= 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=L8+JP1SbJeZO9k683uVsS3kinTyOqgLWwvF4TGAFDgyXkSm4ih9MGM5nBDP9aoTbaf z/KAPhnoS16sAMCFNMklBynvrXQjxtFa0uy5wFrdCJ/Y1o2mkJ43qBrd5OvHldtqc7fw wO1eNNqO86Do2rSPhhw7dYsTtiJDrDqRRxVh7GA89foiuYAmSDB8V1MZ0ZlC+mAkOyem VmMBfk1+l8JH/8tlCcekKUYgpA0YgUqjq2dDS4tSnhwzGccalzJ5WC47TKFpKZpEMqtn IPYCGDydCSPrj7JKlzWrfBO/QcdtPMjVS+S+Nw+FjvnfBv/WKy6kBQl6AnBioU4o+V1t N0Pw== X-Gm-Message-State: APf1xPAbzAt14TTeRIAukDqu51w5Yy9MeeWtpTZ2zC3IVAceoK5/B7pz 9jPglG9N1vPIcyZV26CwT6p8KA== X-Google-Smtp-Source: AH8x2264s+eZxJZyeiin7tCcHyKTCKEYj+7sDFxdP+tc8kMD0qxNguMyiwX9Wqv85wiu94bJ/qwIEw== X-Received: by 10.25.223.83 with SMTP id q19mr5107351lfj.45.1518383259093; Sun, 11 Feb 2018 13:07:39 -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 y198sm1390477lfd.62.2018.02.11.13.07.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Feb 2018 13:07:38 -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 2/7] platform/x86: fujitsu-laptop: Defer input device registration Date: Sun, 11 Feb 2018 22:07:22 +0100 Message-Id: <20180211210727.12130-3-kernel@kempniu.pl> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180211210727.12130-1-kernel@kempniu.pl> References: <20180211210727.12130-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;