From patchwork Tue Oct 10 13:40:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 150796 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp209839vqb; Tue, 10 Oct 2023 06:43:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEQpP4Euj0Jl+5V3nStK04YN0A1TUY8eiC+S8aW4STLzOYJAFyG3irl96N/bui/aQE3pksG X-Received: by 2002:a17:90b:3a8e:b0:274:2906:656a with SMTP id om14-20020a17090b3a8e00b002742906656amr16085220pjb.5.1696945409642; Tue, 10 Oct 2023 06:43:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696945409; cv=none; d=google.com; s=arc-20160816; b=T5YbPrDFVcI1V8o/ktbIGWw8IGGwcliGIjdclXE5Fnvx4462/R/iMC3KDG2bQAhK9/ hj1CEUJsP02T8nqb0Co6PAhTq3flTRIFsXGD6gM54gbNWxyUYXV6/YD7NDRetPryEiW3 Xrz957cACwQ6BCuiRp0wRLOjVfXnZ9zcj6cCsczu7zaiGO+NgGM4ibEE3k/A5IIsOae4 O1Wva1ZN+7FrRzvGzmX2W7CgztNgMdZ1zFnd53srGPh+jBpT7hRaWtokkSZEXYgKFxuB vCMc8Cr1Xussv5UzIeQZyjY4K+c/22gzimGdu0fPRyBqL+hXFA0W5DsP1a2Y6Xt7WqCQ gDgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=SDsPXYd3rqjs/5CQT1Gh+uvIs9RcjFT8wd2e4m6/8/M=; fh=qBAs/NU7OjBDV7YVjJsNRBBmPBB5yfsrgIbGbmjzhkk=; b=JYQ0sZONsKQCScg/MiZxcGT4qJ8pTP556c3eNpvGIUm34hjdYynLuvAkfFWvZcYfV2 SVE/AA3pRf2dtZacFJ8k5vl5jIK8iOh93K5z1tLC/kbj1ikLy1+r5c9ZLT76ZwTzGV+5 Qgx36W7H4Z2IksdpDOdstIPwMBk/tbYkAhNhmy5LWiowz/bgjQJY2DP2ax4ZOY4VIQ7u rRFriSyPm1Rh/8414ylU18/q0VTNe0KRxupsuDLFgAGy+VCUCU6iNNJpKZ5boY9zRpgN jPpikXmWbvrrlz2IkcC03FiIk34dJDMOBBvX9N5w/Eryo42YaoQt56dr5hHvLj8iK/Hh o9hQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=gs4NceA2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id w9-20020a17090aaf8900b0027902dc4914si13513488pjq.161.2023.10.10.06.43.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 06:43:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=gs4NceA2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 875FB8072A3C; Tue, 10 Oct 2023 06:43:27 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232994AbjJJNnH (ORCPT + 20 others); Tue, 10 Oct 2023 09:43:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232587AbjJJNmg (ORCPT ); Tue, 10 Oct 2023 09:42:36 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C413A10FE; Tue, 10 Oct 2023 06:40:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696945225; x=1728481225; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=XgsVgCZAuytkZmmW6oOHBDJJnZdufzsQiRpSM2n44YE=; b=gs4NceA2E1yjZfx0fHjDB26/Obbz+BdCu49jnypjjVCY+62qBzT9374e fqyC7jM66WYQeEDQQgd3ZwyqAfcv6vwvKL4M9/PRcr1n3HJaK+iCZDecq PKlX07n7y+kkT8JJ22n/t/MEgVbrdOowHsyUZMLDEdCxQsQjf9jZN8J/J oxSXVEJ3DjvmIfyjZYvmgipEYNt2c/DrHxJ9NHAwhHEhAkyDCIUEBvWMW HRw82qcY3moqINq4AUv47IMqnson5QAHikRJi2U11paYbt714lLEZe3oZ sRJOrvDqF6AGDZMzpyioY1XvLRDP9iU14xuIuorlowg0o7r4J1tZD+p9H g==; X-IronPort-AV: E=McAfee;i="6600,9927,10859"; a="387232371" X-IronPort-AV: E=Sophos;i="6.03,212,1694761200"; d="scan'208";a="387232371" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2023 06:40:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10859"; a="819235562" X-IronPort-AV: E=Sophos;i="6.03,212,1694761200"; d="scan'208";a="819235562" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga008.fm.intel.com with ESMTP; 10 Oct 2023 06:40:22 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id B621B35A; Tue, 10 Oct 2023 16:40:20 +0300 (EEST) From: Andy Shevchenko To: Hans de Goede , Andy Shevchenko , platform-driver-x86@vger.kernel.org, acpi4asus-user@lists.sourceforge.net, linux-kernel@vger.kernel.org Cc: =?utf-8?q?Jo=C3=A3o_Paulo_Rechi_Vita?= , Corentin Chary , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Mark Gross Subject: [PATCH v5 1/1] platform/x86: asus-wireless: Replace open coded acpi_match_acpi_device() Date: Tue, 10 Oct 2023 16:40:19 +0300 Message-Id: <20231010134019.3892062-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b MIME-Version: 1.0 X-Spam-Status: No, score=2.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Tue, 10 Oct 2023 06:43:27 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779376229808268816 X-GMAIL-MSGID: 1779376229808268816 Replace open coded acpi_match_acpi_device() in asus_wireless_add(). Reviewed-by: Hans de Goede Signed-off-by: Andy Shevchenko --- v5: updated subject (Ilpo) v4: used proper API, added tag (Hans) v3: rewrote error path logic (Hans) v2: fixed compilation error drivers/platform/x86/asus-wireless.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/platform/x86/asus-wireless.c b/drivers/platform/x86/asus-wireless.c index abf01e00b799..41227bf95878 100644 --- a/drivers/platform/x86/asus-wireless.c +++ b/drivers/platform/x86/asus-wireless.c @@ -148,16 +148,12 @@ static int asus_wireless_add(struct acpi_device *adev) if (err) return err; - for (id = device_ids; id->id[0]; id++) { - if (!strcmp((char *) id->id, acpi_device_hid(adev))) { - data->hswc_params = - (const struct hswc_params *)id->driver_data; - break; - } - } - if (!data->hswc_params) + id = acpi_match_acpi_device(device_ids, adev); + if (!id) return 0; + data->hswc_params = (const struct hswc_params *)id->driver_data; + data->wq = create_singlethread_workqueue("asus_wireless_workqueue"); if (!data->wq) return -ENOMEM;