From patchwork Fri Nov 14 08:50:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 5304041 Return-Path: X-Original-To: patchwork-dmaengine@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 21E169F2ED for ; Fri, 14 Nov 2014 08:51:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 56A7B20176 for ; Fri, 14 Nov 2014 08:51:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7AC2620149 for ; Fri, 14 Nov 2014 08:51:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754631AbaKNIvC (ORCPT ); Fri, 14 Nov 2014 03:51:02 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:21083 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754747AbaKNIup (ORCPT ); Fri, 14 Nov 2014 03:50:45 -0500 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NF000I58U1CXV60@mailout1.w1.samsung.com>; Fri, 14 Nov 2014 08:53:36 +0000 (GMT) X-AuditID: cbfec7f5-b7f956d000005ed7-9d-5465c262c060 Received: from eusync1.samsung.com ( [203.254.199.211]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 57.A8.24279.262C5645; Fri, 14 Nov 2014 08:50:42 +0000 (GMT) Received: from AMDC1943.digital.local ([106.116.151.171]) by eusync1.samsung.com (Oracle Communications Messaging Server 7u4-23.01(7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0NF00074XTWBTB70@eusync1.samsung.com>; Fri, 14 Nov 2014 08:50:42 +0000 (GMT) From: Krzysztof Kozlowski To: "Rafael J. Wysocki" , Len Brown , Pavel Machek , Russell King , Dan Williams , Vinod Koul , Ulf Hansson , Alan Stern , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org Cc: Kevin Hilman , Laurent Pinchart , Kyungmin Park , Marek Szyprowski , Bartlomiej Zolnierkiewicz , Krzysztof Kozlowski Subject: [PATCH v12 6/6] amba: Use inlines instead of macros for amba_pclk_enable/disable Date: Fri, 14 Nov 2014 09:50:33 +0100 Message-id: <1415955033-29093-7-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1415955033-29093-1-git-send-email-k.kozlowski@samsung.com> References: <1415955033-29093-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrHLMWRmVeSWpSXmKPExsVy+t/xy7pJh1JDDB7uMrXYOGM9q8X0qRcY LVZP/ctq8fqFocXTzY+ZLM42vWG36Jy4hN1i1pS9TBaXd81hs/jce4TR4vZlXou1R+6yW9w9 dZTN4szpS6wWE35fYLM4vjbc4mXffhYHQY+W5h42j9kdM1k9Fu95yeSxaVUnm8eda3vYPLZc bWfxmH33B6NH35ZVjB4rVn9n9/i8SS6AK4rLJiU1J7MstUjfLoEr4/GeSywFtzgrpqyaxN7A OJ+ji5GTQ0LARGL5yTtMELaYxIV769m6GLk4hASWMkocP/2fDSQhJNDHJHFuWxGIzSZgLLF5 +RKwIhGBdmaJvnVTwYqYBRYxSTRNVQSxhQWiJV5MO8IMYrMIqEpcPLqREcTmFXCXmLT7HNQ2 OYmTxyazgticAh4SkzeuYoFY5i7x+fIf5gmMvAsYGVYxiqaWJhcUJ6XnGukVJ+YWl+al6yXn 525ihIT51x2MS49ZHWIU4GBU4uHVyEwNEWJNLCuuzD3EKMHBrCTCq7QbKMSbklhZlVqUH19U mpNafIiRiYNTqoFx777Pr+svN9hFrneMKtunU39w+hov67wnZ65PtVZbdLdx902xbyWn5tfb fvQz3D7Zp2dK/1/rS45Fyx1WpO0ombOpZoMTy+tl5r/tPrfo7Lj85eURCdFfR+favF/78JTH xf1p1Z7vdsz0ydg/u03wz6MLazef49RYtqRchMkp9s2591M/TjXqeKvEUpyRaKjFXFScCACw pezTUQIAAA== Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Replace the amba_pclk_enable and amba_pclk_disable macros with static inline functions and remove checks for IS_ERR. The amba bus clock won't be ERR because probe would fail before the use of these functions. Signed-off-by: Krzysztof Kozlowski --- include/linux/amba/bus.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h index 2afc618b15ce..0ab5f8e0dea2 100644 --- a/include/linux/amba/bus.h +++ b/include/linux/amba/bus.h @@ -92,11 +92,15 @@ struct amba_device *amba_find_device(const char *, struct device *, unsigned int int amba_request_regions(struct amba_device *, const char *); void amba_release_regions(struct amba_device *); -#define amba_pclk_enable(d) \ - (IS_ERR((d)->pclk) ? 0 : clk_enable((d)->pclk)) +static inline int amba_pclk_enable(struct amba_device *dev) +{ + return clk_enable(dev->pclk); +} -#define amba_pclk_disable(d) \ - do { if (!IS_ERR((d)->pclk)) clk_disable((d)->pclk); } while (0) +static inline void amba_pclk_disable(struct amba_device *dev) +{ + clk_disable(dev->pclk); +} static inline int amba_pclk_prepare(struct amba_device *dev) {