Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1713772pxf; Fri, 12 Mar 2021 17:46:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJweCOTWf9dKJVLiBQ+fOv7e+C1QFOLsMRPmVYahoopIR9Du02U+WLC4tFENmxEbKR8zPy5W X-Received: by 2002:a05:6402:350f:: with SMTP id b15mr17418042edd.6.1615599981141; Fri, 12 Mar 2021 17:46:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615599981; cv=none; d=google.com; s=arc-20160816; b=KyhcwTzpfhPVFsOr2KQQzUkRglWTJA1oOdx9+GEMHQ637Od9WKNadwXt2J0+3OWG4Q FodUfRuIxVYmRr/xij8fEt+1x1eKR2mLi9yaEtQ5oIaaoen44zpz/XAwPEOAFVWkRQ3F WFlzNUt+HJTgf8HoRgkdqSh3Bf15+KPkTSSKT3m8O28e/Jma7vP5FNmE8i6soUvsVPbV KgFwQIStafzyoP+bRBr049/oyBMcmjIDAraAakWBmbd8yfahKST+wajSf/qF5lMyPMFM fs+B+zYCUvoSgP+rMQycTj9PmG0xshnputzDsnx0jdEW1kH/KlaWJibbC4+HQq+sCl1a nbPw== 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=KhrjbNiDNGbO92wlfmUfAALro2mmRppFfFf2DFfeXbY=; b=Kgu/wqlayoV1wqGr+cwxNJgwuPRGaCD2rcMxBaBxmrfWO1TncyVljZ4svs9AR0FyWE 5bVhB5IBfaCsh6sP+mmulreJWEOKwTrzOu0axEcJJodawrfKL9/P0RdGVhPB9nceLmtC ME56Mxc7HNlKYtG2G+FipKimHpvQ/13HdtAYq1WJNmz9MXEnv/5ayNnjeuHqcZCLrC7+ /VyePCjK4xfUHfsBii+znCGqOr0oL8NNWeVpnf+Cl3c02u18VJKP5IoLsIntnWRSU0J2 g0GXqtU53G9Xz5VpxroLULfAEj63Ueh9uMMiKkf9Qbo3dLCycR8e/HmsizjUYFFeP9YF qTXQ== 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 g9si5640937ejh.247.2021.03.12.17.45.57; Fri, 12 Mar 2021 17:46:21 -0800 (PST) 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 S229959AbhCMBmI (ORCPT + 99 others); Fri, 12 Mar 2021 20:42:08 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:13914 "EHLO szxga06-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232223AbhCMBl7 (ORCPT ); Fri, 12 Mar 2021 20:41:59 -0500 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4Dy53X3wQHzkYJZ; Sat, 13 Mar 2021 09:40:24 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.498.0; Sat, 13 Mar 2021 09:41:52 +0800 From: Tian Tao To: , , CC: Subject: [PATCH] hwrng: cctrn - use devm_platform_ioremap_resource() to simplify Date: Sat, 13 Mar 2021 09:42:35 +0800 Message-ID: <1615599755-28181-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-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Use devm_platform_ioremap_resource() to simplify the code. Signed-off-by: Tian Tao --- drivers/char/hw_random/cctrng.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/char/hw_random/cctrng.c b/drivers/char/hw_random/cctrng.c index 7a293f2..e7f12953 100644 --- a/drivers/char/hw_random/cctrng.c +++ b/drivers/char/hw_random/cctrng.c @@ -486,7 +486,6 @@ static void cc_trng_clk_fini(struct cctrng_drvdata *drvdata) static int cctrng_probe(struct platform_device *pdev) { - struct resource *req_mem_cc_regs = NULL; struct cctrng_drvdata *drvdata; struct device *dev = &pdev->dev; int rc = 0; @@ -510,21 +509,12 @@ static int cctrng_probe(struct platform_device *pdev) drvdata->circ.buf = (char *)drvdata->data_buf; - /* Get device resources */ - /* First CC registers space */ - req_mem_cc_regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); - /* Map registers space */ - drvdata->cc_base = devm_ioremap_resource(dev, req_mem_cc_regs); + drvdata->cc_base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(drvdata->cc_base)) { dev_err(dev, "Failed to ioremap registers"); return PTR_ERR(drvdata->cc_base); } - dev_dbg(dev, "Got MEM resource (%s): %pR\n", req_mem_cc_regs->name, - req_mem_cc_regs); - dev_dbg(dev, "CC registers mapped from %pa to 0x%p\n", - &req_mem_cc_regs->start, drvdata->cc_base); - /* Then IRQ */ irq = platform_get_irq(pdev, 0); if (irq < 0) { -- 2.7.4