From patchwork Wed Jun 5 15:13:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suzuki K Poulose X-Patchwork-Id: 165889 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp7484956ili; Wed, 5 Jun 2019 08:14:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqxi9rh520C3LVhqxxIW6csgvHSS8DS/3aJa4kN83Y57gcGw19/M8TNm9J5rXsvUE/v1ayw8 X-Received: by 2002:a62:ee05:: with SMTP id e5mr45809121pfi.117.1559747662149; Wed, 05 Jun 2019 08:14:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559747662; cv=none; d=google.com; s=arc-20160816; b=B3NpoMhgzXYW21SrcE6MeUXA3Dcy0xu48PLRp0xH2DHD29itsCTIoujrGc2tIy3hlr PsPNHJnGloDjNvmJ7L+aW6B1L0fH0jkea7m1sUI1kvd/f+Cbb+HYhii88hYj4Sx7369T h1P00xNsjllW+moCuPSIwzBD8nrmC0c97XrAuelttf/SA6yXRsLHQ+zxnMreFha88hId WU+UJaPKcn8810v0IT9gT3D6sSVKuW4iqIjk5QyUQ1wtK+BguGvhvfOkQqlz/yIJIhsU V/sS67O1Nzhd2hpfqRcJEJWiCdUWuSFsqFRBLFcgqBsh2XLXyjvPzfJch0Fx7uzilG7j UGwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=PXiBT4Hh+CreXS1bJ8IAiefA24p/5IF1nUCjW9GFqgQ=; b=nJubdPVr/fWkyaSSBKIfp/o3wIg+UMGeFn8DMnMVt+BcoMm5jtBnzdJXdTkFUe9yRv b4AFvKeTDaK2UuE3LuI4moyWenujIfezw8L1l8cL0b6H4EO+ROuQrzOKd8QQKddulnaX dWC5aNIDGBwDacM/d7pZVf2oywu7mRH2aRixCZ9fPaJvhSTF3ktMhJ2tBMKcTRS2W3IQ 16GAAlgNYOXTlY/fTXNREM2qcycMKGAIBsSAq5qWeESZX5CnPun33qPCfs4k/IKhm4bF ge0dNQQg44sqoja5KKKXLneu8K2f77atBlXpWZeS9K07XVJjeckZruYxpOk9D/vPYZoI pMcg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-acpi-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 5si11948261pgt.261.2019.06.05.08.14.20; Wed, 05 Jun 2019 08:14:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-acpi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728107AbfFEPOU (ORCPT + 9 others); Wed, 5 Jun 2019 11:14:20 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:33296 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728201AbfFEPOU (ORCPT ); Wed, 5 Jun 2019 11:14:20 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 092F715BF; Wed, 5 Jun 2019 08:14:20 -0700 (PDT) Received: from en101.cambridge.arm.com (en101.cambridge.arm.com [10.1.196.93]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id A68023F246; Wed, 5 Jun 2019 08:14:18 -0700 (PDT) From: Suzuki K Poulose To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, rafael@kernel.org, suzuki.poulose@arm.com, "Rafael J. Wysocki" , Len Brown , linux-acpi@vger.kernel.org Subject: [PATCH 01/13] acpi: utils: Cleanup acpi_dev_match_cb Date: Wed, 5 Jun 2019 16:13:38 +0100 Message-Id: <1559747630-28065-2-git-send-email-suzuki.poulose@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1559747630-28065-1-git-send-email-suzuki.poulose@arm.com> References: <1559747630-28065-1-git-send-email-suzuki.poulose@arm.com> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org acpi_dev_match_cb match function modifies the "data" argument to pass on a result which could be easily deduced from the result of the bus_find_device() call at the caller site. Clean this up in preparation to convert the "match" argument for bus_find_device to accept a "const" data pointer, similar to class_find_device. This would allow consolidating the match routines for these two APIs. Cc: "Rafael J. Wysocki" Cc: Len Brown Cc: linux-acpi@vger.kernel.org Signed-off-by: Suzuki K Poulose --- drivers/acpi/utils.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) -- 2.7.4 diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c index 7def63a..1391b63 100644 --- a/drivers/acpi/utils.c +++ b/drivers/acpi/utils.c @@ -725,8 +725,6 @@ bool acpi_dev_found(const char *hid) EXPORT_SYMBOL(acpi_dev_found); struct acpi_dev_match_info { - const char *dev_name; - struct acpi_device *adev; struct acpi_device_id hid[2]; const char *uid; s64 hrv; @@ -746,9 +744,6 @@ static int acpi_dev_match_cb(struct device *dev, void *data) strcmp(adev->pnp.unique_id, match->uid))) return 0; - match->dev_name = acpi_dev_name(adev); - match->adev = adev; - if (match->hrv == -1) return 1; @@ -818,7 +813,7 @@ acpi_dev_get_first_match_dev(const char *hid, const char *uid, s64 hrv) match.hrv = hrv; dev = bus_find_device(&acpi_bus_type, NULL, &match, acpi_dev_match_cb); - return dev ? match.adev : NULL; + return dev ? to_acpi_device(dev) : NULL; } EXPORT_SYMBOL(acpi_dev_get_first_match_dev);