Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3372699pxj; Mon, 24 May 2021 05:21:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXyAZdnuAGw7N7a+4HARWmYnFAIWFiNcT6YdGTj5pqTkCBTCkHjN427+zdQHg2SS4ZO947 X-Received: by 2002:a05:6638:32a8:: with SMTP id f40mr25153097jav.84.1621858883177; Mon, 24 May 2021 05:21:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621858883; cv=none; d=google.com; s=arc-20160816; b=G7KqlACkEUXXcsMe9l7R7MNXGzFETvgOqcXao+amWA59sIEBPaee2Tp3jUnNq+w41/ cMU4vYZAasJD3rAQxeZKJbrFz5EZe/B8SQwm3BIa9owZk3015I47SfLw+plOVk7NkE8z pJGzrW63sk8acKvrKw+ruLV9MpY4xLKiNKpHYD4qOWPGIVLJzxILTb8k3X7ipB0gLZPN /kflt+m7JX7NyAW504kZe6pbUx1aXGusMRJ2UHoHWBWGHob4u3Q393jbVEim4MRdKbsa XU/veT3sev9mZopw5UPmDoXI2E+FhDxxxYhqieL0Ar3XwWhCR+3Rya7iQjlcptHSKH96 JTcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=9uVlvuEhdIyt7XxmmLh/bbpvPT/c0iStUTIbLsc2y5g=; b=wXUvQR+nfvMpM9CNTFz7LJhl7UipgqSoh/Va6QP+L9xVt5y/KxbLETRpv4vNxWWl5H GHNxoY7Be3bQ3xBv6cQjaWCzmTGjpUFb//EUzTLJ2+kxZejcXN53J+QG664UpNdnC6t6 o54OKMKQtrk1xNboIFzcqGcwchDtbxcrYxJiVe1tVLgcys6+zyJexRRyRH9hNBWdjP49 TK8jzto0chAkbu8IopCUhyc5lYsYStyn79TRnmdiv/sKI8Iq4g6Cu9AnR6eEd8zvdtsW mBUZQVVN1gBAfHLBJuq9TbcJ4g/I2YGHZrgWFsRceij3zHoyGvnwGeBISTZ1YzzO4rlD SdRg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=hisilicon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t19si13123342iog.66.2021.05.24.05.21.08; Mon, 24 May 2021 05:21:23 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=hisilicon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232327AbhEXMWe (ORCPT + 99 others); Mon, 24 May 2021 08:22:34 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:3929 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232300AbhEXMWd (ORCPT ); Mon, 24 May 2021 08:22:33 -0400 Received: from dggems706-chm.china.huawei.com (unknown [172.30.72.60]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4FpbpD6ZyDzBvQ4; Mon, 24 May 2021 20:18:12 +0800 (CST) Received: from dggeme759-chm.china.huawei.com (10.3.19.105) by dggems706-chm.china.huawei.com (10.3.19.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2176.2; Mon, 24 May 2021 20:21:03 +0800 Received: from localhost.localdomain (10.69.192.56) by dggeme759-chm.china.huawei.com (10.3.19.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Mon, 24 May 2021 20:21:03 +0800 From: Tian Tao To: , CC: , Tian Tao Subject: [PATCH v2] hwrng: omap - Use pm_runtime_resume_and_get() to replace open coding Date: Mon, 24 May 2021 20:20:57 +0800 Message-ID: <1621858857-39242-1-git-send-email-tiantao6@hisilicon.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggeme759-chm.china.huawei.com (10.3.19.105) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org use pm_runtime_resume_and_get() to replace pm_runtime_get_sync and pm_runtime_put_noidle. this change is just to simplify the code, no actual functional changes. Signed-off-by: Tian Tao --- v2: fix the problem of one missing change in patch --- drivers/char/hw_random/omap-rng.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/char/hw_random/omap-rng.c b/drivers/char/hw_random/omap-rng.c index cede9f1..00ff967 100644 --- a/drivers/char/hw_random/omap-rng.c +++ b/drivers/char/hw_random/omap-rng.c @@ -454,10 +454,9 @@ static int omap_rng_probe(struct platform_device *pdev) } pm_runtime_enable(&pdev->dev); - ret = pm_runtime_get_sync(&pdev->dev); + ret = pm_runtime_resume_and_get(&pdev->dev); if (ret < 0) { dev_err(&pdev->dev, "Failed to runtime_get device: %d\n", ret); - pm_runtime_put_noidle(&pdev->dev); goto err_ioremap; } @@ -543,10 +542,9 @@ static int __maybe_unused omap_rng_resume(struct device *dev) struct omap_rng_dev *priv = dev_get_drvdata(dev); int ret; - ret = pm_runtime_get_sync(dev); + ret = pm_runtime_resume_and_get(dev); if (ret < 0) { dev_err(dev, "Failed to runtime_get device: %d\n", ret); - pm_runtime_put_noidle(dev); return ret; } -- 2.7.4