From patchwork Mon Oct 19 20:35:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Moritz Fischer X-Patchwork-Id: 7439731 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 54CAC9F30B for ; Mon, 19 Oct 2015 20:37:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7ADCD20606 for ; Mon, 19 Oct 2015 20:37:38 +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 9DCF320605 for ; Mon, 19 Oct 2015 20:37:37 +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 1ZoH9c-0004KU-3f; Mon, 19 Oct 2015 20:35:36 +0000 Received: from mail-pa0-f42.google.com ([209.85.220.42]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZoH9Z-0004I7-GV for linux-arm-kernel@lists.infradead.org; Mon, 19 Oct 2015 20:35:33 +0000 Received: by pacfv9 with SMTP id fv9so105416893pac.3 for ; Mon, 19 Oct 2015 13:35:10 -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=lZ6CZmtGuOzXheEur8e8gcwYpoAUBSBDiq1CXKNVpQo=; b=RaNvKmpMoVwZCat0oGMNgSRLdeEF+GVKW8RExBRX/vWADOlGwi5O4mOmHMZcCfflj7 8kAQycBcRBFElKwxFNH9+K8H5PggKSVioZeMdwevVW5p5+EKxSJZxzFIom6nN7SlgwNH JIGZtwSJ57wv+/13SaSn1Z2BfTEqTNHjn/Wv4sRi7Q4hejvAxeFO7T62KMzxxY30L4n3 jTavWebQC30pcw73Dl+wdoqJ8pnCdhGVSgBQGgHJ5jsdkVXQalR34sJh6C8ATSSQL/Qu cFm/IQikP1VTH78XTbh+p8mIdxO4A8lggk/HpSFrOwAS4/HitAkpmWBEPDXuWtCpShfa Jicw== X-Gm-Message-State: ALoCoQlHWr0/bsoT9sq2+lYLJ2YbOQ0mWlgOzJHYiZ2RiLVUXA7IsmKb8wK+0U6tqnxXWclfHR4V X-Received: by 10.68.253.42 with SMTP id zx10mr33634133pbc.99.1445286910812; Mon, 19 Oct 2015 13:35:10 -0700 (PDT) Received: from archbook.localdomain ([172.56.41.58]) by smtp.gmail.com with ESMTPSA id fk8sm38282439pab.33.2015.10.19.13.35.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 19 Oct 2015 13:35:09 -0700 (PDT) From: Moritz Fischer To: atull@opensource.altera.com Subject: [PATCHv2] fpga: zynq-fpga: Fix unbalanced clock handling Date: Mon, 19 Oct 2015 13:35:33 -0700 Message-Id: <1445286933-2041-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_133533_582266_27FC4BCF X-CRM114-Status: GOOD ( 12.48 ) 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 an enable 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; }