From patchwork Mon Oct 19 20:22:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Moritz Fischer X-Patchwork-Id: 7439691 Return-Path: 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 B69EBBEEA4 for ; Mon, 19 Oct 2015 20:24:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F16D5206E6 for ; Mon, 19 Oct 2015 20:24:44 +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 28917206E2 for ; Mon, 19 Oct 2015 20:24:44 +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 1ZoGxQ-0005XO-LT; Mon, 19 Oct 2015 20:23:00 +0000 Received: from mail-pa0-f53.google.com ([209.85.220.53]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZoGxN-0005VU-Ka for linux-arm-kernel@lists.infradead.org; Mon, 19 Oct 2015 20:22:58 +0000 Received: by padhk11 with SMTP id hk11so39195668pad.1 for ; Mon, 19 Oct 2015 13:22:36 -0700 (PDT) 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=mTJuuaNtrspwHMJYc/C5zKpxCKnuvc6wBIRPCHge80g=; b=Y57O/aXydWZXkfowRitXKS9sKO/68QC4OZH7CHxGxc+QfSuPpmZl53ff2RI/5P7u0/ Rh7evBMdT1leIOWRD8lR3LowyOr6X2j36BheT1785ToHiOr1CwlW3r25iERZ6AArmPsC HsAlabHRj2F6Qekp/XhKfRZNhBCOrxXGLni31DIWDaJDkHuIsBeGhMFtYfHEKkspRa7W 0g36H6Mu8P+8RCLO5z36jGyeXB9f0cfB6d87JJsUJjxM8hf+hGySm1df8/Y1XZCBGy0r oqWtyUq/hUxBlEIvhPe0Q3DQOxKKF67D7HG1qieJsfkWTvwPY34wG5Nn7r+zosP5nX7B wV5Q== X-Gm-Message-State: ALoCoQke3tdbQanJhCa4jAoMVsnlK+WOtEssBYoSb+lZhHEssKT/pjtON+OSs2OVLoLmIMQk0+P+ X-Received: by 10.68.68.167 with SMTP id x7mr36370817pbt.140.1445286156502; Mon, 19 Oct 2015 13:22:36 -0700 (PDT) Received: from archbook.localdomain ([172.56.41.58]) by smtp.gmail.com with ESMTPSA id ha1sm16188824pbc.54.2015.10.19.13.22.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 19 Oct 2015 13:22:35 -0700 (PDT) From: Moritz Fischer To: atull@opensource.altera.com Subject: [PATCH] fpga: zynq-fpga: Fix unbalanced clock handling Date: Mon, 19 Oct 2015 13:22:55 -0700 Message-Id: <1445286175-1640-1-git-send-email-moritz.fischer@ettus.com> X-Mailer: git-send-email 2.6.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151019_132257_715404_99FA9DAE X-CRM114-Status: GOOD ( 12.56 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Moritz Fischer , michal.simek@xilinx.com, linux-kernel@vger.kernel.org, gregkh@linuxfoundation.com, soren.brinkmann@xilinx.com, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 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 This commit fixes the unbalanced clock handling, where a failed probe would leave the clock with a prepare count of -1. Reported-by: Josh Cartwright Signed-off-by: Moritz Fischer --- drivers/fpga/zynq-fpga.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/fpga/zynq-fpga.c b/drivers/fpga/zynq-fpga.c index 103303c..617d382 100644 --- a/drivers/fpga/zynq-fpga.c +++ b/drivers/fpga/zynq-fpga.c @@ -487,7 +487,7 @@ static int zynq_fpga_probe(struct platform_device *pdev) &zynq_fpga_ops, priv); if (err) { dev_err(dev, "unable to register FPGA manager"); - clk_disable_unprepare(priv->clk); + clk_unprepare(priv->clk); return err; } @@ -502,7 +502,7 @@ static int zynq_fpga_remove(struct platform_device *pdev) priv = platform_get_drvdata(pdev); - clk_disable_unprepare(priv->clk); + clk_unprepare(priv->clk); return 0; }