Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3521577rwb; Tue, 16 Aug 2022 04:43:24 -0700 (PDT) X-Google-Smtp-Source: AA6agR7PIDq3lblrDMkvv9Wq6MhzdCRjABpfdcJRGAqUQgbYF1y8ZnNtmBF/JIBXM5hdMgKnBOSe X-Received: by 2002:a17:907:a047:b0:730:e4e7:5127 with SMTP id gz7-20020a170907a04700b00730e4e75127mr13444368ejc.707.1660650203965; Tue, 16 Aug 2022 04:43:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660650203; cv=none; d=google.com; s=arc-20160816; b=zo3hx4c1OCFlb3YKqdN3W08uwFewoJqhJqzw1DyV5Mnsf0Mr/HfXDSCXuM/a38Htzd dlIbVlxVOko/yr6okHX3sx9hGJeXOGrzF+LfTfv5u8vT3Px5iG23e28xBWuL2yrDAuYY e7jnGovLRptJAOZQVtRGDOWol7GdDFhjXlye8hA06rCGUZXMfEqGrB7WGMWT54g4cBM3 SpQb41SizYbizVdK3axBOOpqkcoMQS8icye9nPmSxlh6aJPbERY3bvNMv7J8URdEx/AT gSE/Jct1cToChIhwaGFCc1CLUBWoah2jM8DxVoIUTJ02QxMIAPKt7TTJCLIU9ESq5Qm9 0dfg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=+lilgPB1rWEzNkmwQ7hPeCaPo603JChHGoh/FvQEkbs=; b=r5gfAhq0ZvB94gNw/YINV6XcZwC5Vy2jbP7kCBoeWjZgGDqfQhSf/1bwgJwEqtjLPv zGj7I8R7uwsE7pxlfYhess3lmejCW3eTjQlM/EjeQmui/zo3yqeEuoBtNrUEX/hMqjTl ZlLWycjqbyTPkWcvh1tYW6/WfSg39nAj05XWdR7Do/5UESO9evNi8drYCZbWSnHclwwJ yC8INV2/JZa+ijrZG6trsItJ4a0mb16/jmrfhc/yOkBPf6FQ6fYSwBeKVdgRxaqtgXeV 2Q1iR4nssXfoiFc55iSb9oW9uSJX+j9DkuWpkKVG++deLQinWuaA10Xn0B4ov/ojJb7Z 054w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=bMo8Xr+k; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i24-20020a1709067a5800b0072efd2ebeecsi11509754ejo.785.2022.08.16.04.42.57; Tue, 16 Aug 2022 04:43:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=bMo8Xr+k; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235349AbiHPLJO (ORCPT + 99 others); Tue, 16 Aug 2022 07:09:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235232AbiHPLIk (ORCPT ); Tue, 16 Aug 2022 07:08:40 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 752DBD398E; Tue, 16 Aug 2022 03:16:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1660644997; x=1692180997; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=EtlYtiwteZxWDMzq7m+ATAtdiv2Skwb0e3zLFg2zc58=; b=bMo8Xr+kIfXW+5F6mupDnNVk8P8Wy2KWATOdiKWlvf9r+W+bgzwbtfeV SRDVfv62gmt8MiUPymnvvswcp+1B4eSnzLs4I26JbCrrLrP5n6/xM0k9O fIJyyXmwig+pWbsOdcqPsnvQDSQ2UHSQ08HdS9+01j22Je6XIv1YRCapT dtBZJlR7I9ilczx5aWzUcDzqOLAr9ZWPKSbC5ldAYwISi+7UAUGm5oAin 3yJjVgjpHgAHcaODYTIh6Oc1Cppc9/dhF01AarbHDx/MM8fEUFSA0EV3J JbdKt484r6Lz475NFCgbLrKkgKbbRxaBazoSWYVBDeIVCirU1Jrd+9mNe w==; X-IronPort-AV: E=McAfee;i="6400,9594,10440"; a="279141302" X-IronPort-AV: E=Sophos;i="5.93,240,1654585200"; d="scan'208";a="279141302" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Aug 2022 03:16:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,240,1654585200"; d="scan'208";a="749260795" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 16 Aug 2022 03:16:31 -0700 From: Heikki Krogerus To: "Rafael J. Wysocki" , Greg Kroah-Hartman Cc: Utkarsh Patel , rajmohan.mani@intel.com, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Subject: [PATCH 6/6] usb: typec: intel_pmc_mux: Use the helper acpi_dev_get_memory_resources() Date: Tue, 16 Aug 2022 13:16:29 +0300 Message-Id: <20220816101629.69054-7-heikki.krogerus@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220816101629.69054-1-heikki.krogerus@linux.intel.com> References: <20220816101629.69054-1-heikki.krogerus@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE 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 It removes the need to check the resource data type separately. Signed-off-by: Heikki Krogerus --- drivers/usb/typec/mux/intel_pmc_mux.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/usb/typec/mux/intel_pmc_mux.c b/drivers/usb/typec/mux/intel_pmc_mux.c index a8e273fe204ab..e1f4df7238bf4 100644 --- a/drivers/usb/typec/mux/intel_pmc_mux.c +++ b/drivers/usb/typec/mux/intel_pmc_mux.c @@ -569,15 +569,6 @@ static int pmc_usb_register_port(struct pmc_usb *pmc, int index, return ret; } -static int is_memory(struct acpi_resource *res, void *data) -{ - struct resource_win win = {}; - struct resource *r = &win.res; - - return !(acpi_dev_resource_memory(res, r) || - acpi_dev_resource_address_space(res, &win)); -} - /* IOM ACPI IDs and IOM_PORT_STATUS_OFFSET */ static const struct acpi_device_id iom_acpi_ids[] = { /* TigerLake */ @@ -611,7 +602,7 @@ static int pmc_usb_probe_iom(struct pmc_usb *pmc) return -ENODEV; INIT_LIST_HEAD(&resource_list); - ret = acpi_dev_get_resources(adev, &resource_list, is_memory, NULL); + ret = acpi_dev_get_memory_resources(adev, &resource_list); if (ret < 0) return ret; -- 2.35.1