From patchwork Fri Jun 19 13:55:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael van der Westhuizen X-Patchwork-Id: 6645451 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Original-To: patchwork-linux-crypto@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 97C9AC0020 for ; Fri, 19 Jun 2015 13:56:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F39FD2094B for ; Fri, 19 Jun 2015 13:56:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 061BE2037F for ; Fri, 19 Jun 2015 13:56:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751914AbbFSN4L (ORCPT ); Fri, 19 Jun 2015 09:56:11 -0400 Received: from mail-wg0-f44.google.com ([74.125.82.44]:33310 "EHLO mail-wg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751662AbbFSN4K (ORCPT ); Fri, 19 Jun 2015 09:56:10 -0400 Received: by wgez8 with SMTP id z8so90443630wge.0 for ; Fri, 19 Jun 2015 06:56:09 -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=744HQfpqi7q3iBS6OjSkrwOwHlkxGXyeG2DDkb2DFKE=; b=bvREeScaJ3H7Aks8lnMVaHdOonZNrDf8rVRB9lbtXpLbvBRGSczc56HlkFDfS8TzH3 FtOdLf3i0byz8Jz0l3QvlVnQtL4ox0zvK5RddlG95ggu6f+5foi4yaZwre7QpNbUwCLj yyGdclNekAQ0Msf/HSDunt/UXogF+FIwawRdhFjmzsxVhhLh1QiHkrp69RA5zr4y0vKb Bof14UDEpj6zTdnGvotz9Mm9dxk8gTDN++ZyUHt9jbf6XzM0zKIROdrvGp13IoJQOKIM h4F3vOkv6CCIiJVtjrRwpz/CtkePUNnFMUh3/fqboVERm9dLrGkJJonDhe/VCxu8iKKs za4w== X-Gm-Message-State: ALoCoQmjKULoWy0rgUaJKUb25/SA7VEaal7CkD0h9efiB2RiUQyu6GUawjGecsYwVB9LXIn1RBji X-Received: by 10.180.182.33 with SMTP id eb1mr6998143wic.8.1434722169150; Fri, 19 Jun 2015 06:56:09 -0700 (PDT) Received: from localhost.localdomain (105-237-212-12.access.mtnbusiness.co.za. [105.237.212.12]) by mx.google.com with ESMTPSA id v3sm3858982wiz.14.2015.06.19.06.56.06 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 19 Jun 2015 06:56:08 -0700 (PDT) From: Michael van der Westhuizen To: linux-crypto@vger.kernel.org Cc: Jamie Iles , Herbert Xu , David Miller , linux-arm-kernel@lists.infradead.org, Michael van der Westhuizen Subject: [PATCH] arm: crypto: picoxcell: Update to the current clk API Date: Fri, 19 Jun 2015 15:55:51 +0200 Message-Id: <1434722151-4309-1-git-send-email-michael@smart-africa.com> X-Mailer: git-send-email 2.1.4 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 The picoXcell hardware crypto accelerator driver was using an older version of the clk framework, and not (un)preparing the clock before enabling/disabling it. This change uses the handy clk_prepare_enable function to interact with the current clk framework correctly. Signed-off-by: Michael van der Westhuizen --- drivers/crypto/picoxcell_crypto.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/picoxcell_crypto.c b/drivers/crypto/picoxcell_crypto.c index 5da5b98..c5a9e5d 100644 --- a/drivers/crypto/picoxcell_crypto.c +++ b/drivers/crypto/picoxcell_crypto.c @@ -1754,15 +1754,15 @@ static int spacc_probe(struct platform_device *pdev) return PTR_ERR(engine->clk); } - if (clk_enable(engine->clk)) { - dev_info(&pdev->dev, "unable to enable clk\n"); + if (clk_prepare_enable(engine->clk)) { + dev_info(&pdev->dev, "unable to prepare/enable clk\n"); clk_put(engine->clk); return -EIO; } err = device_create_file(&pdev->dev, &dev_attr_stat_irq_thresh); if (err) { - clk_disable(engine->clk); + clk_disable_unprepare(engine->clk); clk_put(engine->clk); return err; } @@ -1830,7 +1830,7 @@ static int spacc_remove(struct platform_device *pdev) crypto_unregister_alg(&alg->alg); } - clk_disable(engine->clk); + clk_disable_unprepare(engine->clk); clk_put(engine->clk); return 0;