From patchwork Mon Apr 6 12:38:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: grygorii.strashko@linaro.org X-Patchwork-Id: 458376 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 228FA14008F for ; Mon, 6 Apr 2015 22:45:12 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Yf6JB-0008Pq-60; Mon, 06 Apr 2015 12:39:17 +0000 Received: from mail-lb0-f172.google.com ([209.85.217.172]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Yf6J0-0008LI-NM for linux-arm-kernel@lists.infradead.org; Mon, 06 Apr 2015 12:39:07 +0000 Received: by lboc7 with SMTP id c7so18774230lbo.1 for ; Mon, 06 Apr 2015 05:38:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=bBY59oEsxIkHmPEElxQHncoXOmgXnMIBPv16qMKNC2A=; b=gH//Ezh6HAqIkcBLaoD1tzH/u4qBOWX+WBQ75PTRwXKQYxsgqFIRXwMTWmf1sr0CqU WCMKhobIkAItk0gEPUn2yyp6EsbP41e+Ev5TwnW4S3AUUx/bjbRQanlWT8hcFzB5L45M ZjlmuwqKqKNTkpCTUT1w182JWudC7WXMirBz1Fq4r4QYjlkexnSRCgxVa0o0mo9vzSXS icd2/1U5nUX712jievgV2/mbXxV0toFYrOZz8z9txA1wt2FtLJoVv3pJ94dono3niGtt C060WTvl14zamXAewvRvs/pvVVV4fIb5Tr0o/VBg6m18ZeADFVZv2Glyh8lnEYj49WCh pk1A== X-Gm-Message-State: ALoCoQn91x9gg+kBxW2sGd8t1jYeuUusH5c1n37qsqaCcQAkC4su0+o+O4mxL4pDw/xRysfOIZNn X-Received: by 10.152.27.97 with SMTP id s1mr12827779lag.53.1428323923139; Mon, 06 Apr 2015 05:38:43 -0700 (PDT) Received: from localhost ([195.238.92.128]) by mx.google.com with ESMTPSA id x8sm956697lal.43.2015.04.06.05.38.42 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 06 Apr 2015 05:38:42 -0700 (PDT) From: To: Wolfram Sang , Sekhar Nori , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Subject: [PATCH v4 1/3] i2c: recovery: change input parameter to i2c_adapter for prepare/unprepare_recovery Date: Mon, 6 Apr 2015 15:38:39 +0300 Message-Id: <1428323921-25832-2-git-send-email-grygorii.strashko@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1428323921-25832-1-git-send-email-grygorii.strashko@linaro.org> References: <1428323921-25832-1-git-send-email-grygorii.strashko@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150406_053906_997416_D5AC394D X-CRM114-Status: GOOD ( 11.44 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.217.172 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.217.172 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record Cc: grygorii.strashko@ti.com, Kevin Hilman , linux-kernel@vger.kernel.org, Murali Karicheri , linux-i2c@vger.kernel.org, Santosh Shilimkar , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org From: Grygorii Strashko This patch changes type of input parameter for .prepare/unprepare_recovery() callbacks from struct i2c_bus_recovery_info * to struct i2c_adapter *. This allows to simplify implementation of these callbacks and avoid type conversations from i2c_bus_recovery_info to i2c_adapter. The i2c_bus_recovery_info can be simply retrieved from struct i2c_adapter which contains pointer on it. CC: Sekhar Nori CC: Kevin Hilman CC: Santosh Shilimkar CC: Murali Karicheri Acked-by: Uwe Kleine-König Acked-by: Alexander Sverdlin Signed-off-by: Grygorii Strashko --- drivers/i2c/i2c-core.c | 4 ++-- include/linux/i2c.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index fe80f85..617a19a 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c @@ -561,7 +561,7 @@ static int i2c_generic_recovery(struct i2c_adapter *adap) int i = 0, val = 1, ret = 0; if (bri->prepare_recovery) - bri->prepare_recovery(bri); + bri->prepare_recovery(adap); /* * By this time SCL is high, as we need to give 9 falling-rising edges @@ -586,7 +586,7 @@ static int i2c_generic_recovery(struct i2c_adapter *adap) } if (bri->unprepare_recovery) - bri->unprepare_recovery(bri); + bri->unprepare_recovery(adap); return ret; } diff --git a/include/linux/i2c.h b/include/linux/i2c.h index c5e4bb2..898033f 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -435,8 +435,8 @@ struct i2c_bus_recovery_info { void (*set_scl)(struct i2c_adapter *, int val); int (*get_sda)(struct i2c_adapter *); - void (*prepare_recovery)(struct i2c_bus_recovery_info *bri); - void (*unprepare_recovery)(struct i2c_bus_recovery_info *bri); + void (*prepare_recovery)(struct i2c_adapter *); + void (*unprepare_recovery)(struct i2c_adapter *); /* gpio recovery */ int scl_gpio;