Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp3525852pxb; Tue, 7 Sep 2021 01:17:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxf/sauk7H24CPoC0M8pAIRbQA1Q2svPUunjRL8SSk8MAjkG6W0/DJT+bPx5VEA0NgR0twv X-Received: by 2002:a05:6e02:198d:: with SMTP id g13mr11242255ilf.319.1631002667144; Tue, 07 Sep 2021 01:17:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631002667; cv=none; d=google.com; s=arc-20160816; b=E/agf9iVODBVr8751yTYVJKIcSQ99Bu3WPWWvkU/vsafL+mGEkFEwuT2yZkS7wDeSH TdFrv0oUVFqe20vb8vx1H13XBqRiXY+NHfd426tZKwKnGHFw8noqAV/g8EKKjyhxDL0g AnTEWFm7XEKU8g5OAsO6nop6Ydz9AT//WRBSmC+EOqbcTIRnDu70YIra21fJlPHizK6W DItT/5Mc1oc6/WnH9dSIwmpdTkbp5/dJSdXTTeFs5xYooh/PnJC8gl90CflF7HSD8ilT 5YXRwAqAKNkMdJ2coGTm3pn/mucSKjSSqj8edZZuPLsTErWZEJU1tFquINyf/dWojS3z 7HYQ== 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=OuS9MAR90WofN9wT+WwARRmYp8sJicxcLz6XG9V1r7s=; b=fYkOBKyroksb9pS3YjxkdF/1/wA5GXOLDuzlbQN1971QoB7ruZOnJeAhadWDhGhg92 dZuPIQ/AOaTjGaCbCtvCJkBqZdaiEe7nmtY+IGID1ajQGPa7oBA+oU3IaJFXcOcJ/9G5 ODw97gZZOzx77KcgHcIl7epeF5TP0xt2KG7JaZID/UH2RAa8VlARpLHQfoJ72BA4OxU0 zyU/gA0xkijH2bJE6oNOtinmT8/AFxvvQSrsH9DBHQebMTAXQfMoc463Oxbsynqeyfyb GBRLg6L8+bL4W+5LvwYI1hgIlhUXUCZXBPEBVkaa5fGPMz7/+3mrEq57woZICsxcUV9h LcyA== 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 v18si10016920ilj.94.2021.09.07.01.17.35; Tue, 07 Sep 2021 01:17:47 -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 S241504AbhIGHoE (ORCPT + 99 others); Tue, 7 Sep 2021 03:44:04 -0400 Received: from mx20.baidu.com ([111.202.115.85]:44732 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S241126AbhIGHnO (ORCPT ); Tue, 7 Sep 2021 03:43:14 -0400 Received: from BC-Mail-Ex28.internal.baidu.com (unknown [172.31.51.22]) by Forcepoint Email with ESMTPS id 6BC6E84BD3E1C14A2EE7; Tue, 7 Sep 2021 15:42:07 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BC-Mail-Ex28.internal.baidu.com (172.31.51.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Tue, 7 Sep 2021 15:42:07 +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:42:06 +0800 From: Cai Huoqing To: CC: Jassi Brar , Maxime Ripard , Chen-Yu Tsai , Jernej Skrabec , , , Subject: [PATCH] mailbox: sun6i: Make use of the helper function devm_platform_ioremap_resource() Date: Tue, 7 Sep 2021 15:42:00 +0800 Message-ID: <20210907074201.2553-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/sun6i-msgbox.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/mailbox/sun6i-msgbox.c b/drivers/mailbox/sun6i-msgbox.c index ccecf2e5941d..7f8d931042d3 100644 --- a/drivers/mailbox/sun6i-msgbox.c +++ b/drivers/mailbox/sun6i-msgbox.c @@ -197,7 +197,6 @@ static int sun6i_msgbox_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct mbox_chan *chans; struct reset_control *reset; - struct resource *res; struct sun6i_msgbox *mbox; int i, ret; @@ -246,13 +245,7 @@ static int sun6i_msgbox_probe(struct platform_device *pdev) goto err_disable_unprepare; } - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) { - ret = -ENODEV; - goto err_disable_unprepare; - } - - mbox->regs = devm_ioremap_resource(&pdev->dev, res); + mbox->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(mbox->regs)) { ret = PTR_ERR(mbox->regs); dev_err(dev, "Failed to map MMIO resource: %d\n", ret); -- 2.25.1