Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp3506330pxb; Tue, 7 Sep 2021 00:43:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxTsnAVqm3sR0C4eLbRc3vESrFHu2f07gYpDfcaE5XRErqlnE4SK8/LLFXTH/5fCkxfy0N X-Received: by 2002:a17:906:b1d5:: with SMTP id bv21mr17434880ejb.346.1631000632995; Tue, 07 Sep 2021 00:43:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631000632; cv=none; d=google.com; s=arc-20160816; b=nnCmKec5F2qoEGQvLEBKOc+DPFZo4VYAxK9KX/xfCQ9VjW39KJN2T3w6aG4yU597yp KG2CdTZtNW1z4YIojS6+j/x5gV0JNqejipdJcxtBA1jKMOhzfqqcJTca/fZ0sTXu6FFJ wyJOuKknaWqCESutzDdmCil5dd6QOYviWLauOWEyJm6mJNV6vvGEk42mSq7R3O7SbfN8 wKWseRZhLo8aql22Rc5TGVMQ8/LyNwsG2RiN+sT2CBzEXWWLVY5PW7go7RprS96UjjLx OjrF9QEbsps5HpLSYpmQPPtsyCKx56BiswiJ2T3oADlDQkkp9wDLy9VFsUckDpiLFoU+ aXaQ== 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=zxjv5SbBS3H8aHpNYsRNQxwR100FQrTC7GSsTPQ8zwY=; b=kiybZSQ3eeGpgcbm8qx65prRe9EaJCGMpU/jcyr72kbUqvyNUBFbHWh2MTjgWSJzi3 BtJXIz4sDPQl9cLVPZppWDxNQwJPr5W7IOHXvRbP9Xl8KINKuSOqApblH0ahgiwQZCHA UFaNozFSG69xqSZ28m3MIqUpb+jb9w8h20cmcDC3lwPgpUs1FLtsdRKui/arMFUuIOGX znGXBVRyHoQ3UfcYDXvKgy4cWgtbMn11Ln2cGNBj+RjkLuct5odQdAzz6H7g40Q/rLMs ZqanOExRauTcFE+odDUKWGbYdwiTSq+ccR4Q1UGtTeJCxymgtqkvwLNl7XMqeG7P1QiR FwKg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 v9si10545374ejk.496.2021.09.07.00.43.30; Tue, 07 Sep 2021 00:43:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240073AbhIGHm1 (ORCPT + 99 others); Tue, 7 Sep 2021 03:42:27 -0400 Received: from mx21.baidu.com ([220.181.3.85]:43564 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S240031AbhIGHmZ (ORCPT ); Tue, 7 Sep 2021 03:42:25 -0400 Received: from BC-Mail-Ex09.internal.baidu.com (unknown [172.31.51.49]) by Forcepoint Email with ESMTPS id 24C9E6A0FB6738AAFE7B; Tue, 7 Sep 2021 15:41:17 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BC-Mail-Ex09.internal.baidu.com (172.31.51.49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2242.12; Tue, 7 Sep 2021 15:41:17 +0800 Received: from LAPTOP-UKSR4ENP.internal.baidu.com (172.31.63.8) by BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Tue, 7 Sep 2021 15:41:16 +0800 From: Cai Huoqing To: CC: Jassi Brar , Subject: [PATCH] mailbox: hi6220: Make use of the helper function devm_platform_ioremap_resource() Date: Tue, 7 Sep 2021 15:41:10 +0800 Message-ID: <20210907074111.2196-1-caihuoqing@baidu.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.31.63.8] X-ClientProxiedBy: BJHW-Mail-Ex09.internal.baidu.com (10.127.64.32) To BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use the devm_platform_ioremap_resource() helper instead of calling platform_get_resource() and devm_ioremap_resource() separately Signed-off-by: Cai Huoqing --- drivers/mailbox/hi6220-mailbox.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/mailbox/hi6220-mailbox.c b/drivers/mailbox/hi6220-mailbox.c index 560cd09538b1..fca61f5312d9 100644 --- a/drivers/mailbox/hi6220-mailbox.c +++ b/drivers/mailbox/hi6220-mailbox.c @@ -264,7 +264,6 @@ static int hi6220_mbox_probe(struct platform_device *pdev) struct device_node *node = pdev->dev.of_node; struct device *dev = &pdev->dev; struct hi6220_mbox *mbox; - struct resource *res; int i, err; mbox = devm_kzalloc(dev, sizeof(*mbox), GFP_KERNEL); @@ -287,15 +286,13 @@ static int hi6220_mbox_probe(struct platform_device *pdev) if (mbox->irq < 0) return mbox->irq; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - mbox->ipc = devm_ioremap_resource(dev, res); + mbox->ipc = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(mbox->ipc)) { dev_err(dev, "ioremap ipc failed\n"); return PTR_ERR(mbox->ipc); } - res = platform_get_resource(pdev, IORESOURCE_MEM, 1); - mbox->base = devm_ioremap_resource(dev, res); + mbox->base = devm_platform_ioremap_resource(pdev, 1); if (IS_ERR(mbox->base)) { dev_err(dev, "ioremap buffer failed\n"); return PTR_ERR(mbox->base); -- 2.25.1