From patchwork Mon Dec 18 19:24:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Armin Wolf X-Patchwork-Id: 180631 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp1479339dyi; Mon, 18 Dec 2023 11:26:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IH32Ha/qupLBOVTVpt1naAABgMwGZgLLDT/KcJia3p/qeTruY5TEHwaKIlKNAB1+9nOmVaF X-Received: by 2002:a05:6512:220e:b0:50b:efdd:88dd with SMTP id h14-20020a056512220e00b0050befdd88ddmr8664045lfu.96.1702927618896; Mon, 18 Dec 2023 11:26:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702927618; cv=none; d=google.com; s=arc-20160816; b=Jf/LegZEugU/laevDHBRctMQivkAdC4ahOzC3vi++n00rsMn6/pwrJQS0kEMcRBIkb w+3rmgL5+CSyTLWvK8JiG4QvULXOHuDwz5ojNzXMkAe6jwYT03OKCWm6CL6CIFxjFBLO 4C0jsgMG74DuH2o/5n/vA2t3cizT2l8HFOVQc3/Wyv8Oy2u8XcqHexBxTmtno8AkxoQZ Ar8HOem5f08ylVeP7TEFts32kI9GW3LghLMtW1Da8PXyA3QX8+BuRYxi0UM+6Jse+mdF miNiAYQi7VqDLZB1Jb1JQbRhEG6LgsBlj1yQ0w9bNKMzjFNGrg82s7sF7eomEYjcIwu7 Ot1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:content-transfer-encoding:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=NSGMy8jcr5ejzucV+ud2jfzQ7r78ZPLpCRqbq0sRa7k=; fh=VE5ZfoJWem8it6OrnlM5ov49ej/hHjarqyIgnpICDoo=; b=UsRH9ekBD60IhMy5GitOIhS8+Yq72welKZ2yMzb5Q8sHclfUh1yED47K2n4kOHe5QY v26wcvffXSkmdjVGxq1QPqEiWzyjvb+lrcS/F2hvHZcB7u7EwIdZ7udsPPhvjaL3HD1k LrxZP6BegN+hhc6z+kQE3W84aOxo0e2y58MOY30F2zVllkKcE00/uqMgoIXso3HRjIZZ Q9hvdqFR95ix4CAwsRb8I1YMyoyAyKnGHfvmOVPv3pSO+YzOUsUWAvdfYQb0pL13iwHQ MEgEVf4W+nIA2RYCL8CLaxlnYLjnH++qhmjnJZC7h/SoCza23gHZQ0xPETfF0WxJnMWT DBdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=IRSgRbOR; spf=pass (google.com: domain of linux-kernel+bounces-4290-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4290-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=gmx.de Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id q12-20020a1709060e4c00b00a2349dcc431si1462024eji.383.2023.12.18.11.26.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 11:26:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-4290-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=IRSgRbOR; spf=pass (google.com: domain of linux-kernel+bounces-4290-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4290-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=gmx.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 49E8B1F24DFA for ; Mon, 18 Dec 2023 19:26:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1E6BB76084; Mon, 18 Dec 2023 19:24:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.de header.i=w_armin@gmx.de header.b="IRSgRbOR" X-Original-To: linux-kernel@vger.kernel.org Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6F2C47346C; Mon, 18 Dec 2023 19:24:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1702927475; x=1703532275; i=w_armin@gmx.de; bh=yBaISgjLgSkrk947Vjw+ExCxzpblr64RVT6udQOT+ys=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To: References; b=IRSgRbOR3YhXyUzCh7o+45Uu0tdNpbOJCOFJx72N/CE59ZckkMrtlpoXxlOOmbVy K/eT36AjnKh7ULyWZuirGzLGAZoQzXySAA345qPYvpmlsvbhax02LfkvcpWEhNQUS HrCJhFdlKyWINVgB5G2aCy6IYB9TF477XV3+2zDreZZn9J5QWesx9bN+ADQZvBlGm sZDHaqclML4MObMCttuCUlLDGX2VGvbtyVNw5O0CM9/eD5OxHjWSc4+FJ6btH8FVa SNiWjS3NDZrF69KZ/VAcQwbdnbfw0RPWviCaAwUtj7wa0WO9KgnGYiYyTPZasoXn7 8oLbh6NvohX7wiIKTg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from mx-amd-b650.users.agdsn.de ([141.30.226.129]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MwQXN-1qz0ti2jbh-00sNuR; Mon, 18 Dec 2023 20:24:35 +0100 From: Armin Wolf To: hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 4/6] platform/x86: wmi: Create WMI bus device first Date: Mon, 18 Dec 2023 20:24:18 +0100 Message-Id: <20231218192420.305411-5-W_Armin@gmx.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231218192420.305411-1-W_Armin@gmx.de> References: <20231218192420.305411-1-W_Armin@gmx.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Provags-ID: V03:K1:z5mGJIGngMBNMuhxr0StFE+zdHVI6DL7+DYf1/N9jov2N9xGU1c jAiA8HArjl1Sh18uC7zdBZec76hVx5yI9xrPbdtWpCcHUQu4CHekwzteTH8fEDk/MHEdsWh gbueqNEGp65xZjqagPt85+HY375Mrn4d18r05Ne1e/rvrDX2D6HJM0tw3HUjXlGMHjsEttD MJcIgig01RDqnl2PdEdjg== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:fDk05zc077U=;nYkcBn+F0BztAT9FptfL1JVN1jn VFPNorOQwmSbGNE8Jwr0kPtqAsBJwmou5EGwTwZqqA4nLYklBzY4aUQOfBMYkwuTSNe79qo/S V/ZHgTFaieeMi97AtqhXzp7Bt/7RMprz3zM0ZbHiGsxDNWFBBp8lrhr4OeCwuhWfpGPnjJLP0 1XZKUxiVDOrLKpCHY7vRo0RbXCSjqJKpO/+uRidOGXpR8nHffQUeaH8ljxOL+E9jDLKNkHVoy v2yvfiwtpbNyCYAME7BNIYUzJCQRh3qhCjWUXNrR52igSBfFizs5KEFLMEzQyE7ph94UeRc3W X0y1K4DhdU5g4qkrlZPuoPKR2cN2C6G1GAYmp0/sN7LpsXsCHB5I15vA696UXFz7jsSMn1gdY aHnliaqA3jY48V3ZGuXcm5Kjspn/cD6rK3UjV0WXKvEcyLSGpcdmqnjUFkX/6KGWtwjdTakOV c2grpi8GkK/HZEteGrD16fmWqAh6HaFuJOlA3bA3yAFtQEkIzAokxYfR0wC0v2PAMM6kCmhqB mYJ0n+bxUYLD9ApmszcQZH96sN1dmvYryyV/XC9tcVq93QQhOFcOxeAwKR63oTzlOHpQAVEms aC1FTRYdGQb/ypEZFGjc7FTr7ErLlhzTMboI9QoRJBjMc5gPskmPOGXlN9r40P0A+Ic+os19f a2TofqnSI5vraZOMKecfUgJMVQbtKC6PN6QIAA2ekK9HY+MUxVzE/upvEAx5kTh8ClzMh1cjw TylANtnOf7bYE5/DdC2KteruCHQZSAsrPLaVtL4c78/rNoL019bRUTMSST1O3D49Z9jbgZcnS gHq5Y15EqMK0/DB2/C2sQ84yfZY1kCe7bhLj98eIlYXVcflNC1bHNOWlwyvC8081+hQoFcNIP 1P2SUPjYsU1qAAjO1xUBtl8fVc/6VbZYekvIinrh8PXgx1IDJR0+MXUSddFY3i85Krin8kK2q PBHHgRePhP2X/D7CGY7KIp2RPU0= X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785649030783717951 X-GMAIL-MSGID: 1785649030783717951 Create the WMI bus device first so that it can be used by the ACPI handlers. Reviewed-by: Hans de Goede Signed-off-by: Armin Wolf --- drivers/platform/x86/wmi.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) -- 2.39.2 diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c index 4bc5da70c1b0..e2bfdc61c4ce 100644 --- a/drivers/platform/x86/wmi.c +++ b/drivers/platform/x86/wmi.c @@ -1276,6 +1276,17 @@ static int acpi_wmi_probe(struct platform_device *device) return -ENODEV; } + wmi_bus_dev = device_create(&wmi_bus_class, &device->dev, MKDEV(0, 0), NULL, "wmi_bus-%s", + dev_name(&device->dev)); + if (IS_ERR(wmi_bus_dev)) + return PTR_ERR(wmi_bus_dev); + + error = devm_add_action_or_reset(&device->dev, acpi_wmi_remove_bus_device, wmi_bus_dev); + if (error < 0) + return error; + + dev_set_drvdata(&device->dev, wmi_bus_dev); + status = acpi_install_address_space_handler(acpi_device->handle, ACPI_ADR_SPACE_EC, &acpi_wmi_ec_space_handler, @@ -1302,17 +1313,6 @@ static int acpi_wmi_probe(struct platform_device *device) if (error < 0) return error; - wmi_bus_dev = device_create(&wmi_bus_class, &device->dev, MKDEV(0, 0), - NULL, "wmi_bus-%s", dev_name(&device->dev)); - if (IS_ERR(wmi_bus_dev)) - return PTR_ERR(wmi_bus_dev); - - error = devm_add_action_or_reset(&device->dev, acpi_wmi_remove_bus_device, wmi_bus_dev); - if (error < 0) - return error; - - dev_set_drvdata(&device->dev, wmi_bus_dev); - error = parse_wdg(wmi_bus_dev, device); if (error) { pr_err("Failed to parse WDG method\n");