Received: by 10.223.185.116 with SMTP id b49csp1483506wrg; Sun, 11 Feb 2018 13:11:22 -0800 (PST) X-Google-Smtp-Source: AH8x2243tHl5o/zuPsVn8pR3GA3vrvHO4mHCtG3hH5/esQBleyuQBBVeYa9ehSAJJSIUXTJvQvyq X-Received: by 10.98.135.204 with SMTP id i195mr935987pfe.41.1518383481965; Sun, 11 Feb 2018 13:11:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518383481; cv=none; d=google.com; s=arc-20160816; b=daykD9CzsoOmpYHbP8N2411x+FZq8x4Qhco3bnQ8eZ8pbJKyTSuoMENn3kIQXgDkQE 3yhIHDcuFoZu6KYmq2wuKyOeBB94Y3pKm0yuudS9aofHvn5Q4BHPuLtK7ts2/fD5ihYs 9/LmoPSzftwxiTg2mclQmT6CQRW3avMwKEJFIaukbZMFI4CF1c6ow2V5iau4mr5bAH6X bNWLqFYCCVUFO9j0EsBmKHMwrdGFJbBuIud+xM7gbX/1tl3q2rRPTrBNel9VbAfUvjKf ycMNPpyM5DOU+0OHcBljMpaAfOSrdNyezcKYV4UXcGmMwXVFh0mZah3GSj8kOSBWIRAp Ozeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=L2lTq8+Y6UGG8g+KQF0k/gc/e0Y1NMOLdNknnB43aVY=; b=kPHzgv5MNJ/MC3O4HBX9i3W9qRnkZUlNIwLQlyIiLRg54Lu3MTZiiK6b8rhBIXLGds nyrm/Ssxul8rGP9ZU1DeUBT6CmozdyZPXyVHbjveg7O5kZQMdB5suhbEcbAZCi4hexXL BZiygCb1NB6qadtwhjbzToaVXL1S22vdwfdYzdaEVlpwcpAUpLyIo0WLzR1uCQxYEXxJ rV2X3zTZ7i2H1vZ/E+g2THRbPFxMUqjGo62cc7RfwKQIetPXRfch2kbNy6KPV3ZIivPy D/1kVBmc39n+pYLpfgFIJsVZGZiHYGMclur+Cyq+z0+paxL4DiLlfpVrtxnPiL9pDtmh Vnsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kempniu.pl header.s=google header.b=FT50dtib; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=kempniu.pl Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w8si3237101pfk.17.2018.02.11.13.11.07; Sun, 11 Feb 2018 13:11:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kempniu.pl header.s=google header.b=FT50dtib; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=kempniu.pl Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932244AbeBKVJr (ORCPT + 99 others); Sun, 11 Feb 2018 16:09:47 -0500 Received: from mail-lf0-f68.google.com ([209.85.215.68]:37453 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932133AbeBKVHk (ORCPT ); Sun, 11 Feb 2018 16:07:40 -0500 Received: by mail-lf0-f68.google.com with SMTP id f137so17923999lfe.4 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=C5qIDqsSDHXJNi3YlG75lAABPYgE+7wa9KzMPMBVlUU+A5vlKjbY2v1BM2TZMpQPMp CXrUMMXrqu4c+1DRNLd0TPio7eUz2BNVif18YtDT/fvkgRHiOSOsnXgty4jO/q6Vr1aQ SYNlw4cmN3VYcQStx491DlhCsVqvr/xd9aezRmxL5R5Guy7IuTRYbFUBWJZbOLqKDNM5 QjQClZRwtvoOQtVTOIzgQx3w9FX157zuJZ/9Q9MFaFlaLKqHXkqZHTgWd7fD/RbJnFn2 MQ3HgKRITNTDQ5NUV9DneBgCkZpK7YDHaW5LAW5t7a1Bmoc8CfNUhbducc2TJSNHp1an JFgw== X-Gm-Message-State: APf1xPB8nk3GSpMrH0jAR+PESfsXYxsHr7xQlT3GwUCDen55/Xfa04k1 McWVnSo6wkIjznTOp5ehth9WJg== 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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; -- 2.16.1