From patchwork Thu Mar 9 22:16:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 9614227 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 307FE60417 for ; Thu, 9 Mar 2017 22:17:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1C75F28543 for ; Thu, 9 Mar 2017 22:17:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0D81A2856A; Thu, 9 Mar 2017 22:17:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ACB0828543 for ; Thu, 9 Mar 2017 22:17:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753873AbdCIWRG (ORCPT ); Thu, 9 Mar 2017 17:17:06 -0500 Received: from mail-pf0-f196.google.com ([209.85.192.196]:33869 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751657AbdCIWRF (ORCPT ); Thu, 9 Mar 2017 17:17:05 -0500 Received: by mail-pf0-f196.google.com with SMTP id o126so8597782pfb.1; Thu, 09 Mar 2017 14:16:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=WC/wErNTst1cWDkOaa6DZ8SanY3WFholKC2rprAHP4s=; b=dMd572jdz9PnPoK3VkzyALlDJHNogrjD3/LLQNLEXszG98YrH4p3GHGGWphGPOJCwW YiNB716pLfRsD8X6mw+IXqFNlw2fa4oYidwshyW1mJ8RVN2K4OADFeSMC8OZHtvio1At dzBNxTKbVqhTjmnxboi5oBoZAqln/sYVXEQoZI8du8VBErRrzbdi8Qv0MkxWwQCkOCfB fnFZTqnIz3i0fa1SNN0MOLaHiL//zrygSSVdhWdtEZv5moqALTEgqwsnryfA3+rZgV6H vfLpzVGKdKYzznWC2wKhUt8jWsfaR1nCOwgCseaoWfeazL/Y0UwFJ69yeU4/dC5yPzZj xwlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=WC/wErNTst1cWDkOaa6DZ8SanY3WFholKC2rprAHP4s=; b=EbI2iRS0AjNaEnivDQzDWM585SCcJPiFf/bWINFeR8BTTqPcqXcqb5jsDuerWM+kAh bwc+ZLe5ljYt6SOb9ithbDVqaAOKDLpzrWfnJJdc8PxsSlRvYD3vo2ZT7LAA2yMxlH8B uqMl1fZsyo84oLIoqErN9P9dnWKTaAKvKHsmUBVIEycwuk9WSHwIXti789mYaduZhZGM EbZ8yT7gKqmB/RSggrUny459+isRqFdM/2AnKZMAcqUq7o4tu74t5iFKTGbfYuHaP7pf toB5kCNOOqbik1gMA7roUorN661+pWKL11Mq5O3k8WElce3K+3b1DFIof17xOSAQ3jbO /R4g== X-Gm-Message-State: AMke39nyjT9NL+eWoLciKinyWELtlx745nG/wJAtlAlsf449A1Xj48wAjoWpBjp7ibozHg== X-Received: by 10.84.225.22 with SMTP id t22mr20476241plj.14.1489097807934; Thu, 09 Mar 2017 14:16:47 -0800 (PST) Received: from dtor-ws.mtv.corp.google.com ([172.22.152.34]) by smtp.gmail.com with ESMTPSA id 15sm14439676pgh.21.2017.03.09.14.16.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 09 Mar 2017 14:16:47 -0800 (PST) From: Dmitry Torokhov To: Benjamin Tissoires , Wolfram Sang Cc: Andrew Duggan , linux-kernel@vger.kernel.org, linux-input@vger.kernel.org Subject: [PATCH 1/8] i2c: export i2c_client_type structure Date: Thu, 9 Mar 2017 14:16:37 -0800 Message-Id: <20170309221644.17035-2-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.12.0.246.ga2ecc84866-goog In-Reply-To: <20170309221644.17035-1-dmitry.torokhov@gmail.com> References: <20170309221644.17035-1-dmitry.torokhov@gmail.com> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP i2c bus has 2 different types of device belonging to the same bus and bus notifiers use device type to distinguish between adapters and clients. Previously we only had i2c_adapter_type exported, which made code wanting to work with i2c_client devices test for type not equal to adapter type. This unfortunately is not safe if we ever add another type to the bus, so let's export i2c_client_type as well. Signed-off-by: Dmitry Torokhov Reviewed-by: Jean Delvare Reviewed-by: Wolfram Sang --- Wolfram, this is the patch I was talking about in the other mail. drivers/i2c/i2c-core.c | 4 ++-- include/linux/i2c.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 34a5115484dd..446e341e9508 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c @@ -74,7 +74,6 @@ static DEFINE_MUTEX(core_lock); static DEFINE_IDR(i2c_adapter_idr); -static struct device_type i2c_client_type; static int i2c_detect(struct i2c_adapter *adapter, struct i2c_driver *driver); static struct static_key i2c_trace_msg = STATIC_KEY_INIT_FALSE; @@ -1096,11 +1095,12 @@ struct bus_type i2c_bus_type = { }; EXPORT_SYMBOL_GPL(i2c_bus_type); -static struct device_type i2c_client_type = { +struct device_type i2c_client_type = { .groups = i2c_dev_groups, .uevent = i2c_device_uevent, .release = i2c_client_dev_release, }; +EXPORT_SYMBOL_GPL(i2c_client_type); /** diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 2cc3988d127b..89ca5e56b433 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -37,6 +37,7 @@ extern struct bus_type i2c_bus_type; extern struct device_type i2c_adapter_type; +extern struct device_type i2c_client_type; /* --- General options ------------------------------------------------ */