From patchwork Tue Nov 21 04:04:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phil Reid X-Patchwork-Id: 10067637 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 B90E760586 for ; Tue, 21 Nov 2017 04:05:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A264E2847A for ; Tue, 21 Nov 2017 04:05:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 97900285EA; Tue, 21 Nov 2017 04:05:15 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 41AC32858E for ; Tue, 21 Nov 2017 04:05:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752640AbdKUEFO (ORCPT ); Mon, 20 Nov 2017 23:05:14 -0500 Received: from anchovy3.45ru.net.au ([203.30.46.155]:47099 "EHLO anchovy.45ru.net.au" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752619AbdKUEFJ (ORCPT ); Mon, 20 Nov 2017 23:05:09 -0500 Received: (qmail 23069 invoked by uid 5089); 21 Nov 2017 04:05:06 -0000 Received: by simscan 1.2.0 ppid: 22922, pid: 22925, t: 0.7522s scanners: regex: 1.2.0 attach: 1.2.0 clamav: 0.88.3/m:40/d:1950 X-RBL: $rbltext Received: from unknown (HELO preid-centos7.electromag.com.au) (preid@electromag.com.au@203.59.230.133) by anchovy2.45ru.net.au with ESMTPA; 21 Nov 2017 04:05:04 -0000 Received: by preid-centos7.electromag.com.au (Postfix, from userid 1000) id E27A7335C1A8D; Tue, 21 Nov 2017 12:05:00 +0800 (AWST) From: Phil Reid To: realmz6@gmail.com, wsa@the-dreams.de, sre@kernel.org, preid@electromag.com.au, benjamin.tissoires@redhat.com, adi-buildroot-devel@lists.sourceforge.net, linux-i2c@vger.kernel.org, linux-pm@vger.kernel.org, jdelvare@suse.de Subject: [RFC 1/3] i2c: smbus: move of_i2c_setup_smbus_alert declaration to i2c-core.h Date: Tue, 21 Nov 2017 12:04:56 +0800 Message-Id: <1511237098-33250-2-git-send-email-preid@electromag.com.au> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1511237098-33250-1-git-send-email-preid@electromag.com.au> References: <1511237098-33250-1-git-send-email-preid@electromag.com.au> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This declaration isn't used by anything outside of the i2c-core at present. In preparation for moving the smbus_alert code from it's own module into the i2c-core move to i2c-core.h Signed-off-by: Phil Reid --- drivers/i2c/i2c-core.h | 9 +++++++++ drivers/i2c/i2c-smbus.c | 3 ++- include/linux/i2c-smbus.h | 10 ---------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/i2c/i2c-core.h b/drivers/i2c/i2c-core.h index 3d3d9bf..8ef0402 100644 --- a/drivers/i2c/i2c-core.h +++ b/drivers/i2c/i2c-core.h @@ -60,3 +60,12 @@ static inline void i2c_acpi_remove_space_handler(struct i2c_adapter *adapter) { static inline void of_i2c_register_devices(struct i2c_adapter *adap) { } #endif extern struct notifier_block i2c_of_notifier; + +#if IS_ENABLED(CONFIG_I2C_SMBUS) && IS_ENABLED(CONFIG_OF) +int of_i2c_setup_smbus_alert(struct i2c_adapter *adap); +#else +static inline int of_i2c_setup_smbus_alert(struct i2c_adapter *adap) +{ + return 0; +} +#endif diff --git a/drivers/i2c/i2c-smbus.c b/drivers/i2c/i2c-smbus.c index 5a1dd7f..c11a50e 100644 --- a/drivers/i2c/i2c-smbus.c +++ b/drivers/i2c/i2c-smbus.c @@ -25,6 +25,8 @@ #include #include +#include "i2c-core.h" + struct i2c_smbus_alert { struct work_struct alert; struct i2c_client *ara; /* Alert response address */ @@ -123,7 +125,6 @@ static void smbalert_work(struct work_struct *work) alert = container_of(work, struct i2c_smbus_alert, alert); smbus_alert(0, alert); - } /* Setup SMBALERT# infrastructure */ diff --git a/include/linux/i2c-smbus.h b/include/linux/i2c-smbus.h index fb0e040..5f16a63 100644 --- a/include/linux/i2c-smbus.h +++ b/include/linux/i2c-smbus.h @@ -26,7 +26,6 @@ #include #include - /** * i2c_smbus_alert_setup - platform data for the smbus_alert i2c client * @alert_edge_triggered: whether the alert interrupt is edge (1) or level (0) @@ -49,13 +48,4 @@ struct i2c_client *i2c_setup_smbus_alert(struct i2c_adapter *adapter, struct i2c_smbus_alert_setup *setup); int i2c_handle_smbus_alert(struct i2c_client *ara); -#if IS_ENABLED(CONFIG_I2C_SMBUS) && IS_ENABLED(CONFIG_OF) -int of_i2c_setup_smbus_alert(struct i2c_adapter *adap); -#else -static inline int of_i2c_setup_smbus_alert(struct i2c_adapter *adap) -{ - return 0; -} -#endif - #endif /* _LINUX_I2C_SMBUS_H */