From patchwork Thu Jun 30 21:28:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 12902256 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E209EC433EF for ; Thu, 30 Jun 2022 21:29:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237641AbiF3V3G (ORCPT ); Thu, 30 Jun 2022 17:29:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237582AbiF3V2k (ORCPT ); Thu, 30 Jun 2022 17:28:40 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 164843700E; Thu, 30 Jun 2022 14:28:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656624520; x=1688160520; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=vov2D8XGLh7l4fzlqjW0FYaJ1gTowtT9oIai97+IhHY=; b=lqc0a5cbBr/XdEfiZALSXhOhQpaT3KpFm4M8usVu2M16Y3M59+x7Ix6f WvD4pWHxR/xWnm3VylAAlPYLTR+4Vptd+CydB0+GPSXPc1hSTuURp8kjR qI56do2P/aC2Mjwgc1dkPG6UNnAjKQDN6YKv0S33VlUIzwd4UMU84c71T c4hGz4GF17AC/sZwUi3c2/BLkI9kPRQQgqUs36ZLq2cMrx2H+UC9k6287 mMzAZlsPnZgw5Z3EoNOJXMhuiVdlb1as5JnbXf6zxLJimB7xLBkXV+TyQ k33omhVDZcebYMs+EQxMu+7EarIHZIWtAIO/I8sGRtGqL5DQqE8XpsLrJ w==; X-IronPort-AV: E=McAfee;i="6400,9594,10394"; a="280021839" X-IronPort-AV: E=Sophos;i="5.92,235,1650956400"; d="scan'208";a="280021839" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jun 2022 14:28:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,235,1650956400"; d="scan'208";a="588945471" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga007.jf.intel.com with ESMTP; 30 Jun 2022 14:28:24 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 0B8D111E; Fri, 1 Jul 2022 00:28:30 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , "Rafael J. Wysocki" , Hans de Goede , Wolfram Sang , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, linux-pci@vger.kernel.org, ibm-acpi-devel@lists.sourceforge.net, platform-driver-x86@vger.kernel.org Cc: "Rafael J. Wysocki" , Len Brown , Mika Westerberg , Bjorn Helgaas , Henrique de Moraes Holschuh , Mark Gross Subject: [PATCH v1 1/5] ACPI: utils: Introduce acpi_match_video_device_handle() helper Date: Fri, 1 Jul 2022 00:28:15 +0300 Message-Id: <20220630212819.42958-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org There are a couple of users that open code functionality of matching a given handle against ACPI video device IDs. The current approach duplicates ID table along with the matching code. Consolidate it under the acpi_match_video_device_handle() helper's hood. Signed-off-by: Andy Shevchenko --- drivers/acpi/utils.c | 19 +++++++++++++++++++ include/linux/acpi.h | 2 ++ 2 files changed, 21 insertions(+) diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c index 3a9773a09e19..4800aba3b99c 100644 --- a/drivers/acpi/utils.c +++ b/drivers/acpi/utils.c @@ -929,6 +929,25 @@ static int __init acpi_backlight(char *str) } __setup("acpi_backlight=", acpi_backlight); +static const struct acpi_device_id video_device_ids[] = { + {ACPI_VIDEO_HID, 0}, + {} +}; + +/** + * acpi_match_video_device_handle - match handle against ACPI video device IDs + * @handle: ACPI handle to match + * + * Return: true when matches, otherwise false. + */ +bool acpi_match_video_device_handle(acpi_handle handle) +{ + struct acpi_device *adev = acpi_fetch_acpi_dev(handle); + + return adev && !acpi_match_device_ids(adev, video_device_ids); +} +EXPORT_SYMBOL(acpi_match_video_device_handle); + /** * acpi_match_platform_list - Check if the system matches with a given list * @plat: pointer to acpi_platform_list table terminated by a NULL entry diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 7b96a8bff6d2..c48e8a0df0cc 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -439,6 +439,8 @@ extern char *wmi_get_acpi_device_uid(const char *guid); extern char acpi_video_backlight_string[]; extern long acpi_is_video_device(acpi_handle handle); +extern bool acpi_match_video_device_handle(acpi_handle handle); + extern int acpi_blacklisted(void); extern void acpi_osi_setup(char *str); extern bool acpi_osi_is_win8(void); From patchwork Thu Jun 30 21:28:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 12902253 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 93CA9CCA486 for ; Thu, 30 Jun 2022 21:28:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237575AbiF3V2j (ORCPT ); Thu, 30 Jun 2022 17:28:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237560AbiF3V2a (ORCPT ); Thu, 30 Jun 2022 17:28:30 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65D3A5073B; Thu, 30 Jun 2022 14:28:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656624509; x=1688160509; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=N5lyFqnVhHtCOFomEyKwnEiEJIcX2aeyjWniqc32Y2A=; b=a6gUA8IS3yo6z+b3z2uNx/V/2hCNR4sSB+KWs5Wlg7I3DHT/15tIA38g Zd88VmNDqt3T1mfOzXQDRDHe9Y4vWwsuVK9enO05zcmf4qXY8pll5Bwxo Wa9U1/XMcrk5ObtpJu5pXRKlvlQMkudmlpMeY2w40d2FoM+PXwJa7xdgX wQZBHKO3jtYaWtmrig83P0MufahQlZYTeZbyihNEJKGWEn+kQHiTTif3K R4QN6uqDSPdw7a5OdMDwjby7u7r77S7B5N6Ru73Gk5h07DeF+RcABS/Gl y1ChCWqK4B4n64cxCFuVwS6Ub4oKQdQfVVAj2UP12hnB4bRcHYt9n1dYQ w==; X-IronPort-AV: E=McAfee;i="6400,9594,10394"; a="271246007" X-IronPort-AV: E=Sophos;i="5.92,235,1650956400"; d="scan'208";a="271246007" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jun 2022 14:28:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,235,1650956400"; d="scan'208";a="681143807" Received: from black.fi.intel.com ([10.237.72.28]) by FMSMGA003.fm.intel.com with ESMTP; 30 Jun 2022 14:28:25 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 1674F67; Fri, 1 Jul 2022 00:28:31 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , "Rafael J. Wysocki" , Hans de Goede , Wolfram Sang , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, linux-pci@vger.kernel.org, ibm-acpi-devel@lists.sourceforge.net, platform-driver-x86@vger.kernel.org Cc: "Rafael J. Wysocki" , Len Brown , Mika Westerberg , Bjorn Helgaas , Henrique de Moraes Holschuh , Mark Gross Subject: [PATCH v1 2/5] ACPI: video: Convert to use acpi_match_video_device_handle() helper Date: Fri, 1 Jul 2022 00:28:16 +0300 Message-Id: <20220630212819.42958-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220630212819.42958-1-andriy.shevchenko@linux.intel.com> References: <20220630212819.42958-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Replace open coded variant of acpi_match_video_device_handle() helper. Signed-off-by: Andy Shevchenko --- drivers/acpi/video_detect.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c index becc198e4c22..14ddbd821a46 100644 --- a/drivers/acpi/video_detect.c +++ b/drivers/acpi/video_detect.c @@ -59,16 +59,10 @@ static void acpi_video_parse_cmdline(void) static acpi_status find_video(acpi_handle handle, u32 lvl, void *context, void **rv) { - struct acpi_device *acpi_dev = acpi_fetch_acpi_dev(handle); long *cap = context; struct pci_dev *dev; - static const struct acpi_device_id video_ids[] = { - {ACPI_VIDEO_HID, 0}, - {"", 0}, - }; - - if (acpi_dev && !acpi_match_device_ids(acpi_dev, video_ids)) { + if (acpi_match_video_device_handle(handle)) { dev = acpi_get_pci_dev(handle); if (!dev) return AE_OK; From patchwork Thu Jun 30 21:28:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 12902254 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 793BBCCA487 for ; Thu, 30 Jun 2022 21:28:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237580AbiF3V2k (ORCPT ); Thu, 30 Jun 2022 17:28:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237559AbiF3V2a (ORCPT ); Thu, 30 Jun 2022 17:28:30 -0400 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FB1950737; Thu, 30 Jun 2022 14:28:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656624509; x=1688160509; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=cVLSgdqy7Mp0ViPp4OflMAPYFT4f/Xn/28iMuk2xBgQ=; b=CfivCdwlLoNgpZjzE8Eml0OXDdC1+o66ZllLG5mazizE6xj2v1e0Ew1/ GcVj07RO5ZO1Z9BvjTNyKgs6ET+YomsUyMnuaOrXs4BbTJmveuvmtFJeL i2rFUV9d0DwJsZc2PfeQ/itDu5PwSS2jorcJJ88h+xQ81k46gpLU8Wl+F uTm633XbZCuj+lfVoIzZOARnraV92WgiOnvYXaKQJEVX/An6YFs/ow7SP afNaECp2lkWTKwWNvi3CTDREo9JlSD+ujhqo46PAWXOMUtmzojtF9kEue dc3QPntOChwk3RuVte6Ob/FQ8jABdp5g3fEgRJLx47uZiIYyeoeaqoYgO Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10394"; a="265506575" X-IronPort-AV: E=Sophos;i="5.92,235,1650956400"; d="scan'208";a="265506575" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jun 2022 14:28:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,235,1650956400"; d="scan'208";a="591454757" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga002.jf.intel.com with ESMTP; 30 Jun 2022 14:28:24 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 1FBE113C; Fri, 1 Jul 2022 00:28:31 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , "Rafael J. Wysocki" , Hans de Goede , Wolfram Sang , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, linux-pci@vger.kernel.org, ibm-acpi-devel@lists.sourceforge.net, platform-driver-x86@vger.kernel.org Cc: "Rafael J. Wysocki" , Len Brown , Mika Westerberg , Bjorn Helgaas , Henrique de Moraes Holschuh , Mark Gross Subject: [PATCH v1 3/5] i2c: acpi: Convert to use acpi_match_video_device_handle() helper Date: Fri, 1 Jul 2022 00:28:17 +0300 Message-Id: <20220630212819.42958-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220630212819.42958-1-andriy.shevchenko@linux.intel.com> References: <20220630212819.42958-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Replace open coded variant of acpi_match_video_device_handle() helper. Signed-off-by: Andy Shevchenko Acked-by: Wolfram Sang --- drivers/i2c/i2c-core-acpi.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/i2c/i2c-core-acpi.c b/drivers/i2c/i2c-core-acpi.c index 08b561f0709d..e6de54dec010 100644 --- a/drivers/i2c/i2c-core-acpi.c +++ b/drivers/i2c/i2c-core-acpi.c @@ -128,15 +128,6 @@ static int i2c_acpi_fill_info(struct acpi_resource *ares, void *data) return 1; } -static const struct acpi_device_id i2c_acpi_ignored_device_ids[] = { - /* - * ACPI video acpi_devices, which are handled by the acpi-video driver - * sometimes contain a SERIAL_TYPE_I2C ACPI resource, ignore these. - */ - { ACPI_VIDEO_HID, 0 }, - {} -}; - static int i2c_acpi_do_lookup(struct acpi_device *adev, struct i2c_acpi_lookup *lookup) { @@ -150,7 +141,11 @@ static int i2c_acpi_do_lookup(struct acpi_device *adev, if (!acpi_dev_ready_for_enumeration(adev)) return -ENODEV; - if (acpi_match_device_ids(adev, i2c_acpi_ignored_device_ids) == 0) + /* + * ACPI video devices, which are handled by the acpi-video driver, + * sometimes contain a SERIAL_TYPE_I2C ACPI resource, ignore these. + */ + if (acpi_match_video_device_handle(adev->handle)) return -ENODEV; memset(info, 0, sizeof(*info)); From patchwork Thu Jun 30 21:28:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 12902252 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A3913CCA47F for ; Thu, 30 Jun 2022 21:28:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237553AbiF3V2j (ORCPT ); Thu, 30 Jun 2022 17:28:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237557AbiF3V23 (ORCPT ); Thu, 30 Jun 2022 17:28:29 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D702F443D3; Thu, 30 Jun 2022 14:28:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656624508; x=1688160508; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jdYxOV2rC4m5qbz+X1x7eTSjCsv8/obXsOi7V/f8hhY=; b=h/xtQaWNAVZawetWJKstFUzls7srfPBlKHmkrK3MMk4CPaAPecnOZI06 zJ+qzCDHxFff+B9nABx7QoH8YYrq9QPnYG01qeLbG2hRdbx8uK4dZACJo CeYx8E0FPyRQlrcJCemYvxGowDG/fxxfJbMVdXk1Yrk9xYnbdohp9E4Uh +UHAZKzLrI4cMLUfon9xdCXX8aKvS+SONnEPDt2uauchGQoPv2JWSYMkv 60OG1leYy88FaxRWY1ors4IQ3KgXUNYKmcIXDx5s4K4gEh7YRP8r2QWm/ V0JVgozbmC0jpk7rKVwfpJy05RJh9zfeSxJTTnYnSL3oqtVVolWXSZhJU w==; X-IronPort-AV: E=McAfee;i="6400,9594,10394"; a="282506504" X-IronPort-AV: E=Sophos;i="5.92,235,1650956400"; d="scan'208";a="282506504" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jun 2022 14:28:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,235,1650956400"; d="scan'208";a="648065571" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga008.fm.intel.com with ESMTP; 30 Jun 2022 14:28:24 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 2E4871E8; Fri, 1 Jul 2022 00:28:31 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , "Rafael J. Wysocki" , Hans de Goede , Wolfram Sang , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, linux-pci@vger.kernel.org, ibm-acpi-devel@lists.sourceforge.net, platform-driver-x86@vger.kernel.org Cc: "Rafael J. Wysocki" , Len Brown , Mika Westerberg , Bjorn Helgaas , Henrique de Moraes Holschuh , Mark Gross Subject: [PATCH v1 4/5] PCI/VGA: Convert to use acpi_match_video_device_handle() helper Date: Fri, 1 Jul 2022 00:28:18 +0300 Message-Id: <20220630212819.42958-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220630212819.42958-1-andriy.shevchenko@linux.intel.com> References: <20220630212819.42958-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Replace open coded variant of acpi_match_video_device_handle() helper. Signed-off-by: Andy Shevchenko --- drivers/pci/vgaarb.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c index f80b6ec88dc3..47058f70c2c9 100644 --- a/drivers/pci/vgaarb.c +++ b/drivers/pci/vgaarb.c @@ -585,9 +585,7 @@ static bool vga_is_firmware_default(struct pci_dev *pdev) static bool vga_arb_integrated_gpu(struct device *dev) { #if defined(CONFIG_ACPI) - struct acpi_device *adev = ACPI_COMPANION(dev); - - return adev && !strcmp(acpi_device_hid(adev), ACPI_VIDEO_HID); + return acpi_match_video_device_handle(ACPI_HANDLE(dev)); #else return false; #endif From patchwork Thu Jun 30 21:28:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 12902255 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5FA8BCCA47F for ; Thu, 30 Jun 2022 21:28:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237561AbiF3V2o (ORCPT ); Thu, 30 Jun 2022 17:28:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237513AbiF3V2b (ORCPT ); Thu, 30 Jun 2022 17:28:31 -0400 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3838151B0C; Thu, 30 Jun 2022 14:28:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656624510; x=1688160510; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=B0VMjhosdrjMBEAvWD5hkIGzjJXjnMXp82dnbVLODJA=; b=SbZiErPuFGnPQQUrbN1CttA0qoQGJMdR2/INfbA3FSETmtJwKLQe5/ZI FYPXncaNdaRwtR+wydRLfOzk4RGao7hAPLzPY4kcKPoX6nFzAH9GWHDyD rnPytUXty9QEz+CD9uqJGQqa/3wIz3lJzn5GYiC/r0FldUsXwmkSHZdOs Lp92pHX01j3s3Ov1Fqvuia3GOlsj+KOlvvgJwZV7QGJUUA29NCQoqqfJE /MZOMth9zT7vOzhFSuiYe+r69Y2pQBiDj1IeaUnAjPX7iMYmLGpP5qcqT smNLAONWnksHoyKG+W/PRS1uXdlXtImsreHfe3b2tkAF0MRLC7ijvGkQQ g==; X-IronPort-AV: E=McAfee;i="6400,9594,10394"; a="265506576" X-IronPort-AV: E=Sophos;i="5.92,235,1650956400"; d="scan'208";a="265506576" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jun 2022 14:28:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,235,1650956400"; d="scan'208";a="591454759" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga002.jf.intel.com with ESMTP; 30 Jun 2022 14:28:25 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 339A61A0; Fri, 1 Jul 2022 00:28:31 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , "Rafael J. Wysocki" , Hans de Goede , Wolfram Sang , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, linux-pci@vger.kernel.org, ibm-acpi-devel@lists.sourceforge.net, platform-driver-x86@vger.kernel.org Cc: "Rafael J. Wysocki" , Len Brown , Mika Westerberg , Bjorn Helgaas , Henrique de Moraes Holschuh , Mark Gross Subject: [PATCH v1 5/5] platform/x86: thinkpad_acpi: Convert to use acpi_match_video_device_handle() helper Date: Fri, 1 Jul 2022 00:28:19 +0300 Message-Id: <20220630212819.42958-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220630212819.42958-1-andriy.shevchenko@linux.intel.com> References: <20220630212819.42958-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Replace open coded variant of acpi_match_video_device_handle() helper. Signed-off-by: Andy Shevchenko --- drivers/platform/x86/thinkpad_acpi.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index 22d4e8633e30..624cb9436522 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -748,9 +748,7 @@ static acpi_status __init tpacpi_acpi_handle_locate_callback(acpi_handle handle, u32 level, void *context, void **return_value) { if (!strcmp(context, "video")) { - struct acpi_device *dev = acpi_fetch_acpi_dev(handle); - - if (!dev || strcmp(ACPI_VIDEO_HID, acpi_device_hid(dev))) + if (!acpi_match_video_device_handle(handle)) return AE_OK; }