From patchwork Mon Jun 3 15:49:48 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: 165613 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp4644316ili; Mon, 3 Jun 2019 08:51:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqywM3f1nOnaj2dNDz1+ibkoEO0CV61ib98sCOqbFWFu2YLbGW+rwVMvMmRimsvCTeLBfGGD X-Received: by 2002:a62:2cc2:: with SMTP id s185mr31563473pfs.106.1559577094212; Mon, 03 Jun 2019 08:51:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559577094; cv=none; d=google.com; s=arc-20160816; b=xe80zwxndB9/5+5V+b8goPvOEiNU7fYBtZGH5MaMZzRHvQCR5gEygMQKCnF6TzfALw W6LYn4iYneilPNZm5jTNHta5/URwW4la4xGTPG2GKcpeoYWL74xTh6LmQtmWWvtbt/Jh GwH6kmOqK3LO5Qfew85ur90MoJw/uP+I+rU4BIDRe6D+FihfX1vHS6asc9UOhe/pie0u PWIi/aALGpWu/t0d8J3cle4QGtZxacs3TBbx0acC02hD7LCGf+fOpTDa14ly1lKZW39z B63ENAVdkQm0xTl9Kfd3zqcZy0NXD9ieX86w1zquuLmvvpV/BWgiBxLDUK4OUybMRkkG WkWQ== 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=YCFpnFtoUUSgeajGa7TQLSsvhjieitvKDxJRQh4dLJ4=; b=tkZMMFjwVj0VY5ZqMFX2EpYq2281zJ+W5cNmsEVd/ihSbGry3z9/wUAvMDLIzx7Cbc bYHXKdDkuvutDDt29eiMldhLjhK+2/nlOs8Fu56o4uck/0lfOjmONGDSZRjmvOtjsJDj bIIQr9wBmiQ48IR4YceaFZ1Ux2bC7Wj2qWa9UNsuK/w6j1tvd1w9/tbfP9FQ2QG9uuhI PmFYAaRiCkmBR35P4jOJtGQtn6XZ1bs6P2/F0eauJSlSZM/yo9bpAWAiUdrLQmJej/vp eHkyikMDVYCuz/0DACfsa2dlBvAOl3sp18AOtVZjBrIoX7ttTNTJcGwoBtLW80yhSD9X oRww== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-i2c-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-i2c-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 ch7si14962581plb.21.2019.06.03.08.51.34; Mon, 03 Jun 2019 08:51:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-i2c-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-i2c-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-i2c-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729191AbfFCPvc (ORCPT + 2 others); Mon, 3 Jun 2019 11:51:32 -0400 Received: from foss.arm.com ([217.140.101.70]:53744 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729161AbfFCPvc (ORCPT ); Mon, 3 Jun 2019 11:51:32 -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 A09931AC1; Mon, 3 Jun 2019 08:51:31 -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 40A513F246; Mon, 3 Jun 2019 08:51:30 -0700 (PDT) From: Suzuki K Poulose To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, rafael@kernel.org, suzuki.poulose@arm.com, Mika Westerberg , Wolfram Sang , linux-i2c@vger.kernel.org Subject: [RFC PATCH 22/57] drivers: i2c: Use generic helper to match device by acpi_dev Date: Mon, 3 Jun 2019 16:49:48 +0100 Message-Id: <1559577023-558-23-git-send-email-suzuki.poulose@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1559577023-558-1-git-send-email-suzuki.poulose@arm.com> References: <1559577023-558-1-git-send-email-suzuki.poulose@arm.com> Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org Switch to the generic helper to match device by acpi_dev. Cc: Mika Westerberg Cc: Wolfram Sang cc: linux-i2c@vger.kernel.org Signed-off-by: Suzuki K Poulose --- drivers/i2c/i2c-core-acpi.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) -- 2.7.4 Acked-by: Mika Westerberg diff --git a/drivers/i2c/i2c-core-acpi.c b/drivers/i2c/i2c-core-acpi.c index d840955..e28165b 100644 --- a/drivers/i2c/i2c-core-acpi.c +++ b/drivers/i2c/i2c-core-acpi.c @@ -328,11 +328,6 @@ static int i2c_acpi_find_match_adapter(struct device *dev, void *data) return ACPI_HANDLE(dev) == (acpi_handle)data; } -static int i2c_acpi_find_match_device(struct device *dev, void *data) -{ - return ACPI_COMPANION(dev) == data; -} - static struct i2c_adapter *i2c_acpi_find_adapter_by_handle(acpi_handle handle) { struct device *dev; @@ -346,8 +341,7 @@ static struct i2c_client *i2c_acpi_find_client_by_adev(struct acpi_device *adev) { struct device *dev; - dev = bus_find_device(&i2c_bus_type, NULL, adev, - i2c_acpi_find_match_device); + dev = bus_find_device(&i2c_bus_type, NULL, adev, device_match_acpi_dev); return dev ? i2c_verify_client(dev) : NULL; }