From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfram Sang Subject: [RFC] i2c: mux: add mux device to the adapter name Date: Mon, 3 Nov 2014 22:00:56 +0100 Message-ID: <1415048456-13456-1-git-send-email-wsa@the-dreams.de> Return-path: Sender: linux-i2c-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Cc: Wolfram Sang , Jean Delvare , Guenter Roeck , Martin Belanger , Rodolfo Giometti , Michael Lawnick , Jeroen De Wachter List-Id: linux-i2c@vger.kernel.org If there are multiple muxes on one bus, then specifying the channel only is not sufficient for a distinguishable name. We need the actual device, too. Signed-off-by: Wolfram Sang Cc: Jean Delvare Cc: Guenter Roeck Cc: Martin Belanger Cc: Rodolfo Giometti Cc: Michael Lawnick Cc: Jeroen De Wachter --- This is probably the least "ABI" breaking solution? RFC for now... drivers/i2c/i2c-mux.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/i2c-mux.c b/drivers/i2c/i2c-mux.c index 5b482ea32faf..26aa84902ada 100644 --- a/drivers/i2c/i2c-mux.c +++ b/drivers/i2c/i2c-mux.c @@ -134,7 +134,8 @@ struct i2c_adapter *i2c_add_mux_adapter(struct i2c_adapter *parent, /* Now fill out new adapter structure */ snprintf(priv->adap.name, sizeof(priv->adap.name), - "i2c-%d-mux (chan_id %d)", i2c_adapter_id(parent), chan_id); + "i2c-%d-mux (chan_id %d) (mux_device %s)", + i2c_adapter_id(parent), chan_id, dev_name(mux_dev)); priv->adap.owner = THIS_MODULE; priv->adap.algo = &priv->algo; priv->adap.algo_data = priv; -- 2.1.1