From patchwork Mon Apr 30 11:55:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 10371649 X-Patchwork-Delegate: geert@linux-m68k.org 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 AB6826032A for ; Mon, 30 Apr 2018 11:55:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9BD77289A7 for ; Mon, 30 Apr 2018 11:55:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8F717289BB; Mon, 30 Apr 2018 11:55:58 +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=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, 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 75856289A7 for ; Mon, 30 Apr 2018 11:55:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752521AbeD3Lzz (ORCPT ); Mon, 30 Apr 2018 07:55:55 -0400 Received: from sauhun.de ([88.99.104.3]:47408 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752074AbeD3Lzz (ORCPT ); Mon, 30 Apr 2018 07:55:55 -0400 Received: from localhost (p54B33CD8.dip0.t-ipconnect.de [84.179.60.216]) by pokefinder.org (Postfix) with ESMTPSA id B57EB32475F; Mon, 30 Apr 2018 13:55:53 +0200 (CEST) From: Wolfram Sang To: linux-i2c@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, Peter Rosin , Wolfram Sang Subject: [PATCH 2/2] i2c: mux: demux-pinctrl: add symlinks to the demux device in sysfs Date: Mon, 30 Apr 2018 13:55:44 +0200 Message-Id: <20180430115544.22903-3-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180430115544.22903-1-wsa+renesas@sang-engineering.com> References: <20180430115544.22903-1-wsa+renesas@sang-engineering.com> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Similar to mux devices, create special symlinks to connect the demuxed bus with the demux device. Signed-off-by: Wolfram Sang --- drivers/i2c/muxes/i2c-demux-pinctrl.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/i2c/muxes/i2c-demux-pinctrl.c b/drivers/i2c/muxes/i2c-demux-pinctrl.c index 035032e20327..d5e7d4aa6ee1 100644 --- a/drivers/i2c/muxes/i2c-demux-pinctrl.c +++ b/drivers/i2c/muxes/i2c-demux-pinctrl.c @@ -116,6 +116,11 @@ static int i2c_demux_activate_master(struct i2c_demux_pinctrl_priv *priv, u32 ne if (ret < 0) goto err_with_put; + sysfs_create_link(&priv->cur_adap.dev.kobj, &priv->dev->kobj, + "demux_device"); + sysfs_create_link(&priv->dev->kobj, &priv->cur_adap.dev.kobj, + "channel-0"); + return 0; err_with_put: @@ -135,6 +140,9 @@ static int i2c_demux_deactivate_master(struct i2c_demux_pinctrl_priv *priv) if (cur < 0) return 0; + sysfs_remove_link(&priv->dev->kobj, "channel-0"); + sysfs_remove_link(&priv->cur_adap.dev.kobj, "demux_device"); + i2c_del_adapter(&priv->cur_adap); i2c_put_adapter(priv->chan[cur].parent_adap);