From patchwork Sat Dec 16 01:55:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Armin Wolf X-Patchwork-Id: 179733 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp9700468dys; Fri, 15 Dec 2023 17:57:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IHAt3uKi1LLl68UzABxOZUs4bfbM0wQhtYZ2Es0+vp5rftIv5nHba++I/N7M4y6vixLNWPh X-Received: by 2002:a05:6214:202f:b0:67f:2a02:7f34 with SMTP id 15-20020a056214202f00b0067f2a027f34mr85170qvf.112.1702691858583; Fri, 15 Dec 2023 17:57:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702691858; cv=none; d=google.com; s=arc-20160816; b=Vac6536McUSIA7BNnbgO9rYj8r9wkvoLBoKEDQ41zkq3EBh6CkromaFavhrzXCowGS 9Ch1pv3ZmUl5blf1fYOhtgKEFmyPy/zKPpzBeXBLMULz+cUxaf8pyLHPxXnbVUvcwwNh wPcFivoJaIqQ1Bh8hSZAI1eX741mi5+YEiofr7laqpXQzkd99zwnpmHnWcYOWAcVJ7V1 EbiQbohsoPrv5DMwgYh/3kdiaCC1om4kK1MagzjeLmifHYKRLSz3IrxRA/wLRPiT9Wcm 2Iq+w/rlhxAMHkt72PG3yVkgmA2r1OjHNsmjcbQ7RTbXv+rLRaOW8CjPZndC1EL+z4Dm 9m4w== 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=4uRriTxzUrWSfR+ZbsOKT9aJQv2RaqaPD3e8HpWP0sc=; fh=VE5ZfoJWem8it6OrnlM5ov49ej/hHjarqyIgnpICDoo=; b=XkpdjiRiUPYuJ4UE9LArd+aMJKujjZxS3VEhmfJsm7iYjxJMto+uD7EQ3051wgUOAT m9Tz00DSg89J4bOHYcmoAmmOSpyOqvh7BTMEkeYzn1mRZxTU57SQPolUy4UFdghwR4st zlw/4CJUquzh0e6lCP7wMdAp4aBk+vpTwLM4kGUL5LfLbteHBYLyEvNfOKtrorFraFu1 APWogcFYhD81wPmrEa5SQDCh8Fm27Gy7BsEc9v+Ae2yt30CCjSdq/FDm+u3RHcuYylpl 0vXBXoA2OfCmd9v0gsw0ZgxHqEce96ODkql66oouHq8n9W1/HoL79Ph6r5ApmM8BhzVL yE+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=n9woXCgU; spf=pass (google.com: domain of linux-kernel+bounces-1942-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1942-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=gmx.de Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id v2-20020a0c9c02000000b0067f20e2145csi1629966qve.149.2023.12.15.17.57.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 17:57:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-1942-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=n9woXCgU; spf=pass (google.com: domain of linux-kernel+bounces-1942-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-1942-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 51C0F1C24726 for ; Sat, 16 Dec 2023 01:57:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E25FDDDB4; Sat, 16 Dec 2023 01:56:29 +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="n9woXCgU" X-Original-To: linux-kernel@vger.kernel.org Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) (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 44D6A28ED; Sat, 16 Dec 2023 01:56:24 +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=1702691778; x=1703296578; i=w_armin@gmx.de; bh=JXqSKmcFLSyeKf7OYURl84uaiL8PV4z/6Y9EVeVg1Vc=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To: References; b=n9woXCgUk5pkpwrrsAXeVUw6f3vm7fO/k7OkfIrot7moVOsX2lDO/8zvYkVciW0s wikaqjBdVw5eITRhGlMY5wOnrn5fGzw/eQqiwfSq3HGvUlHtFJORdBBLwp/KAplLA 0fhzCn10Nv9LvWwRtqvkgxiDXygMOzGZF3jO9m0Y3VGWj9pRU/KNCxuwQfzCIF9a0 vnQjKY+iS7xNXPiXVPQldHlvuBAGTVaJ86Fxln19rBKPlhtG/2niAG/vrwfQEB8oi c4MP46+lFp03WcGDaLvi2+tEagAc5CDi8qLIBIlp4j/CsIY+fFaWKWkwD3kd2dU7W ivDh5WsaNGCOFeba4g== 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 (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N8ob6-1rIQg02ZpW-015q1t; Sat, 16 Dec 2023 02:56:18 +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 4/6] platform/x86: wmi: Create WMI bus device first Date: Sat, 16 Dec 2023 02:55:59 +0100 Message-Id: <20231216015601.395118-5-W_Armin@gmx.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231216015601.395118-1-W_Armin@gmx.de> References: <20231216015601.395118-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:sWKj5sipcYAyJFmd0R5+CGzUK9Ib961ca3/LW0BsFdGMwSMvakr FbCY7Zn0fIjO3aAK0v4KmhI+6jGTbv4KFsSn3HtdaVhU5m9P4i/2ZadIvX5pL8a23uCPZTp UMoZIAX0/GwDDZtwIdJNTMPrFFUXvo+lxEwzh2ikQ2KOgcemCpnyGnf4qZYrYPfi6IeFyfO GzuaKaIaFBZHk4WAo+jzQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:XSs2184x+uQ=;IMc4kWXI1OoG3Wj4ME7//yyKABh 4u34exp+qKQJJsGJHOnon6yhF+jEmCFw0rACVzLmfI1YY+01vFB0SBl6JuGWzijPIsVS8g9Gf AVBy8lsRLIN2zWlTAZLkHAZ1GekZ6EPIsS09QkT+WcxLGr5ePIE/epe3z29yrz4kkRdTlABLs /jZ318vaPFWwJyBnLqLisewk6wepmZvSXcN7bRXI3V4kuDPNn2zZ07168K3mtzkRLW3vtUg7G VIWe1fTppSvCPdN3E8EwCo+EDaVxnt2y275QrYywdsEbuuOY5dVUhdnRdiNPi37Thyu2ADMs4 VvQaPa0wotbZOo1QAq46/VP6NT73snEa8Pz2F7YvA0uBb3E5ySpjDxPvSo4YichI2mG9I4rQp zqLam9echWLnSw4j49tlXEkbz/czZ2XoQ6AR9XN2vdDbEtVoBkHQ4nBkZNPZbT68wmPhw8R7s QnGLpcfEygLsPT0vsH8nKruRnD51Lux+5scEweYXBKQDDAAz2fzWX7X2+ds9zYOioD7Yf4oE/ P7/Ldh85yor9qa4YJbmIuPMFdXUPTHApsQ5o4vjB+7CIVP+M/cJkOJbJ6odpBUhJ5nJhl60+R JV7CxYG6I2zm7D1vz2yiWIBP6nFJ+AGQT+28QM85H3QEPXjfEQ3U1xPkQod+17H6dCdp0x0UP +TcIrWX1zXqj/PtBvJ5oIHlvWXQGZ0Cwf0ShD84n4RFUUHPodgRbePhnrqJjrGtpnc0WPtj6m rdNCszHSDSQU+RZNcYwBEe8NMxeIs58dyVd8+V9WKMYKxari5sLEYzIqgIbGKg3mw5R6NoPAo Sp+oDUuvKGXO5IcT1ENUdmul5caZ4awjQxGe0GKk8/62ynSHSaiLxfEj+3hpjFoBYhQ31NbTm pF6lYM/ctgBK4a5v/JiJnEKQIXeTAXxxyij3L/Skiffgrb2N0v9ifCt+YSZbNanBMiPuWsI4U E7L/e+CQbOyVuoWo6v5+jJQou4M= X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785401818506815692 X-GMAIL-MSGID: 1785401818506815692 Create the WMI bus device first so that it can be used by the ACPI handlers. 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 4306a5533842..61849a43e2c2 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");