Message ID | 1438089585-30103-2-git-send-email-aisheng.dong@freescale.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org> X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 94B74C05AC for <patchwork-linux-arm@patchwork.kernel.org>; Tue, 28 Jul 2015 14:32:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B3AE82065D for <patchwork-linux-arm@patchwork.kernel.org>; Tue, 28 Jul 2015 14:32:36 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C97E72049E for <patchwork-linux-arm@patchwork.kernel.org>; Tue, 28 Jul 2015 14:32:35 +0000 (UTC) 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 1ZK5ts-0005Al-Gn; Tue, 28 Jul 2015 14:30:36 +0000 Received: from mail-bn1on0111.outbound.protection.outlook.com ([157.56.110.111] helo=na01-bn1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZK5tU-0003Wa-Le for linux-arm-kernel@lists.infradead.org; Tue, 28 Jul 2015 14:30:15 +0000 Received: from BLUPR0301CA0026.namprd03.prod.outlook.com (10.162.113.164) by BY2PR0301MB1637.namprd03.prod.outlook.com (10.163.28.139) with Microsoft SMTP Server (TLS) id 15.1.225.19; Tue, 28 Jul 2015 14:29:49 +0000 Received: from BY2FFO11FD030.protection.gbl (2a01:111:f400:7c0c::181) by BLUPR0301CA0026.outlook.office365.com (2a01:111:e400:5259::36) with Microsoft SMTP Server (TLS) id 15.1.225.19 via Frontend Transport; Tue, 28 Jul 2015 14:29:49 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=freescale.com; freescale.mail.onmicrosoft.com; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BY2FFO11FD030.mail.protection.outlook.com (10.1.14.211) with Microsoft SMTP Server (TLS) id 15.1.231.11 via Frontend Transport; Tue, 28 Jul 2015 14:29:47 +0000 Received: from shlinux2.ap.freescale.net (shlinux2.ap.freescale.net [10.192.224.44]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id t6SETZDH010845; Tue, 28 Jul 2015 07:29:42 -0700 From: Dong Aisheng <aisheng.dong@freescale.com> To: <linux-clk@vger.kernel.org> Subject: [PATCH V3 1/5] clk: remove duplicated code with __clk_set_parent_after Date: Tue, 28 Jul 2015 21:19:41 +0800 Message-ID: <1438089585-30103-2-git-send-email-aisheng.dong@freescale.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1438089585-30103-1-git-send-email-aisheng.dong@freescale.com> References: <1438089585-30103-1-git-send-email-aisheng.dong@freescale.com> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD030; 1:ToMrUkGfBLOZadcTzpawe/DlymTa7jhXbrErq21uI7aJXYQGtg0owt30o1wXvRN8Ap5KDNst8j1NWIH8P917OFWr06hfrS+6d/b6dxvBLNk8Oo922y0EHRApYHPWroS36KqWkp6hezkLrFW7Y4Gbs0kgKL4SvB415f25LLrDvSvrQXOFzv8Mh2Eq1pn4ntzOQU3+H00VkDf2+cWESuUX4H7U4jnYenKkSlPm6XlC2fBDe8g7nwkcm4+SW/mQ/qNuJ3xgLfP56tyC8xXtRlG64Mjr8p7dSsdy63ICdCgyPf/zGiWyAK0nyB6XB325Hn4uCiwATuk/dCWmTbzOgAg3vA== X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(339900001)(189002)(199003)(50986999)(86362001)(50226001)(92566002)(48376002)(19580405001)(76176999)(87936001)(85426001)(46102003)(2950100001)(47776003)(105606002)(107886002)(77156002)(106466001)(62966003)(110136002)(77096005)(229853001)(5001960100002)(104016003)(6806004)(36756003)(189998001)(33646002)(2351001)(19580395003)(4001430100001); DIR:OUT; SFP:1102; SCL:1; SRVR:BY2PR0301MB1637; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:sfv; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB1637; 2:6zc1xT5n3KGhdymhY+K4MhziGo2xgrcQmT1YRA0OkfIPCWrFP+UKithrDdbdcc9YqzXmflUXiLsgpdEaUdq8vGEzKWfH0uh5G7XGFqhTzLsFCh0NFjEtpgvaK7ybHpLm4ZIAamjCRCw+/pSHLQROqCcK0G0SNT9DG7HaJ75yB4g=; 3:O/8vdEVAC1HQdUAEnm2dW6YW9PHjvwItXHfiuTaJjXiGav2AW0VnCG3c8s2kK+CvJF+CPvFPX0DH1vDbgCyN4MCagVtc5O9YIE10MX4LTubLvnzbVhK0C87Qtd63iow5PxzvZtwYpuaHaTGtapnpI9BH8SyOWcIVbxc/IA5bBaxqVe3fEj0Yl/3bEVbM7ryM1Uu6+7cxkkUPmR6n7LpVLKbd1dTsn2yj0BmLB6IHl6Y=; 25:GLgkClJp4gmSJ0eCvTzawOw4HRpveaxczC+YJyj1M+nDbE5MTMdwJ6tAcMf+KTZU7nI1cb0Hz+dJLPbzrOsukZurUCuOq1k8CfMeAO+0XJHbhd6j2oiu1t8IifKR8bS4ENpipOHdCbUlc8BQgJbxopm7uLrK1BtOfgdPmVLP5BSe4DO5JRENimeu3RI7NtN2uqYo/fDP1o9FCwG6Ym9Zx65oyZB0pxVJ3JpjokuipL1+aWF8b/VoZwW7xPbR8BSFARpyXI9s+rJRJCXVoMtNxw== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR0301MB1637; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB1637; 20:dic942KnkOPmfe3PMEtU4wl6TRvo+LHdx8T6GjFZq1/tglWF9k0SvBz/Uz/n8LqYQoDai8L8+J16MxZHaYVCIyLHkVZV2QK0GQsJlpn7GgHglJx6RdDHDr5waccWT3IwnIfjdeBwB6MGLPtb03Y6QYelBXvOUiM/qjrT6rfFUMoU9jS5mhTHkuN5KMP0ZYVU5Vuw6SKX34LiultUWNDs56/1PYhhAIEdk9WH5xTmNbY9SXU5hdHLfInmfG+w7dmg/oAq5WzzE7ZvXokdi+yu4NGEhMKHeJFQpbVPslA1fomPLmmG6R1i0aJEgVESMmWPvMoS5cypK+NKaQ928ME3DDno56uIBMWUte5fKY4csVg=; 4:M0RrY3+GF95zLe//37rph3Cbl4Mdbh2UzbEyQqEcusNi/SnVY8n5iQwG95WU2taN4ucNErH9b9ulcuNIccMDv1RlsaCkh9XqT+1E7KDcCxxLUOx9EVFMRfz3xuStWZD6h4issXO2e3oMyJqb2Uv9VuV/C4R+O9rIf3dfWJpNoY8EYalZNpR+n+JuK2fWwuYpZdMw1IT7DYWHv2q3o42RXaF3TUis7nMoW7dH0lFrIIvfoHE60yd+AMPJ+hcp0e7riHT5KEvHb6vA32ywKry6les15yjyaMSj8c+zZ0D5wzE= BY2PR0301MB1637: X-MS-Exchange-Organization-RulesExecuted X-Microsoft-Antispam-PRVS: <BY2PR0301MB1637977904B6A764503114478A8D0@BY2PR0301MB1637.namprd03.prod.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:BY2PR0301MB1637; BCL:0; PCL:0; RULEID:; SRVR:BY2PR0301MB1637; X-Forefront-PRVS: 06515DA04B X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB1637; 23:N0cu7isMSZFZO7iOggPDZ+eiSHcZZYD2eVVICRgUBkTH/27DJP+JOXsYzI9MjawZDY4MSV45J8WqGB929yHiSAAqMZeUXvGxP4z6i3RcIu+tFvXtLwVwOP17xz4SBMWSDwfvHpldrLVNbR4gSsQA1aDZKOUDQUFD0MWdPwfP1xWIbB4vOaWQ16SkxCLJHjY3SbLac9peLFdJC9RGdZzggzy9odVube94Vd1IaQptGzqVw0wLkJ7ojTkhGDtHccnYWNbsfaSJQyhvohGnWX9riwM9f9/lC8Ld8Kj6xP8akdT6ANr6ckUSd9BMNnQ4602WkAY7w3i/gFSEjQn0hLUDuGw3zCiUI9Yz6uZSH1cucw9xdapwV1e700PB25FANhwv8pRbr+GDyyWDUPxGqg9QY2YV5iWE1Q8joF4xBVnZzyPiY/Oh5jyP3ev+PU6b+/5jDQOcw+yskjguDs8G77Sa+pJBI2ntcrJouUkUwXo4geTY0Pu+tBvcpVbK+nGuI9PA5Xf6FL0mfcEhQayt6PLd0l1TSDM5J+1HKspdtuE/QO1WW+wnoP7CeRm6GJggVLoPjgf4nwCd1QS3m6V/EAqI9lk65kKUzl218+U64jW1nRD4wa5bvW+MsArdrUIuBns+i+z69RAAnsjfLfxX8W0AYbzpXUaKCY7r7W46RblnOqTzrwIEwDFJbhLjQr4St0xQbLKDaHsfkSCVM6BGdPO+r/Xwr54nhxJxLamMVF6dSsnwryD8i5gyca5tbR8GD7RuzREl14OApHNPvdaO+Liwj0S6bAcReTaebNzzD2j7anPVmrvmwf8XzdstDyxV2P8RPtNZTRIhyhtbqDlCQ+pJoPk0fUPLkGNUVwctU6M5deVRM/Lx/y4rw1pzEoalxnTUo4uj/NVbw0EctaN4btg9Rw== X-Microsoft-Exchange-Diagnostics: 1; BY2PR0301MB1637; 5:ouMv360uluAVKiv0ATHq7qya6bZ94kiNU54SayBbX2H8nqLoo2AUWpNpijzgun3fP/wNA/2tCzzb1bDRy3wDMDPC1X7MxdtqEz5SS+I7H4r7f98F9OKvKtPNZEd/Yi4MxS/PGUue8rFhQ475VbG6Qg==; 24:xqvdbVgD5YFnrzvpLqP6qwHAyaJi1zRWSwLZ0jFDFCtVTKZEClGJh828TbtKuXamWXVAvlX9rReT6LHORAUU5EqYyAj8NtAHIUQqXxQRB0E=; 20:VzcGd55UQs2NRWMczGA3fP8sDju4zAKbRdknDJh8a43AzVUvKHcjqx5CHyvWJIZMG4mdZpNvl5oVYidR6C7lpA== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2015 14:29:47.5288 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR0301MB1637 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150728_073013_129848_37EDDD07 X-CRM114-Status: GOOD ( 16.21 ) X-Spam-Score: -1.9 (-) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Cc: Ranjani.Vaidyanathan@freescale.com, b20596@freescale.com, mturquette@linaro.org, shawnguo@kernel.org, sboyd@codeaurora.org, linux-kernel@vger.kernel.org, r64343@freescale.com, b20788@freescale.com, b29396@freescale.com, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 |
On 07/28, Dong Aisheng wrote: > __clk_set_parent_after() actually used the second argument then we > could put this duplicate logic in there and call it with a different > order of arguments in the success vs. error paths in this function. > > Cc: Mike Turquette <mturquette@linaro.org> > Cc: Stephen Boyd <sboyd@codeaurora.org> > Suggested-by: Stephen Boyd <sboyd@codeaurora.org> > Signed-off-by: Dong Aisheng <aisheng.dong@freescale.com> > --- Applied to clk-next
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 7bb9757..4c7f7b2 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -1185,14 +1185,8 @@ static int __clk_set_parent(struct clk_core *core, struct clk_core *parent, flags = clk_enable_lock(); clk_reparent(core, old_parent); clk_enable_unlock(flags); + __clk_set_parent_after(core, old_parent, parent); - if (core->prepare_count) { - flags = clk_enable_lock(); - clk_core_disable(core); - clk_core_disable(parent); - clk_enable_unlock(flags); - clk_core_unprepare(parent); - } return ret; }
__clk_set_parent_after() actually used the second argument then we could put this duplicate logic in there and call it with a different order of arguments in the success vs. error paths in this function. Cc: Mike Turquette <mturquette@linaro.org> Cc: Stephen Boyd <sboyd@codeaurora.org> Suggested-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Dong Aisheng <aisheng.dong@freescale.com> --- drivers/clk/clk.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)