From patchwork Sat Oct 7 08:12:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 149539 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp806212vqo; Sat, 7 Oct 2023 01:12:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGZgfEUtUysacfioOfl06K6cRIwfS2LCmpZsUQRIqH6hDrQBCQe0HpXo5uIugSPeFUQRaUF X-Received: by 2002:a05:6808:154:b0:3ae:52f3:ba05 with SMTP id h20-20020a056808015400b003ae52f3ba05mr10546369oie.28.1696666362733; Sat, 07 Oct 2023 01:12:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696666362; cv=none; d=google.com; s=arc-20160816; b=gCYPwevS+jqCwttlqQTYyQnE9662dyrra5bwtoh8JufrK64YpjU+vUIzFKTVnsnjFR 6pIIg76o4iQkdLtnpJFFUdxmwKtP6P3A6dC4D7z61UpX0/y9J2vWecwUcsISZyDfSUvC v06l1vmVYHu0s7dnlfN43Uj6PHhI1GzfL3I5W8D10x5HHAJhIhpZgGXTwzUHG8aseL35 NW7jjgwh5jKJN5rqglaG9nEXDq8AEDCSn9wOuHutO1sBiiET9xJ7pEVinTk5cFZddCAE 9tCw0l5aOTafhgNJqzujtHt1Lp0x8t/n7SoVwfpr5npeTYWCl2//JPFa+oZc/CJa/ejs Ne/w== 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=Mdz2SFDqPWiOMVWpUuhDdJ92ay+J9KAqVInyAfIkujY=; fh=I4X5A/upTxjr4MJUWiwyG90hiFVpRAn8rF3FrSssWXo=; b=pJwTfE/Vy9hMQsEBZeX6mC27lcv+BGJuJ0f3j1skQqFT33LOoICBSvpcR0bn/etCqN mk/SRXRzeiOKnC2cGwVJaGnhdWxZ3xJBEPDZRhJnMxtr1+yh2x2tfnkFzDtxXEqi/TB+ IojWrJ5DGY3As6kX0ftoNcJSqODbuPp0F/USoOMaGAZsdoYiE8bMhDMjuuhKR5vXQfeQ VSlaVp5wZ1NwB2h0TnAS1IuWrN5Kl2l0tNmdfCDT4PiFpf1B7dsp8BsNm8rhITZo81ih 4dy180XrHwmZAHOm9dcNzafgMYQbRcEq8vunqpFMDbSjwD6IhbFbED+oxdVzfuydIZKM Oa4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=aHp8ehL+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id h11-20020a63574b000000b00578c64433c9si5335145pgm.894.2023.10.07.01.12.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 01:12:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=aHp8ehL+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id CCFCB8028FC3; Sat, 7 Oct 2023 01:12:41 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234134AbjJGIMk (ORCPT + 18 others); Sat, 7 Oct 2023 04:12:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230011AbjJGIMi (ORCPT ); Sat, 7 Oct 2023 04:12:38 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6C3EA6; Sat, 7 Oct 2023 01:12:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696666356; x=1728202356; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=MthAMNSAvqVlqmjaZAPKyZLE+PvlZ9m2aggOFYe4Cq4=; b=aHp8ehL+BZhmfEF/iJc3rmxK9zwWCu3UGTAiLXlvOs1gbI8lCnZOM5zU vqfcZb4SJZ7nMYI2OZQhdCN629MakGM89lLhYY5T1BriBxe5Z25NgQzf9 QPDGzw4/75ST5Tt+k6nZBZqrVOtAxT6SvUThtFhEMACWbuCR/kfssF7H+ akWVD7t4/tVn5evyoKSp1G723JqUAXEoy3XNkG7rMwtOiVQUAc4Cjw9iU NRGIIudcmMKxC6YplYF9m4e5agxv8r28fOJKdOpA2AM0WTsCrxH8ZvFkk KKQPjfimB3zFfNtp3y8/u5FHYs7OAV5K6HhM6oZo2mrFF6iLFq2zr98wS Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10855"; a="381177737" X-IronPort-AV: E=Sophos;i="6.03,205,1694761200"; d="scan'208";a="381177737" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2023 01:12:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10855"; a="729123789" X-IronPort-AV: E=Sophos;i="6.03,205,1694761200"; d="scan'208";a="729123789" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga006.jf.intel.com with ESMTP; 07 Oct 2023 01:12:33 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 3D5CD456; Sat, 7 Oct 2023 11:12:32 +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: Corentin Chary , =?utf-8?q?Jo=C3=A3o_Paulo_Rec?= =?utf-8?q?hi_Vita?= , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Mark Gross Subject: [PATCH v4 1/1] platform/x86: asus-wireless: Replace open coded acpi_match_device() Date: Sat, 7 Oct 2023 11:12:30 +0300 Message-Id: <20231007081230.3555681-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=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Sat, 07 Oct 2023 01:12:41 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779020425705015668 X-GMAIL-MSGID: 1779083628047608903 Replace open coded acpi_match_device() in asus_wireless_add(). Reviewed-by: Hans de Goede Signed-off-by: Andy Shevchenko --- 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;