From patchwork Fri Jun 6 15:52:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 31496 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0B891202DA for ; Fri, 6 Jun 2014 15:53:00 +0000 (UTC) Received: by mail-wi0-f199.google.com with SMTP id cc10sf1356728wib.6 for ; Fri, 06 Jun 2014 08:53:00 -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:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=u4ksBTwaCd2S0o6izwQk7htQ5cYQg0FhgmiefEO9vRk=; b=NIEZsEbU9MnFcgL9Fv29Z6sjyF04rqpTb3+5gbkRvK8rbKnJTaowfXZZ7Z7TuiZ9WL MgdSs3Yhf7AdwFSGqr6ecrGAPHdBEllsWThkFYzJmcoiJ/oVEVGyk+HSUKZvNnez51mv XsUs8xWsNubviD9raRbecn7AVklQ04vKT6jzS7Q4tqN7O0b6FVOOaEPsnCZk79AMuq6i 921FBbm8EBRXZqX7BlChcp67WVsysn9UHjQMxaKFQ6QSNDMWP2kiBVE/Kp8irlaJXVmV 4/26ge0MMFsodTJZYFip1d+nwJi2Iv0wo750/aiyOWNSzGATJHzfZDT+INJYW8ijZYl6 JCZA== X-Gm-Message-State: ALoCoQmyVSDdC7Q+Rm37JYQ4HCiMpm7oFzWLX0IHpLQIp4D7w8qmf3MaDQcmYuYA6fZDkFeccliW X-Received: by 10.112.155.67 with SMTP id vu3mr1605076lbb.9.1402069980048; Fri, 06 Jun 2014 08:53:00 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.82.37 with SMTP id g34ls694251qgd.64.gmail; Fri, 06 Jun 2014 08:52:59 -0700 (PDT) X-Received: by 10.52.191.68 with SMTP id gw4mr5316875vdc.65.1402069979885; Fri, 06 Jun 2014 08:52:59 -0700 (PDT) Received: from mail-ve0-f177.google.com (mail-ve0-f177.google.com [209.85.128.177]) by mx.google.com with ESMTPS id uk3si6665400vec.102.2014.06.06.08.52.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 06 Jun 2014 08:52:59 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.177 as permitted sender) client-ip=209.85.128.177; Received: by mail-ve0-f177.google.com with SMTP id db11so3382969veb.22 for ; Fri, 06 Jun 2014 08:52:59 -0700 (PDT) X-Received: by 10.220.44.141 with SMTP id a13mr4194115vcf.71.1402069979801; Fri, 06 Jun 2014 08:52:59 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.221.54.6 with SMTP id vs6csp115256vcb; Fri, 6 Jun 2014 08:52:59 -0700 (PDT) X-Received: by 10.51.17.66 with SMTP id gc2mr10288102igd.5.1402069979011; Fri, 06 Jun 2014 08:52:59 -0700 (PDT) Received: from mail-ie0-f174.google.com (mail-ie0-f174.google.com [209.85.223.174]) by mx.google.com with ESMTPS id y3si19038664icx.27.2014.06.06.08.52.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 06 Jun 2014 08:52:59 -0700 (PDT) Received-SPF: pass (google.com: domain of lee.jones@linaro.org designates 209.85.223.174 as permitted sender) client-ip=209.85.223.174; Received: by mail-ie0-f174.google.com with SMTP id at1so291813iec.33 for ; Fri, 06 Jun 2014 08:52:58 -0700 (PDT) X-Received: by 10.50.4.5 with SMTP id g5mr7465922igg.14.1402069978716; Fri, 06 Jun 2014 08:52:58 -0700 (PDT) Received: from localhost.localdomain (host86-181-29-77.range86-181.btcentralplus.com. [86.181.29.77]) by mx.google.com with ESMTPSA id j1sm27388094ige.0.2014.06.06.08.52.56 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 06 Jun 2014 08:52:58 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: wsa@the-dreams.de, grant.likely@linaro.org, linus.walleij@linaro.org, linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, Lee Jones Subject: [PATCH 5/9] i2c: Export i2c_match_id() for direct use by device drivers Date: Fri, 6 Jun 2014 16:52:28 +0100 Message-Id: <1402069952-28022-6-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1402069952-28022-1-git-send-email-lee.jones@linaro.org> References: <1402069952-28022-1-git-send-email-lee.jones@linaro.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.128.177 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: 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. 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 3507087..3fe8232 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c @@ -79,7 +79,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)) @@ -92,6 +92,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 ab5866f..9d36f86 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) {