From patchwork Wed Nov 12 14:32:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 5289541 Return-Path: X-Original-To: patchwork-dmaengine@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2446EC11AC for ; Wed, 12 Nov 2014 14:33:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 534212017D for ; Wed, 12 Nov 2014 14:33:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6EB7D2015D for ; Wed, 12 Nov 2014 14:33:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752974AbaKLOdF (ORCPT ); Wed, 12 Nov 2014 09:33:05 -0500 Received: from mailout3.w1.samsung.com ([210.118.77.13]:60986 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752462AbaKLOcl (ORCPT ); Wed, 12 Nov 2014 09:32:41 -0500 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NEX00BTLKJ6CO80@mailout3.w1.samsung.com>; Wed, 12 Nov 2014 14:35:30 +0000 (GMT) X-AuditID: cbfec7f5-b7f956d000005ed7-2f-54636f85e7f5 Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 60.92.24279.58F63645; Wed, 12 Nov 2014 14:32:37 +0000 (GMT) Received: from AMDC1943.digital.local ([106.116.151.171]) by eusync3.samsung.com (Oracle Communications Messaging Server 7u4-23.01(7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0NEX00K83KE6S170@eusync3.samsung.com>; Wed, 12 Nov 2014 14:32:37 +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 v11 6/6] amba: Use inlines instead of macros for amba_pclk_enable/disable Date: Wed, 12 Nov 2014 15:32:28 +0100 Message-id: <1415802748-30530-7-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1415802748-30530-1-git-send-email-k.kozlowski@samsung.com> References: <1415802748-30530-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrLLMWRmVeSWpSXmKPExsVy+t/xq7qt+ckhBnd6DCw2zljPajF96gVG i9VT/7JavH5haPF082Mmi7NNb9gtOicuYbeYNWUvk8XlXXPYLD73HmG0uH2Z12LtkbvsFndP HWWzOHP6EqvFhN8X2CyOrw23eNm3n8VB0KOluYfNY3bHTFaPxXteMnlsWtXJ5nHn2h42jy1X 21k8Zt/9wejRt2UVo8eK1d/ZPT5vkgvgiuKySUnNySxLLdK3S+DKWH/2MnvBLc6KzvUbWBoY 53N0MXJySAiYSGzrX88IYYtJXLi3nq2LkYtDSGApo8SCJ8eZQRJCAn1MEtveFYHYbALGEpuX LwErEhFoZ5boWzeVDSTBLLCISaJpqmIXIweHsEC0xKFfoiBhFgFViSubDoGV8Aq4S7w584Md YpmcxMljk1lBbE4BD4kv2/6yQexylzhz+SDLBEbeBYwMqxhFU0uTC4qT0nON9IoTc4tL89L1 kvNzNzFCgvzrDsalx6wOMQpwMCrx8H7QSg4RYk0sK67MPcQowcGsJMK7KwcoxJuSWFmVWpQf X1Sak1p8iJGJg1OqgfH2wjLV7bdXrvPpWDH51j1X1/scO+p/OnU39/YcdLz8yLdfyWR157QZ nv2yKudLNu1XerQ5O1/pjOAztVc+TGdftHKaFMQvnWb1fvVUg9uK3w+5WS3KKmTRstpU4p2a WrCfrSCf9cCz+NURU/Yo309U+3V0RsZulh57Ke6L9XMOyy0p/vjm0zQlluKMREMt5qLiRACA z6gdUAIAAA== Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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..7daba00ddabd 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) {