Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4277010pxv; Tue, 27 Jul 2021 03:25:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy4dLVSFJ9zJZ9yiNAgTGypiocbaompkUtuNE4l352ky1CcfeJn0eDDaVkdlPx321Fzy991 X-Received: by 2002:a17:906:17c2:: with SMTP id u2mr21135993eje.117.1627381524904; Tue, 27 Jul 2021 03:25:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627381524; cv=none; d=google.com; s=arc-20160816; b=Fn+seshfi8qzIzx8z4Qw4P07Y0xr02wc8kws1cgHOW8EUtWkCGtnNbzFwnh79INcJR z5WqqHImE26tCSHl/jtnwX7cn4bs9NpfjGQTmNzQgVlILWvSYkPLarOP3W2DM8CNle5+ 3Np+RYcg1lPmbliIjUBJvUYioY/4fGLLmtfioDk7ND+7m+Iw5ZI5A3Sp4SB6JFr8JZFH oJAUGXGEm/kVpO+8SBPAJLEHkP104I6ckISKyd+vFy7CeAa6BcTDWJMTtaIckDbBXRAz mYqk+lUdKaYQNt6A4cTknGsIdDIhUZhjwAluzwawwQ5CvRicXXhEbOs0f1U804ULyaZh KDyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=+0GiafmPb9DJJuG0qVfNnTOqvUqWwenlk312FhO9D00=; b=pbcZuF/44qL4KbOaQdQ7BAD5ah5zlLrc1nNlJtF0h4PqjTPLPwiMGpNbOLbyal+2Q3 325wVvJz+xKXiOdQJskALLg+sySkPbuj3oOY7OVpg0JkOE1d4D6LciO2sJtDH3g2w3IA xvZAOOAxPhavXuD2wyVOTUToEA0ol+i5rFDDYuk6kJiPTQvD6RdSZw1VljEt8hOovYLC E2dRNF/8LA7JLyA5tJwdbx8AvqFUv7B4VxrRXRa2aBv1hDbnNwFOcPVJVEXJME1A0ffv g5OhrepuuVZguQllf39H7VLXGVq5XsjdAhpnzdWCvAvpbRa7X11QdMJ7yjLfvQVRWRoZ BYjw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id di3si2232932ejc.490.2021.07.27.03.25.00; Tue, 27 Jul 2021 03:25:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236284AbhG0KYr (ORCPT + 99 others); Tue, 27 Jul 2021 06:24:47 -0400 Received: from muru.com ([72.249.23.125]:55834 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236275AbhG0KX6 (ORCPT ); Tue, 27 Jul 2021 06:23:58 -0400 Received: from hillo.muru.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTP id 37ED380F0; Tue, 27 Jul 2021 10:24:15 +0000 (UTC) From: Tony Lindgren To: "David S . Miller" , Herbert Xu , linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org Cc: linux-crypto@vger.kernel.org, Lokesh Vutla , Tero Kristo Subject: [PATCH 4/6] crypto: omap-sham - drop old hw_init and unused FLAGS_INIT Date: Tue, 27 Jul 2021 13:23:37 +0300 Message-Id: <20210727102339.49141-4-tony@atomide.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210727102339.49141-1-tony@atomide.com> References: <20210727102339.49141-1-tony@atomide.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org FLAGS_INIT is now unused and we can just use standard runtime PM functions instead. Cc: Lokesh Vutla Cc: Tero Kristo Signed-off-by: Tony Lindgren --- drivers/crypto/omap-sham.c | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/drivers/crypto/omap-sham.c b/drivers/crypto/omap-sham.c --- a/drivers/crypto/omap-sham.c +++ b/drivers/crypto/omap-sham.c @@ -105,7 +105,6 @@ #define FLAGS_FINAL 1 #define FLAGS_DMA_ACTIVE 2 #define FLAGS_OUTPUT_READY 3 -#define FLAGS_INIT 4 #define FLAGS_CPU 5 #define FLAGS_DMA_READY 6 #define FLAGS_AUTO_XOR 7 @@ -368,24 +367,6 @@ static void omap_sham_copy_ready_hash(struct ahash_request *req) hash[i] = le32_to_cpup((__le32 *)in + i); } -static int omap_sham_hw_init(struct omap_sham_dev *dd) -{ - int err; - - err = pm_runtime_resume_and_get(dd->dev); - if (err < 0) { - dev_err(dd->dev, "failed to get sync: %d\n", err); - return err; - } - - if (!test_bit(FLAGS_INIT, &dd->flags)) { - set_bit(FLAGS_INIT, &dd->flags); - dd->err = 0; - } - - return 0; -} - static void omap_sham_write_ctrl_omap2(struct omap_sham_dev *dd, size_t length, int final, int dma) { @@ -1093,10 +1074,13 @@ static int omap_sham_hash_one_req(struct crypto_engine *engine, void *areq) dev_dbg(dd->dev, "hash-one: op: %u, total: %u, digcnt: %zd, final: %d", ctx->op, ctx->total, ctx->digcnt, final); - err = omap_sham_hw_init(dd); - if (err) + err = pm_runtime_resume_and_get(dd->dev); + if (err < 0) { + dev_err(dd->dev, "failed to get sync: %d\n", err); return err; + } + dd->err = 0; dd->req = req; if (ctx->digcnt) -- 2.32.0