From patchwork Fri Oct 6 15:53:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 149311 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp425535vqo; Fri, 6 Oct 2023 08:54:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFxhw8ek26DKgLoydgilVyftHEXkKIHlMUxWSaHb0MaqjH3Ud8O1TSmY5qK36Hjy1Tgywsj X-Received: by 2002:a05:6a00:1516:b0:691:da6:47b with SMTP id q22-20020a056a00151600b006910da6047bmr9430748pfu.10.1696607661566; Fri, 06 Oct 2023 08:54:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696607661; cv=none; d=google.com; s=arc-20160816; b=elWfMRijz7g7dbhrJ2DFvOOJzYQ+liYvrDWeg7dUmMTLgM0HXJVW+sL3o9KS8B882M 0G6lz+6nwUYmUViE7Uy/keehIiGxW5nTXnuGKl6Qmhsc9qiYY5gfCi/YkMuLXNfiX29o eCHmwFE5CwNaj6fypEGIKzOAM7GFx8QJE5rWCLNXcUw38Y9fB3zIvnoBHmrn2L6ML+zU 11mO06pCZTwyr2EotYVUWhn7EgrU6Is37oDEUrojbIbLyZT2EEFaMHjdqg79edwqTJfq Lyyi2ZbVVt1pl3OcccLnzroR+yUoVNJyj9geGSuH14kdwRoK0rUgEZj8qLWva+7RxG6h ZywA== 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=JphsHp7ZZpSM0mIWeht1l8BzO8THG68oh+tQ5p375Pg=; fh=I6d60MsV56SMMC2RxE5T/p7uhfzD073DQT3JsWHBQEU=; b=az969X5tZn23WFqS/+i2ePY+zDEsFkZPO73y73UOHP+Yvc7GLxXAmYP/swcgmR0/fz YeekKVyhrwdUYAdz4OTZd/B0t5XPQkjCxvAoyztPQNP5hfKoP/31oJyQBASbDib95NX4 UtugOHh75fWwAzgIZpufBjxW5dPj3sNNPsGSZOG8k0VSBrbwp4HdeGF1gJk34yoN9vGN 3WN+Cs2Sv/LLdRKoveKXmx0gKTLyh4kK/8Ur7b93YQsJv+XGCdat4pXzLxC7oeaHypHT CfVqpwHuBrDYnvk3zishDVTB+6Itr7dD3tRVKIXSdhtWt148sfxFeLc10mnW3BLlVmAZ IU4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ZhMxeCjg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id b67-20020a636746000000b00565e56713c7si4044494pgc.91.2023.10.06.08.54.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 08:54:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ZhMxeCjg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (Postfix) with ESMTP id A0C758096B80; Fri, 6 Oct 2023 08:54:19 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232904AbjJFPyC (ORCPT + 18 others); Fri, 6 Oct 2023 11:54:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232502AbjJFPyA (ORCPT ); Fri, 6 Oct 2023 11:54:00 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08511A6; Fri, 6 Oct 2023 08:53:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696607639; x=1728143639; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=T5padUABpr+rZPmgSty+LxTkQr1WULnszt8+VvtZGdQ=; b=ZhMxeCjgRkw33Vpnt3ZhoSafHIGidsOy8mZuqimVPN5StDdZ3gbdTVRN pQsbajBvQAiCpfw7THLGko33sq2kQ7p7r8+HOmsWTHXAr8znCLSg3S5GT irn2q+qcU740GUuMucoCBZ5nRHRFYDzYaWw9bsypmNSateyclYLBrikoc 5Mqettckw70WPbSN3hsdBoXIrKaArlcosq9wIy8TsC5JVUqjLZlxOce1r jtDpjzpE+EfVT9N9giN2zBDB+ZzZrva6nZQ5aXYrwXx1ErUzRr5nq4Uxx thT3krsj3yRTqoanZFfeWqi2FY3dYks4tv0v1Y0BzjewtWOcoynh1yVi9 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10855"; a="386602078" X-IronPort-AV: E=Sophos;i="6.03,204,1694761200"; d="scan'208";a="386602078" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Oct 2023 08:53:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10855"; a="875980608" X-IronPort-AV: E=Sophos;i="6.03,204,1694761200"; d="scan'208";a="875980608" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga004.jf.intel.com with ESMTP; 06 Oct 2023 08:53:55 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id D1946430; Fri, 6 Oct 2023 18:53:53 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , acpi4asus-user@lists.sourceforge.net, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Cc: =?utf-8?q?Jo=C3=A3o_Paulo_Rechi_Vita?= , Corentin Chary , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Mark Gross Subject: [PATCH v3 1/1] platform/x86: asus-wireless: Replace open coded acpi_match_device() Date: Fri, 6 Oct 2023 18:53:51 +0300 Message-Id: <20231006155351.3503665-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 fry.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 (fry.vger.email [0.0.0.0]); Fri, 06 Oct 2023 08:54:19 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779020425705015668 X-GMAIL-MSGID: 1779022075054812555 Replace open coded acpi_match_device() in asus_wireless_add(). Signed-off-by: Andy Shevchenko Reviewed-by: Hans de Goede --- 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..1a571efa02eb 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_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;