From patchwork Fri Jun 20 12:02:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 32268 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f197.google.com (mail-ie0-f197.google.com [209.85.223.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 131F3203C2 for ; Fri, 20 Jun 2014 12:03:32 +0000 (UTC) Received: by mail-ie0-f197.google.com with SMTP id lx4sf24680549iec.8 for ; Fri, 20 Jun 2014 05:03:31 -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=nre+B5FAKOay582Mko3K4syYXMu0fkL0Vqh8GSwOjuE=; b=cp084CiMFNK0CD2QGGeONWtIxoPPcnCxaoSdlaWemSrOULKtkECWoci/c5kq/yaVxc dxR/SJVtSd4GYEdegmyBOHsZRgtJIX5F0mvqEBZu0nV6aDh9ooa7bg4wHgFwy6EOvLhM uVtfEDa25RLL4k0H1LXLJO6jVFt+DQ6bySK05r5S6Vfv7vrJSaxhWcXUbSiRJ1WnpwT9 tfMnYqlFi90DVefeymrLb+UbKhM6KCyqlozNYjzGRlp7EHu7Hn9OjVsRXEh8dSyNg/g/ Boa+A3j9jUwxvJOCh1Fw5MaMnl+XKjd5Jx3QjOVewJjaQMNTCiQdLBOecZ5pwXI987z2 1ZIA== X-Gm-Message-State: ALoCoQn4wrLk8UsMGdPs+Iy0BSipkrNXm+r23TnuvjK5wzRQY8pvUv7uTG9AVxYS6QecIfm8g5gj X-Received: by 10.50.67.37 with SMTP id k5mr1176145igt.5.1403265811574; Fri, 20 Jun 2014 05:03:31 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.42.111 with SMTP id b102ls958841qga.31.gmail; Fri, 20 Jun 2014 05:03:31 -0700 (PDT) X-Received: by 10.220.15.8 with SMTP id i8mr222033vca.45.1403265811494; Fri, 20 Jun 2014 05:03:31 -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 ui7si3863379vcb.92.2014.06.20.05.03.31 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 20 Jun 2014 05:03:31 -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 i13so3434102veh.36 for ; Fri, 20 Jun 2014 05:03:31 -0700 (PDT) X-Received: by 10.58.46.141 with SMTP id v13mr2599704vem.18.1403265811416; Fri, 20 Jun 2014 05:03:31 -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.37.5 with SMTP id tc5csp16603vcb; Fri, 20 Jun 2014 05:03:31 -0700 (PDT) X-Received: by 10.50.43.225 with SMTP id z1mr3688520igl.24.1403265810537; Fri, 20 Jun 2014 05:03:30 -0700 (PDT) Received: from mail-ie0-f170.google.com (mail-ie0-f170.google.com [209.85.223.170]) by mx.google.com with ESMTPS id r9si14454485icd.73.2014.06.20.05.03.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 20 Jun 2014 05:03:30 -0700 (PDT) Received-SPF: pass (google.com: domain of lee.jones@linaro.org designates 209.85.223.170 as permitted sender) client-ip=209.85.223.170; Received: by mail-ie0-f170.google.com with SMTP id tr6so3202626ieb.1 for ; Fri, 20 Jun 2014 05:03:30 -0700 (PDT) X-Received: by 10.50.222.5 with SMTP id qi5mr2223357igc.11.1403265810254; Fri, 20 Jun 2014 05:03:30 -0700 (PDT) Received: from localhost.localdomain (host109-148-235-194.range109-148.btcentralplus.com. [109.148.235.194]) by mx.google.com with ESMTPSA id qn5sm3890078igb.7.2014.06.20.05.03.27 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 20 Jun 2014 05:03:29 -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, linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linus.walleij@linaro.org, Lee Jones Subject: [PATCH 6/9] i2c: Export i2c_match_id() for direct use by device drivers Date: Fri, 20 Jun 2014 13:02:30 +0100 Message-Id: <1403265753-25851-8-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1403265753-25851-1-git-send-email-lee.jones@linaro.org> References: <1403265753-25851-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. 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 ff2919a..b8962e4 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 3d0350c..370905d 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) {