All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Utkarsh Patel <utkarsh.h.patel@intel.com>,
	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	[thread overview]
Message-ID: <20220816101629.69054-7-heikki.krogerus@linux.intel.com> (raw)
In-Reply-To: <20220816101629.69054-1-heikki.krogerus@linux.intel.com>

It removes the need to check the resource data type
separately.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
---
 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


  parent reply	other threads:[~2022-08-16 11:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-16 10:16 [PATCH 0/6] ACPI: New helper function acpi_dev_get_memory_resources() and a new ACPI ID Heikki Krogerus
2022-08-16 10:16 ` [PATCH 1/6] usb: typec: intel_pmc_mux: Add new ACPI ID for Meteor Lake IOM device Heikki Krogerus
2022-08-16 10:16 ` [PATCH 2/6] ACPI: resource: Filter out the non memory resources in is_memory() Heikki Krogerus
2022-08-16 10:16 ` [PATCH 3/6] ACPI: resource: Add helper function acpi_dev_get_memory_resources() Heikki Krogerus
2022-08-16 10:16 ` [PATCH 4/6] ACPI: APD: Use the helper acpi_dev_get_memory_resources() Heikki Krogerus
2022-08-16 10:16 ` [PATCH 5/6] ACPI: LPSS: " Heikki Krogerus
2022-08-16 10:16 ` Heikki Krogerus [this message]
2022-08-18 19:12 ` [PATCH 0/6] ACPI: New helper function acpi_dev_get_memory_resources() and a new ACPI ID Greg Kroah-Hartman
2022-08-19 10:02   ` Heikki Krogerus
2022-08-19 10:33     ` Greg Kroah-Hartman
2022-08-20 11:25       ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220816101629.69054-7-heikki.krogerus@linux.intel.com \
    --to=heikki.krogerus@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=rajmohan.mani@intel.com \
    --cc=utkarsh.h.patel@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.