From patchwork Mon Mar 20 00:22:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 9632957 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 D88A360249 for ; Mon, 20 Mar 2017 00:25:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CAC8927FA0 for ; Mon, 20 Mar 2017 00:25:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BE26C2807E; Mon, 20 Mar 2017 00:25:00 +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 6ADFA27FA0 for ; Mon, 20 Mar 2017 00:25:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752821AbdCTAYl (ORCPT ); Sun, 19 Mar 2017 20:24:41 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:35431 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752279AbdCTAWg (ORCPT ); Sun, 19 Mar 2017 20:22:36 -0400 Received: by mail-pg0-f65.google.com with SMTP id g2so17178709pge.2; Sun, 19 Mar 2017 17:22:35 -0700 (PDT) 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=z5iz4mJVtNThILx/yvszphnenaJy2O3KwJpxpGHqhFc=; b=hqdpCRrmT+Lw0k7GMaL4hww3sVEGbqX+fpZG5M2X2hGkR1pVb3FNnLitrPwwT6mHlX EdoMEpfuZZ3I8BEy71129J+pYOFwz8RSmiyxJ6oCFq8kNB2xibvNiQajDPIHAgPFk4ZA 1qArl2XGDv3WJjn3McHte14u1POGZURwZr9WuOgf5p0AREJnEwviwnab1lVrIgleBEbV 2TObeYMz11rjHN3Qq1grf1BpDK6ZqZHeESBNCDyjrcjsTTpO/dBk0CZDWssYAdAvTUGe vvNIa+WYbUlS/61UDeuNUqTBmC2kddx5NgAIbLT5e9WDrzF+KtyaP4azd38JUTazEDUW mtIA== 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=z5iz4mJVtNThILx/yvszphnenaJy2O3KwJpxpGHqhFc=; b=ZsAMLZonumid112Uz1OYpfu9w+00r9ZD1HPxMEvfX/kcWwxVJTLOQNda0vJdQNR0EY YWK/GUxXZmRUiIo70kYgI9gKLVoqRgGko7hVzgxQjh/7ywLB8IOxHfFH/smvOpP+HTB2 wFj6ouFaTbo2/VS4GkQyAcFZJ4TsAgnltWmR4wjy74RD6ZZLc8DgpDgPDlaCdWDEysPu hb6nEvRElIs6RkGfTQgjgRVEiulprFGUtanci7usRu2y3FGtMpIPum0jXGXuv9YrYs3I QD9Diju88/VGXbM3RwcWMvO4kEpkGmg1TvVUgxmo4BXafFWZ/pAl+uzvx8+OFRfihFPU 50cg== X-Gm-Message-State: AFeK/H2zyntzBGUZhvX+qPgfTXaV8YBdq5f2FgP35X2cofUEO8ng+1rNy4BoDk+ZVF8Pcw== X-Received: by 10.98.80.93 with SMTP id e90mr30665254pfb.7.1489969354761; Sun, 19 Mar 2017 17:22:34 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([172.22.152.34]) by smtp.gmail.com with ESMTPSA id n185sm29134460pga.9.2017.03.19.17.22.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 19 Mar 2017 17:22:34 -0700 (PDT) From: Dmitry Torokhov To: Benjamin Tissoires Cc: Andrew Duggan , linux-kernel@vger.kernel.org, linux-input@vger.kernel.org Subject: [PATCH v3 1/9] i2c: export i2c_client_type structure Date: Sun, 19 Mar 2017 17:22:23 -0700 Message-Id: <20170320002231.31152-2-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.12.0.367.g23dc2f6d3c-goog In-Reply-To: <20170320002231.31152-1-dmitry.torokhov@gmail.com> References: <20170320002231.31152-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. Reviewed-by: Jean Delvare Acked-by: Benjamin Tissoires Signed-off-by: Dmitry Torokhov --- 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 ------------------------------------------------ */