From patchwork Thu Aug 28 14:35:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 36229 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yk0-f198.google.com (mail-yk0-f198.google.com [209.85.160.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8FD6B202DD for ; Thu, 28 Aug 2014 14:37:17 +0000 (UTC) Received: by mail-yk0-f198.google.com with SMTP id q200sf5156415ykb.1 for ; Thu, 28 Aug 2014 07:37:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=3AsAr7R7SOyw21H8xwQJhltpajQcLPEq/2nfQe7lvSY=; b=SVFv05Gqm+nlj59OYtwI8k/K5opN+bMNwo2f1T8wYkUEMPG84Bt6keM8ASKUimzM3+ PtUB8sRAir25vcA0N+1cTxIiv590szINC6C5pBr+fnXE1LNMnXz0JML5egiuucy+eV/8 77344v/OsekK3ixbcI/zZlnuougNmUcgv45PuQ/S4ewwhfwse7MoQyrCg26LKQWE3/vK LGFk0KXU5PxugIRMg8FHr4ngZzEalkjSrFvDdNuk7rzEPkYFfQvno1Diu2/5dMDcOU7l 3+CgWCwFfqdG/Wfl0xCssn6u0/h/4fwN6zN+W6VrhgDP88As5e5eFYZK2CXybWRA8g25 sCPA== X-Gm-Message-State: ALoCoQkSUiP1Wl6GTSCFOomCB6qUNTbaBhXVxGMQuZWbw6iT6r3ZDNLFjTDpW3wmF1UHhuS22vvy X-Received: by 10.236.7.14 with SMTP id 14mr2061975yho.34.1409236637430; Thu, 28 Aug 2014 07:37:17 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.48.35 with SMTP id n32ls263555qga.25.gmail; Thu, 28 Aug 2014 07:37:17 -0700 (PDT) X-Received: by 10.53.9.133 with SMTP id ds5mr956273vdd.66.1409236637321; Thu, 28 Aug 2014 07:37:17 -0700 (PDT) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx.google.com with ESMTPS id rk7si3676916vcb.45.2014.08.28.07.37.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 28 Aug 2014 07:37:17 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.182 as permitted sender) client-ip=209.85.220.182; Received: by mail-vc0-f182.google.com with SMTP id im17so930714vcb.27 for ; Thu, 28 Aug 2014 07:37:17 -0700 (PDT) X-Received: by 10.52.120.51 with SMTP id kz19mr878598vdb.95.1409236637216; Thu, 28 Aug 2014 07:37:17 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.45.67 with SMTP id uj3csp246764vcb; Thu, 28 Aug 2014 07:37:16 -0700 (PDT) X-Received: by 10.68.234.37 with SMTP id ub5mr6605844pbc.34.1409236635185; Thu, 28 Aug 2014 07:37:15 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id so2si6871082pab.132.2014.08.28.07.37.14 for ; Thu, 28 Aug 2014 07:37:15 -0700 (PDT) Received-SPF: none (google.com: devicetree-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751857AbaH1OgG (ORCPT + 6 others); Thu, 28 Aug 2014 10:36:06 -0400 Received: from mail-qc0-f174.google.com ([209.85.216.174]:56974 "EHLO mail-qc0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751711AbaH1OgD (ORCPT ); Thu, 28 Aug 2014 10:36:03 -0400 Received: by mail-qc0-f174.google.com with SMTP id i17so848815qcy.19 for ; Thu, 28 Aug 2014 07:36:02 -0700 (PDT) X-Received: by 10.229.140.70 with SMTP id h6mr7221496qcu.3.1409236562726; Thu, 28 Aug 2014 07:36:02 -0700 (PDT) Received: from localhost.localdomain (host86-152-0-170.range86-152.btcentralplus.com. [86.152.0.170]) by mx.google.com with ESMTPSA id o2sm5797541qgo.17.2014.08.28.07.36.00 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 28 Aug 2014 07:36:02 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: lee.jones@linaro.org, kernel@stlinux.com, wsa@the-dreams.de, grant.likely@linaro.org, linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linus.walleij@linaro.org Subject: [PATCH 5/8] i2c: Export i2c_match_id() for direct use by device drivers Date: Thu, 28 Aug 2014 15:35:35 +0100 Message-Id: <1409236538-21274-6-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1409236538-21274-1-git-send-email-lee.jones@linaro.org> References: <1409236538-21274-1-git-send-email-lee.jones@linaro.org> Sender: devicetree-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: devicetree@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.182 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , When there was no other way to match a I2C device to driver i2c_match_id() was exclusively used. However, now there are other types of tables which are commonly supplied, matching on an i2c_device_id table is used less frequently. Instead of _always_ calling i2c_match_id() from within the framework, we only need to do so from drivers which have no other way of matching. This patch makes i2c_match_id() available to the aforementioned device drivers. Acked-by: Grant Likely Signed-off-by: Lee Jones --- drivers/i2c/i2c-core.c | 3 ++- include/linux/i2c.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index c6013cd..7c21f49 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c @@ -80,7 +80,7 @@ void i2c_transfer_trace_unreg(void) /* ------------------------------------------------------------------------- */ -static const struct i2c_device_id *i2c_match_id(const struct i2c_device_id *id, +const struct i2c_device_id *i2c_match_id(const struct i2c_device_id *id, const struct i2c_client *client) { if (!(id && client)) @@ -93,6 +93,7 @@ static const struct i2c_device_id *i2c_match_id(const struct i2c_device_id *id, } return NULL; } +EXPORT_SYMBOL_GPL(i2c_match_id); static int i2c_device_match(struct device *dev, struct device_driver *drv) { diff --git a/include/linux/i2c.h b/include/linux/i2c.h index a48eadd..79b674d 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -229,6 +229,8 @@ struct i2c_client { extern struct i2c_client *i2c_verify_client(struct device *dev); extern struct i2c_adapter *i2c_verify_adapter(struct device *dev); +extern const struct i2c_device_id *i2c_match_id(const struct i2c_device_id *id, + const struct i2c_client *client); static inline struct i2c_client *kobj_to_i2c_client(struct kobject *kobj) {