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: 46784 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f71.google.com (mail-wg0-f71.google.com [74.125.82.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C74FC214B1 for ; Mon, 6 Apr 2015 12:39:12 +0000 (UTC) Received: by wghm4 with SMTP id m4sf5624070wgh.2 for ; Mon, 06 Apr 2015 05:39:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-type :content-transfer-encoding:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=6qxgbFQqHuWPiuISnS0etUeucR1OO6YG7LegWaXsh4U=; b=KJ+aiCy8sEtAPrJ0xtdNg9tAc6V8JboGiBV0NTEyd+SEb3zb7/2LQpVnwUeiWzbQ1J zrcZQNNtfXXZ4K/vngcrJNs4yDplRQUi98WqvdLMnwWjZucuKF8f1uxqKF0lku1uAef1 CIkKhyxmSp6ooaCmGohFSl1jm+HdlTqq5GrQvS2vmzvlW0UXPSKe8KZ4VBzidqz86n3O YS3HpoZPjc/G33zM9oGO087hqu3DCXwIB9cC/5ot7GMBJ+PJMpAGNH+jUYjsNsO7cLVQ 2tGgJwaDncWqWcqqOunAk1k62PwLppn34iBInOxL+pzB8SgfWHxkQf5ROudT18JmBdc2 8/dw== X-Gm-Message-State: ALoCoQnPuhmSOW3rnziJZLeY2O2OuCSoOv8EBBFkYi4ugK8Ljyg1j252ro8zkbUDTn5w3rjjbpyB X-Received: by 10.180.150.115 with SMTP id uh19mr6832437wib.7.1428323952027; Mon, 06 Apr 2015 05:39:12 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.5.2 with SMTP id ci2ls500390lad.38.gmail; Mon, 06 Apr 2015 05:39:11 -0700 (PDT) X-Received: by 10.152.37.69 with SMTP id w5mr13500567laj.15.1428323951624; Mon, 06 Apr 2015 05:39:11 -0700 (PDT) Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com. [209.85.217.175]) by mx.google.com with ESMTPS id p6si3441312laj.167.2015.04.06.05.39.11 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Apr 2015 05:39:11 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) client-ip=209.85.217.175; Received: by lbbqq2 with SMTP id qq2so10237649lbb.3 for ; Mon, 06 Apr 2015 05:39:11 -0700 (PDT) X-Received: by 10.112.10.197 with SMTP id k5mr13492757lbb.86.1428323951511; Mon, 06 Apr 2015 05:39:11 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.57.201 with SMTP id k9csp3330001lbq; Mon, 6 Apr 2015 05:39:10 -0700 (PDT) X-Received: by 10.66.183.47 with SMTP id ej15mr27191103pac.34.1428323944841; Mon, 06 Apr 2015 05:39:04 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fh5si6509881pdb.24.2015.04.06.05.39.03 for ; Mon, 06 Apr 2015 05:39:04 -0700 (PDT) Received-SPF: none (google.com: linux-i2c-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752679AbbDFMjB (ORCPT ); Mon, 6 Apr 2015 08:39:01 -0400 Received: from mail-lb0-f179.google.com ([209.85.217.179]:36187 "EHLO mail-lb0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752773AbbDFMio (ORCPT ); Mon, 6 Apr 2015 08:38:44 -0400 Received: by lbbqq2 with SMTP id qq2so10229879lbb.3 for ; Mon, 06 Apr 2015 05:38:43 -0700 (PDT) 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?= Cc: grygorii.strashko@ti.com, linux-i2c@vger.kernel.org, , , Kevin Hilman , Santosh Shilimkar , Murali Karicheri 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 Sender: linux-i2c-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-i2c@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: grygorii.strashko@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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;