From patchwork Tue Sep 24 12:01:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 11158579 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 719E218A6 for ; Tue, 24 Sep 2019 12:02:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 593C121655 for ; Tue, 24 Sep 2019 12:02:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2504822AbfIXMB7 (ORCPT ); Tue, 24 Sep 2019 08:01:59 -0400 Received: from mga02.intel.com ([134.134.136.20]:50789 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2504819AbfIXMB7 (ORCPT ); Tue, 24 Sep 2019 08:01:59 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Sep 2019 05:01:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,544,1559545200"; d="scan'208";a="179460795" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga007.jf.intel.com with ESMTP; 24 Sep 2019 05:01:55 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 3CD28228; Tue, 24 Sep 2019 15:01:54 +0300 (EEST) From: Andy Shevchenko To: Joerg Roedel , iommu@lists.linux-foundation.org, Adrian Hunter , Ulf Hansson , linux-mmc@vger.kernel.org, "Rafael J. Wysocki" , linux-acpi@vger.kernel.org Cc: Andy Shevchenko Subject: [PATCH v1 1/5] ACPI / utils: Describe function parameters in kernel-doc Date: Tue, 24 Sep 2019 15:01:49 +0300 Message-Id: <20190924120153.8382-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org Kernel documentation script complains that some of the function parameters are not described: drivers/acpi/utils.c:462: warning: Function parameter or member 'handle' not described in 'acpi_handle_path' drivers/acpi/utils.c:484: warning: Function parameter or member 'level' not described in 'acpi_handle_printk' drivers/acpi/utils.c:484: warning: Function parameter or member 'handle' not described in 'acpi_handle_printk' drivers/acpi/utils.c:484: warning: Function parameter or member 'fmt' not described in 'acpi_handle_printk' drivers/acpi/utils.c:513: warning: Function parameter or member 'descriptor' not described in '__acpi_handle_debug' drivers/acpi/utils.c:513: warning: Function parameter or member 'handle' not described in '__acpi_handle_debug' drivers/acpi/utils.c:513: warning: Function parameter or member 'fmt' not described in '__acpi_handle_debug' Describe function parameters where it's appropriate. Signed-off-by: Andy Shevchenko --- drivers/acpi/utils.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c index e3974a8f8fd4..dbd1c4cfd7d1 100644 --- a/drivers/acpi/utils.c +++ b/drivers/acpi/utils.c @@ -455,6 +455,7 @@ EXPORT_SYMBOL(acpi_evaluate_ost); /** * acpi_handle_path: Return the object path of handle + * @handle: ACPI device handle * * Caller must free the returned buffer */ @@ -473,6 +474,9 @@ static char *acpi_handle_path(acpi_handle handle) /** * acpi_handle_printk: Print message with ACPI prefix and object path + * @level: log level + * @handle: ACPI device handle + * @fmt: format string * * This function is called through acpi_handle_ macros and prints * a message with ACPI prefix and object path. This function acquires @@ -501,6 +505,9 @@ EXPORT_SYMBOL(acpi_handle_printk); #if defined(CONFIG_DYNAMIC_DEBUG) /** * __acpi_handle_debug: pr_debug with ACPI prefix and object path + * @descriptor: Dynamic Debug descriptor + * @handle: ACPI device handle + * @fmt: format string * * This function is called through acpi_handle_debug macro and debug * prints a message with ACPI prefix and object path. This function From patchwork Tue Sep 24 12:01:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 11158573 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BC8FF912 for ; Tue, 24 Sep 2019 12:01:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A594320872 for ; Tue, 24 Sep 2019 12:01:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2504818AbfIXMB6 (ORCPT ); Tue, 24 Sep 2019 08:01:58 -0400 Received: from mga05.intel.com ([192.55.52.43]:60527 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2504802AbfIXMB6 (ORCPT ); Tue, 24 Sep 2019 08:01:58 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Sep 2019 05:01:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,544,1559545200"; d="scan'208";a="182892414" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga008.jf.intel.com with ESMTP; 24 Sep 2019 05:01:55 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 4CE9596; Tue, 24 Sep 2019 15:01:54 +0300 (EEST) From: Andy Shevchenko To: Joerg Roedel , iommu@lists.linux-foundation.org, Adrian Hunter , Ulf Hansson , linux-mmc@vger.kernel.org, "Rafael J. Wysocki" , linux-acpi@vger.kernel.org Cc: Andy Shevchenko Subject: [PATCH v1 2/5] ACPI / utils: Introduce acpi_dev_hid_uid_match() helper Date: Tue, 24 Sep 2019 15:01:50 +0300 Message-Id: <20190924120153.8382-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190924120153.8382-1-andriy.shevchenko@linux.intel.com> References: <20190924120153.8382-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org There are users outside of ACPI realm which reimplementing the comparator function to check if the given device matches to given HID and UID. For better utilization, introduce a helper for everyone to use. Signed-off-by: Andy Shevchenko --- drivers/acpi/utils.c | 25 +++++++++++++++++++++++++ include/acpi/acpi_bus.h | 3 +++ include/linux/acpi.h | 6 ++++++ 3 files changed, 34 insertions(+) diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c index dbd1c4cfd7d1..804ac0df58ec 100644 --- a/drivers/acpi/utils.c +++ b/drivers/acpi/utils.c @@ -701,6 +701,31 @@ bool acpi_check_dsm(acpi_handle handle, const guid_t *guid, u64 rev, u64 funcs) } EXPORT_SYMBOL(acpi_check_dsm); +/** + * acpi_dev_hid_uid_match - Match device by supplied HID and UID + * @adev: ACPI device to match. + * @hid2: Hardware ID of the device. + * @uid2: Unique ID of the device, pass NULL to not check _UID. + * + * Matches HID and UID in @adev with given @hid2 and @uid2. + * Returns true if matches. + */ +bool acpi_dev_hid_uid_match(struct acpi_device *adev, + const char *hid2, const char *uid2) +{ + const char *hid1 = acpi_device_hid(adev); + const char *uid1 = acpi_device_uid(adev); + + if (strcmp(hid1, hid2)) + return false; + + if (!uid2) + return true; + + return uid1 && !strcmp(uid1, uid2); +} +EXPORT_SYMBOL(acpi_dev_hid_uid_match); + /** * acpi_dev_found - Detect presence of a given ACPI device in the namespace. * @hid: Hardware ID of the device. diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 175f7b40c585..d3cc8a786065 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -75,6 +75,9 @@ acpi_evaluate_dsm_typed(acpi_handle handle, const guid_t *guid, u64 rev, .package.elements = (eles) \ } +bool acpi_dev_hid_uid_match(struct acpi_device *adev, + const char *hid2, const char *uid2); + bool acpi_dev_found(const char *hid); bool acpi_dev_present(const char *hid, const char *uid, s64 hrv); diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 9426b9aaed86..272b51a4f385 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -662,6 +662,12 @@ static inline u64 acpi_arch_get_root_pointer(void) struct fwnode_handle; +static inline bool acpi_dev_hid_uid_match(struct acpi_device *adev, + const char *hid2, const char *uid2) +{ + return false; +} + static inline bool acpi_dev_found(const char *hid) { return false; From patchwork Tue Sep 24 12:01:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 11158575 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0482D1800 for ; Tue, 24 Sep 2019 12:02:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D53892168B for ; Tue, 24 Sep 2019 12:01:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2504821AbfIXMB7 (ORCPT ); Tue, 24 Sep 2019 08:01:59 -0400 Received: from mga02.intel.com ([134.134.136.20]:50789 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2504802AbfIXMB7 (ORCPT ); Tue, 24 Sep 2019 08:01:59 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Sep 2019 05:01:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,544,1559545200"; d="scan'208";a="189345627" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga007.fm.intel.com with ESMTP; 24 Sep 2019 05:01:55 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 56FE731F; Tue, 24 Sep 2019 15:01:54 +0300 (EEST) From: Andy Shevchenko To: Joerg Roedel , iommu@lists.linux-foundation.org, Adrian Hunter , Ulf Hansson , linux-mmc@vger.kernel.org, "Rafael J. Wysocki" , linux-acpi@vger.kernel.org Cc: Andy Shevchenko Subject: [PATCH v1 3/5] ACPI / LPSS: Switch to use acpi_dev_hid_uid_match() Date: Tue, 24 Sep 2019 15:01:51 +0300 Message-Id: <20190924120153.8382-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190924120153.8382-1-andriy.shevchenko@linux.intel.com> References: <20190924120153.8382-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org Since we have a generic helper, drop custom implementation in the driver. Signed-off-by: Andy Shevchenko --- drivers/acpi/acpi_lpss.c | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c index d696f165a50e..1e6d959bd968 100644 --- a/drivers/acpi/acpi_lpss.c +++ b/drivers/acpi/acpi_lpss.c @@ -476,31 +476,16 @@ static const struct lpss_device_links lpss_device_links[] = { {"80860F41", "5", "LNXVIDEO", NULL, DL_FLAG_PM_RUNTIME}, }; -static bool hid_uid_match(struct acpi_device *adev, - const char *hid2, const char *uid2) -{ - const char *hid1 = acpi_device_hid(adev); - const char *uid1 = acpi_device_uid(adev); - - if (strcmp(hid1, hid2)) - return false; - - if (!uid2) - return true; - - return uid1 && !strcmp(uid1, uid2); -} - static bool acpi_lpss_is_supplier(struct acpi_device *adev, const struct lpss_device_links *link) { - return hid_uid_match(adev, link->supplier_hid, link->supplier_uid); + return acpi_dev_hid_uid_match(adev, link->supplier_hid, link->supplier_uid); } static bool acpi_lpss_is_consumer(struct acpi_device *adev, const struct lpss_device_links *link) { - return hid_uid_match(adev, link->consumer_hid, link->consumer_uid); + return acpi_dev_hid_uid_match(adev, link->consumer_hid, link->consumer_uid); } struct hid_uid { @@ -516,7 +501,7 @@ static int match_hid_uid(struct device *dev, const void *data) if (!adev) return 0; - return hid_uid_match(adev, id->hid, id->uid); + return acpi_dev_hid_uid_match(adev, id->hid, id->uid); } static struct device *acpi_lpss_find_device(const char *hid, const char *uid) From patchwork Tue Sep 24 12:01:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 11158585 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1CF041800 for ; Tue, 24 Sep 2019 12:02:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 060A821655 for ; Tue, 24 Sep 2019 12:02:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2504824AbfIXMCA (ORCPT ); Tue, 24 Sep 2019 08:02:00 -0400 Received: from mga12.intel.com ([192.55.52.136]:40668 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2504814AbfIXMB7 (ORCPT ); Tue, 24 Sep 2019 08:01:59 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Sep 2019 05:01:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,544,1559545200"; d="scan'208";a="389834451" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga006.fm.intel.com with ESMTP; 24 Sep 2019 05:01:55 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 6705C338; Tue, 24 Sep 2019 15:01:54 +0300 (EEST) From: Andy Shevchenko To: Joerg Roedel , iommu@lists.linux-foundation.org, Adrian Hunter , Ulf Hansson , linux-mmc@vger.kernel.org, "Rafael J. Wysocki" , linux-acpi@vger.kernel.org Cc: Andy Shevchenko Subject: [PATCH v1 4/5] mmc: sdhci-acpi: Switch to use acpi_dev_hid_uid_match() Date: Tue, 24 Sep 2019 15:01:52 +0300 Message-Id: <20190924120153.8382-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190924120153.8382-1-andriy.shevchenko@linux.intel.com> References: <20190924120153.8382-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org Since we have a generic helper, drop custom implementation in the driver. Signed-off-by: Andy Shevchenko --- drivers/mmc/host/sdhci-acpi.c | 49 ++++++++++++----------------------- 1 file changed, 16 insertions(+), 33 deletions(-) diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c index 1604f512c7bd..f913c3f57bbf 100644 --- a/drivers/mmc/host/sdhci-acpi.c +++ b/drivers/mmc/host/sdhci-acpi.c @@ -61,7 +61,7 @@ struct sdhci_acpi_slot { mmc_pm_flag_t pm_caps; unsigned int flags; size_t priv_size; - int (*probe_slot)(struct platform_device *, const char *, const char *); + int (*probe_slot)(struct platform_device *, struct acpi_device *); int (*remove_slot)(struct platform_device *); int (*free_slot)(struct platform_device *pdev); int (*setup_host)(struct platform_device *pdev); @@ -325,12 +325,10 @@ static bool sdhci_acpi_cht_pci_wifi(unsigned int vendor, unsigned int device, * wifi card in the expected slot with an ACPI companion node, is used to * indicate that acpi_device_fix_up_power() should be avoided. */ -static inline bool sdhci_acpi_no_fixup_child_power(const char *hid, - const char *uid) +static inline bool sdhci_acpi_no_fixup_child_power(struct acpi_device *adev) { return sdhci_acpi_cht() && - !strcmp(hid, "80860F14") && - !strcmp(uid, "2") && + acpi_dev_hid_uid_match(adev, "80860F14", "2") && sdhci_acpi_cht_pci_wifi(0x14e4, 0x43ec, 0, 28); } @@ -345,8 +343,7 @@ static inline bool sdhci_acpi_byt_defer(struct device *dev) return false; } -static inline bool sdhci_acpi_no_fixup_child_power(const char *hid, - const char *uid) +static inline bool sdhci_acpi_no_fixup_child_power(struct acpi_device *adev) { return false; } @@ -375,19 +372,18 @@ static int bxt_get_cd(struct mmc_host *mmc) return ret; } -static int intel_probe_slot(struct platform_device *pdev, const char *hid, - const char *uid) +static int intel_probe_slot(struct platform_device *pdev, struct acpi_device *adev) { struct sdhci_acpi_host *c = platform_get_drvdata(pdev); struct intel_host *intel_host = sdhci_acpi_priv(c); struct sdhci_host *host = c->host; - if (hid && uid && !strcmp(hid, "80860F14") && !strcmp(uid, "1") && + if (acpi_dev_hid_uid_match(adev, "80860F14", "1") && sdhci_readl(host, SDHCI_CAPABILITIES) == 0x446cc8b2 && sdhci_readl(host, SDHCI_CAPABILITIES_1) == 0x00000807) host->timeout_clk = 1000; /* 1000 kHz i.e. 1 MHz */ - if (hid && !strcmp(hid, "80865ACA")) + if (acpi_dev_hid_uid_match(adev, "80865ACA", NULL)) host->mmc_host_ops.get_cd = bxt_get_cd; intel_dsm_init(intel_host, &pdev->dev, host->mmc); @@ -473,8 +469,7 @@ static irqreturn_t sdhci_acpi_qcom_handler(int irq, void *ptr) return IRQ_HANDLED; } -static int qcom_probe_slot(struct platform_device *pdev, const char *hid, - const char *uid) +static int qcom_probe_slot(struct platform_device *pdev, struct acpi_device *adev) { struct sdhci_acpi_host *c = platform_get_drvdata(pdev); struct sdhci_host *host = c->host; @@ -482,7 +477,7 @@ static int qcom_probe_slot(struct platform_device *pdev, const char *hid, *irq = -EINVAL; - if (strcmp(hid, "QCOM8051")) + if (acpi_dev_hid_uid_match(adev, "QCOM8051", NULL)) return 0; *irq = platform_get_irq(pdev, 1); @@ -501,14 +496,12 @@ static int qcom_free_slot(struct platform_device *pdev) struct sdhci_host *host = c->host; struct acpi_device *adev; int *irq = sdhci_acpi_priv(c); - const char *hid; adev = ACPI_COMPANION(dev); if (!adev) return -ENODEV; - hid = acpi_device_hid(adev); - if (strcmp(hid, "QCOM8051")) + if (!acpi_dev_hid_uid_match(adev, "QCOM8051", NULL)) return 0; if (*irq < 0) @@ -583,7 +576,7 @@ static const struct sdhci_acpi_chip sdhci_acpi_chip_amd = { }; static int sdhci_acpi_emmc_amd_probe_slot(struct platform_device *pdev, - const char *hid, const char *uid) + struct acpi_device *adev) { struct sdhci_acpi_host *c = platform_get_drvdata(pdev); struct sdhci_host *host = c->host; @@ -654,17 +647,12 @@ static const struct acpi_device_id sdhci_acpi_ids[] = { }; MODULE_DEVICE_TABLE(acpi, sdhci_acpi_ids); -static const struct sdhci_acpi_slot *sdhci_acpi_get_slot(const char *hid, - const char *uid) +static const struct sdhci_acpi_slot *sdhci_acpi_get_slot(struct acpi_device *adev) { const struct sdhci_acpi_uid_slot *u; for (u = sdhci_acpi_uids; u->hid; u++) { - if (strcmp(u->hid, hid)) - continue; - if (!u->uid) - return u->slot; - if (uid && !strcmp(u->uid, uid)) + if (acpi_dev_hid_uid_match(adev, u->hid, u->uid)) return u->slot; } return NULL; @@ -680,22 +668,17 @@ static int sdhci_acpi_probe(struct platform_device *pdev) struct resource *iomem; resource_size_t len; size_t priv_size; - const char *hid; - const char *uid; int err; device = ACPI_COMPANION(dev); if (!device) return -ENODEV; - hid = acpi_device_hid(device); - uid = acpi_device_uid(device); - - slot = sdhci_acpi_get_slot(hid, uid); + slot = sdhci_acpi_get_slot(device); /* Power on the SDHCI controller and its children */ acpi_device_fix_up_power(device); - if (!sdhci_acpi_no_fixup_child_power(hid, uid)) { + if (!sdhci_acpi_no_fixup_child_power(device)) { list_for_each_entry(child, &device->children, node) if (child->status.present && child->status.enabled) acpi_device_fix_up_power(child); @@ -745,7 +728,7 @@ static int sdhci_acpi_probe(struct platform_device *pdev) if (c->slot) { if (c->slot->probe_slot) { - err = c->slot->probe_slot(pdev, hid, uid); + err = c->slot->probe_slot(pdev, device); if (err) goto err_free; } From patchwork Tue Sep 24 12:01:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 11158589 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CB1A3912 for ; Tue, 24 Sep 2019 12:02:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AA2792168B for ; Tue, 24 Sep 2019 12:02:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2504825AbfIXMCA (ORCPT ); Tue, 24 Sep 2019 08:02:00 -0400 Received: from mga02.intel.com ([134.134.136.20]:50789 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2504802AbfIXMCA (ORCPT ); Tue, 24 Sep 2019 08:02:00 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Sep 2019 05:01:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,544,1559545200"; d="scan'208";a="218602779" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga002.fm.intel.com with ESMTP; 24 Sep 2019 05:01:55 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 6CB5B320; Tue, 24 Sep 2019 15:01:54 +0300 (EEST) From: Andy Shevchenko To: Joerg Roedel , iommu@lists.linux-foundation.org, Adrian Hunter , Ulf Hansson , linux-mmc@vger.kernel.org, "Rafael J. Wysocki" , linux-acpi@vger.kernel.org Cc: Andy Shevchenko Subject: [PATCH v1 5/5] iommu/amd: Switch to use acpi_dev_hid_uid_match() Date: Tue, 24 Sep 2019 15:01:53 +0300 Message-Id: <20190924120153.8382-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190924120153.8382-1-andriy.shevchenko@linux.intel.com> References: <20190924120153.8382-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org Since we have a generic helper, drop custom implementation in the driver. Signed-off-by: Andy Shevchenko --- drivers/iommu/amd_iommu.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index 61de81965c44..bad1bcea4ea1 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c @@ -129,24 +129,11 @@ static inline int match_hid_uid(struct device *dev, struct acpihid_map_entry *entry) { struct acpi_device *adev = ACPI_COMPANION(dev); - const char *hid, *uid; if (!adev) return -ENODEV; - hid = acpi_device_hid(adev); - uid = acpi_device_uid(adev); - - if (!hid || !(*hid)) - return -ENODEV; - - if (!uid || !(*uid)) - return strcmp(hid, entry->hid); - - if (!(*entry->uid)) - return strcmp(hid, entry->hid); - - return (strcmp(hid, entry->hid) || strcmp(uid, entry->uid)); + return acpi_dev_hid_uid_match(adev, entry->hid, entry->uid) ? 0 : -ENODEV; } static inline u16 get_pci_device_id(struct device *dev)