From patchwork Wed Apr 3 12:40:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 10883643 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CCF81139A for ; Wed, 3 Apr 2019 12:41:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B7DF828856 for ; Wed, 3 Apr 2019 12:41:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AC60A28995; Wed, 3 Apr 2019 12:41:34 +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 6077028856 for ; Wed, 3 Apr 2019 12:41:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726310AbfDCMld (ORCPT ); Wed, 3 Apr 2019 08:41:33 -0400 Received: from sauhun.de ([88.99.104.3]:48338 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726206AbfDCMki (ORCPT ); Wed, 3 Apr 2019 08:40:38 -0400 Received: from localhost (p54B3311F.dip0.t-ipconnect.de [84.179.49.31]) by pokefinder.org (Postfix) with ESMTPSA id A70173E43CB; Wed, 3 Apr 2019 14:40:36 +0200 (CEST) From: Wolfram Sang To: linux-i2c@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Peter Rosin , Stefan Lengfeld , linux-omap@vger.kernel.org, linux-tegra@vger.kernel.org, Linus Walleij , Andy Shevchenko , Wolfram Sang Subject: [PATCH 04/12] i2c: mux: populate the new *_atomic callbacks Date: Wed, 3 Apr 2019 14:40:11 +0200 Message-Id: <20190403124019.8947-5-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190403124019.8947-1-wsa+renesas@sang-engineering.com> References: <20190403124019.8947-1-wsa+renesas@sang-engineering.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If the parent adapter has atomic_xfer callbacks, populate them for the mux adapter as well. We can use the same translation function as for the non-atomic xfer callback. Signed-off-by: Wolfram Sang Reviewed-by: Peter Rosin --- drivers/i2c/i2c-mux.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/i2c/i2c-mux.c b/drivers/i2c/i2c-mux.c index f330690b4125..603252fa1284 100644 --- a/drivers/i2c/i2c-mux.c +++ b/drivers/i2c/i2c-mux.c @@ -310,12 +310,18 @@ int i2c_mux_add_adapter(struct i2c_mux_core *muxc, else priv->algo.master_xfer = __i2c_mux_master_xfer; } + if (parent->algo->master_xfer_atomic) + priv->algo.master_xfer_atomic = priv->algo.master_xfer; + if (parent->algo->smbus_xfer) { if (muxc->mux_locked) priv->algo.smbus_xfer = i2c_mux_smbus_xfer; else priv->algo.smbus_xfer = __i2c_mux_smbus_xfer; } + if (parent->algo->smbus_xfer_atomic) + priv->algo.smbus_xfer_atomic = priv->algo.smbus_xfer; + priv->algo.functionality = i2c_mux_functionality; /* Now fill out new adapter structure */