From patchwork Wed Jul 20 05:14:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amitoj Kaur Chawla X-Patchwork-Id: 650559 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3rvQ7j57xcz9sdm for ; Wed, 20 Jul 2016 15:14:25 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=uzaH0rbR; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751130AbcGTFOY (ORCPT ); Wed, 20 Jul 2016 01:14:24 -0400 Received: from mail-pa0-f68.google.com ([209.85.220.68]:32886 "EHLO mail-pa0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751093AbcGTFOX (ORCPT ); Wed, 20 Jul 2016 01:14:23 -0400 Received: by mail-pa0-f68.google.com with SMTP id q2so2593885pap.0; Tue, 19 Jul 2016 22:14:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=FdBx5PwX+47sDUBnwGZtbzgzECwDXgE668dOvHmYF4M=; b=uzaH0rbRXst5aegsHoXyz2uUsccR6qSofreucNDimAh++yIdew9Ycyqb0g7b0ppYDX sHJjZz9tL9Bg19Xc6xDplmAiwR5Ogk8ljdpNqQLORTwCoT0I9bVEwVhSjSkR5E/tTwsh LZqUWZTUxA0arLzscEALxEdvsz0HEofARa1L0yfl7St8wItcluXcgasXQos7d08uUUxE iYDTQgzVfwp/zOu2FA1jlbqDIgFmsxkK4v9cPFnwzicianc+VMW3VVwABvL084BZGIPb m5kDldSzjfxpBybwzDDDHLCkyqWLOijvUWGRKKtbIhHttn3b2OhHLB02/0hNQyCDKzPX lwbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=FdBx5PwX+47sDUBnwGZtbzgzECwDXgE668dOvHmYF4M=; b=OH+KwziaWhKhDS/vjE9Nwc2tOvuOT9jLGgtRqNXJmANMAKpMzF+RffqVTBv3jkcXfW O7UbXBg6IkiBaR2UMvBgrmC3kdB8GCEDmS8y3eWugeEwhb7W5DALcZjWdOrZNpSeZs56 biXs63QAHwHJ/XioIAyg01QQheCOubC5mK/GPvUsEGIdfhYjeszU8pILyTWtP70hB2gS gdvStd2/sPi2wfwZ4h7CvFBFTd0YyIsm0+T/gPM6x9/XgE1JdNjv48QlqPK9T+ZO07mQ NAMlGvxE4vJ18I7IYillRRbVM708Lx1fep++V0J8Pp5qTbIEUQVmvpWbZDVyEk1AkRFF CFag== X-Gm-Message-State: ALyK8tI2ejJ1UTXgltP3iAIPL3/JAIJS+K7NnoykaxxwyRvlWQfcivme4pE8JEYEkfX7oQ== X-Received: by 10.66.11.234 with SMTP id t10mr71347858pab.66.1468991662591; Tue, 19 Jul 2016 22:14:22 -0700 (PDT) Received: from localhost ([171.50.157.125]) by smtp.gmail.com with ESMTPSA id k78sm1087552pfa.78.2016.07.19.22.14.21 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 19 Jul 2016 22:14:22 -0700 (PDT) Date: Wed, 20 Jul 2016 10:44:18 +0530 From: Amitoj Kaur Chawla To: wsa@the-dreams.de, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Cc: julia.lawall@lip6.fr Subject: [PATCH v2] 2c: mv64xxx: Use clk_enable_prepare and clk_disable_unprepare Message-ID: <20160720051417.GA21765@amitoj-Inspiron-3542> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org Replace clk_enable and clk_prepare with clk_enable_prepare and clk_disable and clk_unprepare with clk_disable_unprepare. The Coccinelle semantic patch used to make this change is as follows: @@ expression e; @@ - clk_prepare(e); - clk_enable(e); + clk_prepare_enable(e); @@ expression e; @@ - clk_disable(e); - clk_unprepare(e); + clk_disable_unprepare(e); Signed-off-by: Amitoj Kaur Chawla --- Changes in v2: -Rebased patch drivers/i2c/busses/i2c-mv64xxx.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c index 43207f5..79bae48 100644 --- a/drivers/i2c/busses/i2c-mv64xxx.c +++ b/drivers/i2c/busses/i2c-mv64xxx.c @@ -910,10 +910,8 @@ mv64xxx_i2c_probe(struct platform_device *pd) #if defined(CONFIG_HAVE_CLK) /* Not all platforms have a clk */ drv_data->clk = devm_clk_get(&pd->dev, NULL); - if (!IS_ERR(drv_data->clk)) { - clk_prepare(drv_data->clk); - clk_enable(drv_data->clk); - } + if (!IS_ERR(drv_data->clk)) + clk_prepare_enable(drv_data->clk); #endif if (pdata) { drv_data->freq_m = pdata->freq_m; @@ -966,10 +964,8 @@ exit_reset: exit_clk: #if defined(CONFIG_HAVE_CLK) /* Not all platforms have a clk */ - if (!IS_ERR(drv_data->clk)) { - clk_disable(drv_data->clk); - clk_unprepare(drv_data->clk); - } + if (!IS_ERR(drv_data->clk)) + clk_disable_unprepare(drv_data->clk); #endif return rc; } @@ -985,10 +981,8 @@ mv64xxx_i2c_remove(struct platform_device *dev) reset_control_assert(drv_data->rstc); #if defined(CONFIG_HAVE_CLK) /* Not all platforms have a clk */ - if (!IS_ERR(drv_data->clk)) { - clk_disable(drv_data->clk); - clk_unprepare(drv_data->clk); - } + if (!IS_ERR(drv_data->clk)) + clk_disable_unprepare(drv_data->clk); #endif return 0;