From patchwork Tue Sep 20 11:46:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 9341505 X-Patchwork-Delegate: sboyd@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B50FF6077A for ; Tue, 20 Sep 2016 11:47:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 98407295AE for ; Tue, 20 Sep 2016 11:47:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 890FB295B5; Tue, 20 Sep 2016 11:47:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1AE0E295AE for ; Tue, 20 Sep 2016 11:47:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752814AbcITLrw (ORCPT ); Tue, 20 Sep 2016 07:47:52 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:35994 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752132AbcITLrv (ORCPT ); Tue, 20 Sep 2016 07:47:51 -0400 Received: by mail-pf0-f196.google.com with SMTP id n24so879928pfb.3; Tue, 20 Sep 2016 04:47:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=9ekjQ3OV8tqDNKqdWg+kmgB71zqZ5EEyMbn7WHlp6BM=; b=xpdWtay6KgnmoBcuMFcv5/r2rfOvA9rY7yBkcmx3vdjyTAPtNi3XWUF5DpHXSZ3ki/ wPzn7zvTnxxH3+WPKTOxiRMgJPIVDCc8Xx0rCUl8Ql3+9Uf/K04X4jEF6pcd+iphTRt9 NnY/+y/ERB246HWTrHuWXAkrMfZ30E0rphmqsoVbIZby184HF47EPVLr0u1KS4EgiY/1 lz8lfJ/F3bfQ/ZQv4DYkfI9zlqQU+YIEJlKGjHrX57og5IDLDUToz1u41w6WiBDXhLnY fCFHXKHar5+p9RirjPhSAwt+vAPmE9WosrKYQBietLAgBMjf5uH+6PVZFKwKIS4vCFg5 tUqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=9ekjQ3OV8tqDNKqdWg+kmgB71zqZ5EEyMbn7WHlp6BM=; b=eopSk1CMXjGhzGKHIgN40atrHjNxcZMJ/NCcK56yqo4A4tuPczhIpZVqfOg7QfPhxa duXKhHsYzkIf+DBRNpI/BSN7bcA6GYkqr0BgULc6jdw0vjEBUs7DcsCF5smhGFlgiFxa qCli9x5EiRZDlJwE5bxhhlBhW8mXl8SmXg5Emxq2WOFzoDGxVKxDIuEd0fam+mOfhPdi MGPRg+K1jCpcAlyFhTd1xcbbb1xgRHtb3Q6/gNwn7n0s75Zaf96BCTM3ej2NNYPDd4SK 7q/oENoDWajULgoxU2ktBqYVJtCFHFXa3+XEENIVuBM7Uw82duuB1K5Y8usquE2H9bdR XGnQ== X-Gm-Message-State: AE9vXwMJS6sdkjLX8M5K463hRq49mapgFZknp84+EpB08NcqNAS5I8H5/pE3S11AhCBuJw== X-Received: by 10.98.113.135 with SMTP id m129mr54276644pfc.41.1474372070964; Tue, 20 Sep 2016 04:47:50 -0700 (PDT) Received: from symbol-HP-Z420-Workstation.symbol.com ([140.101.159.242]) by smtp.googlemail.com with ESMTPSA id s90sm5798879pfg.34.2016.09.20.04.47.48 (version=TLS1_1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Sep 2016 04:47:50 -0700 (PDT) From: Arvind Yadav X-Google-Original-From: Arvind Yadav To: ssantosh@kernel.org, mturquette@baylibre.com, sboyd@codeaurora.org Cc: linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, Arvind Yadav Subject: [PATCH] clk: keystone: pll: Unmap region obtained by of_iomap Date: Tue, 20 Sep 2016 17:16:55 +0530 Message-Id: <1474372015-16301-1-git-send-email-arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Arvind Yadav Free memory mapping, if of_pll_div_clk_init is not successful. Signed-off-by: Arvind Yadav --- drivers/clk/keystone/pll.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/clk/keystone/pll.c b/drivers/clk/keystone/pll.c index a26ba21..cba9a0e 100644 --- a/drivers/clk/keystone/pll.c +++ b/drivers/clk/keystone/pll.c @@ -267,25 +267,30 @@ static void __init of_pll_div_clk_init(struct device_node *node) parent_name = of_clk_get_parent_name(node, 0); if (!parent_name) { pr_err("%s: missing parent clock\n", __func__); + iounmap(reg); return; } if (of_property_read_u32(node, "bit-shift", &shift)) { pr_err("%s: missing 'shift' property\n", __func__); + iounmap(reg); return; } if (of_property_read_u32(node, "bit-mask", &mask)) { pr_err("%s: missing 'bit-mask' property\n", __func__); + iounmap(reg); return; } clk = clk_register_divider(NULL, clk_name, parent_name, 0, reg, shift, mask, 0, NULL); - if (clk) + if (clk) { of_clk_add_provider(node, of_clk_src_simple_get, clk); - else + } else { pr_err("%s: error registering divider %s\n", __func__, clk_name); + iounmap(reg); + } } CLK_OF_DECLARE(pll_divider_clock, "ti,keystone,pll-divider-clock", of_pll_div_clk_init);