From patchwork Wed Jul 5 13:04:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5p2O5oms6Z+s?= X-Patchwork-Id: 116127 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp1859191vqx; Wed, 5 Jul 2023 06:13:11 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6QHIUCwCKX8+DHu8qBGTp6JZCW1sXRBDROzzMyiAip/CgwFgUbG2B6LCKlh9f7bORNgSsG X-Received: by 2002:a05:6a20:1456:b0:122:c6c4:36b1 with SMTP id a22-20020a056a20145600b00122c6c436b1mr22285542pzi.4.1688562790807; Wed, 05 Jul 2023 06:13:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1688562790; cv=pass; d=google.com; s=arc-20160816; b=QHEY7lZtHxrJVoFOrdif4ymLAgQX3NS6m6nmoCy8MbaKLBGixFD/ZjhmCL6ZeRkWzN Byl8EHLK+ApktiRZUeX26I16gZ/qLSnCMZO8oby1TXgxK80p5vE2gI1DEHdFuz64Lw6J NcKt0VuzJ60cCxRuA+lShUNUBwAcaFMPioYqgjfAQUw4ua6KFkYGJZMfY/tTuAb8YB6K aY2FisS7vbReU5in8Ir7jmF3DnSkyMhieI6vnNV66jqiC8IwVcCj99exsFyvrRX+jEjE t0ZJYtW5ughLyagXBELdPYtDQq5CRpqkC7CSv3A3w9hvt75GVlxoCMxviAg0vbeKWRJS 3xZQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=pnZrRpWJHfvggV9oAys2Y2gnnknH2ZnzOeA1IXV7vWg=; fh=TZcaVoTfwTeo8NC4VyhaKcYYYgJom7mcEXG9/7byf3g=; b=HwIwSOcBQysZ9RemKMB54em5rUwdFM7tdFRL2HNlP/75EjH4irk5+M5S7ek9xtXPze QWgDbHpHD+Ufn1470lnV6gPCEYjJ+JbNv5PaPnJ6xOXRilcQXRYz5EpPtP1pkeigmjoO tQoNkOOyfuFrjfkTF2jbqIc3KAoZaRMbNfE9kNmDtHc/CdzLtoU29ir7C96MlRIk9bRm J84uLXBNY88lpSsl+rVMVt/DWRzxspUjWD9GEU3VDIcaefI878fZRCShAxn2Wf5JFPWN VwNn9AYTNM+mbqSnvVrME6voWuw+3H/knln3hHMI0Rz7ZbQaiDm/OSAEpONrKAzwUBIW I6XQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=lkuByXzI; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s10-20020a056a00194a00b0068094fd547esi16765712pfk.99.2023.07.05.06.12.55; Wed, 05 Jul 2023 06:13:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=lkuByXzI; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232102AbjGENEg (ORCPT + 99 others); Wed, 5 Jul 2023 09:04:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230100AbjGENEe (ORCPT ); Wed, 5 Jul 2023 09:04:34 -0400 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2102.outbound.protection.outlook.com [40.107.215.102]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F197E3; Wed, 5 Jul 2023 06:04:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ng65VQxeHtYjR+cDaSX9KHUYHuvun34DBqOwgXQU7Lt6eIN8bq8ip/AkhaoMYfnMIUQHjzdEvtKcEYKI9IAMn6cCiBxfXJ2TG/iNis8zJ5Jgg1Ainxf+hiReAbLhZiUJU52rucYEJydES416s+j51W/q+4BNRznp+8nX+ZR1UvS3ZBCKqPVEr4MdwD9ML+1RWhtcwpwRLD/9H7qvezXSzkLcOAiQp9HYtcTP+7MopbxMvYiwr4F52zjPuXSZCCAl7h7DpX/1OcFi8N5vgT19QJp054Bq9oFbg3w9/QwkXTPl0XLtk6FYHMa4+6Xp6GyWUpLZcUKxXHutVwJVvsH7aQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=pnZrRpWJHfvggV9oAys2Y2gnnknH2ZnzOeA1IXV7vWg=; b=oZcmZUe0bNXSI/qaIaSECmnIw+1yGJ8iuS9SBXwBnqISlJXSxcx592EisE0s4oM917XXjcRilNdpAlilh2l+PPP24fIpO4MXmUPjInvJfbrh7xuPjYiEMaW0L40ocbVxQhyZJ5rEDbdhyr3//oCmYDrAJaaYiOkdQ1c31TLxybd3Uh1I6hP/8UGIzjT7wearEA3zjAfXrNUTkQF0QaFxY64ZleIM3Qawo00DX2D3MyYKjoHIn7Zw4acr55imejDHOtycbaxGADv24+hGtIutCdDGaSZZ+3nofnpe4/r7KXMF3Zsbjl/kpJGuNh4Kt8uEZYjl6Y2+dtQM0xNz0i4Rlg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pnZrRpWJHfvggV9oAys2Y2gnnknH2ZnzOeA1IXV7vWg=; b=lkuByXzIUjiDk8p1zQn3N9Oe+TuuzCboow58qEeLlqoyQesGT5v1WBbV15s5jGNhh3vkvq4S0FYDa63j4v8SX6+/dMaElaVJoCsrmvc5Uh5HHVCdNHvHZ1QFgjtPNMDHNu0dN/L3b34DC3llEGDFBaq+du0t+vvGO1o7Sq0EJ9JrLfHl2BDfYjwzDtycmAjwo9NGVUXhLWacLnEtiwiY/2+c49rvERe4iUA+glSn2V+Pk1GwQ/450cFnP9/XuH2ohkruMevanMxIipfiPzqBRCcd7bPRsJ/ZmUDnJHIBiX/8dZEUALR2Dq1WOclREF9jakUV3fmSv/dmJ0r4ttGQ1Q== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) by SEYPR06MB5891.apcprd06.prod.outlook.com (2603:1096:101:d4::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul 2023 13:04:28 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::fa0e:6c06:7474:285c]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::fa0e:6c06:7474:285c%5]) with mapi id 15.20.6565.016; Wed, 5 Jul 2023 13:04:27 +0000 From: Yangtao Li To: Rob Clark , Will Deacon , Robin Murphy , Joerg Roedel Cc: Yangtao Li , iommu@lists.linux.dev, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/6] iommu/arm-smmu: do some cleanup Date: Wed, 5 Jul 2023 21:04:11 +0800 Message-Id: <20230705130416.46710-1-frank.li@vivo.com> X-Mailer: git-send-email 2.39.0 X-ClientProxiedBy: SI1PR02CA0057.apcprd02.prod.outlook.com (2603:1096:4:1f5::10) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SEYPR06MB5891:EE_ X-MS-Office365-Filtering-Correlation-Id: 05494a64-9f56-4433-052d-08db7d585ca5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: McY1nBu9v1+QdlZc9nLlEK5JlKXs8ldPk+iprhqABp4nPrZlxmY+EaQnE9xOGYKsNjZsGLEIJfY1wG9UiQda4aABUVnyX8dNGCY04meuraykgVcbsE+ci02N3w6hM8VqoUa3gQAmT6UBmAdGF2PULI2/bkPmq3rXSYb9hwqTt+GmKZ2D0zwBpBDurYwu886kwpSLlxlz6p3RCh3uhnHOSJa701yRSRzT9qCkswNAc2xLD/m4ZxySR3g/VhBp4eBbE1+DxDFn17ygHi4YTqNDSNN0hy0p90P6NTTFTUn4f9fb+B4V0sa9QbKnvrR9lg94N+mfPnh/vy4StDYCqqOZm2ycPPFjD8KDQo94AdUn2E3uxe1FZPDrz1VJtQ4gtXDPgiLwJoLZVjuN/oiyEAOK2u079WEbJFdl48/JwYbLQg7rwv4+yxG7aOzrcL7o/pyK8pgvPfRKWTf6HMCPdkGXMWtUnsTpaA8QJh0U8Z3vnixQKLKhdtfmcTbb757vsaj779iYVWrkd+Jer+GKKMAWbMfRScxDEdze9YkqbUGa4VqlCQg0f2N4u68/0gt1S/hesobzcP4t3wppzlnxA4MuA02O2h5H9+5hZl8v9G9RPR4LAhfGfdZbxKVZa1HYd2p3 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5269.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(366004)(346002)(136003)(39860400002)(376002)(451199021)(478600001)(52116002)(6486002)(6666004)(110136005)(66946007)(186003)(6506007)(1076003)(26005)(6512007)(66556008)(2906002)(41300700001)(4326008)(66476007)(316002)(5660300002)(8936002)(8676002)(38100700002)(38350700002)(86362001)(36756003)(83380400001)(2616005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: z19KsaawN9vhDVn/lRMe8cJUhv+MSh/xFLl+f9pllhSleeJsRwJcD59LANXm67IqJ1o5a6l5ydt7U3dLd9tag4EIzmUjAOEmCu4iTjN+weyakB8EQ7kTqxijW65nl1x6L4l/52FXvMKPqG5R0J+hdqKQM5BFQoZdX2yfk8g54ajyt8Qqg2B/IMWoDjziZJ8pwGnR4gift5sOvc2UevXyz9X6fdi1lJwT8zQ0ZR9+b87qhgZG34YGxNSGq/+z1R6u3+H/9NhAdiSTMXmvLktQq9it9YRZGmKAk2bPsmHyeOOu4uhSyTc2U0jF4P/nFUOoQCmUQj32rYkOd21bXprBrSTe/yefZ7KortSbTKqQe6KhLNVxN3wEGfaVDhD1+VtvJRVLuHpee8WYH5t8kzgkShoOO1xOK1aRuLEDqhzjJCc8tYcZqeTWfMo/K4v2hdFWuUVot+KiYi9t2cEU/j/0KO1iYhl4PMxLMoP6bqQbN6uCTRTAaXLm7Uu0m7t7KxQQhIWIoPmI0Qe9ZJB8+9n42uWOVuZQDW9vo0VNwi0tZhkDPVCuxiPtwCybOaK451IrwTuos0ZV5f5tMNW+hY3lFECZb84smLd/H2vTPQLNBQFZ5ExB8iBJKhpACYRO43NWKj35kZ0i4f7kreVL1B+ipwrvH3PXgNJR2AR9I40xqGe+d1MFo+lmJvOBI+Yoo0q7FV01VKVgn5miHlI181g9QEUUl1K9ntqPEKx62G4zCBEF+2jfMJd6oSvDFSDDOBrCJsABzYStG1yBSGWpdJ6OcYYypgre+ed/6B1GAvOLy/Msj2Lcnp3HTcXwRqnT9w1nH8SkoCxTBlJPdf+Sy3rG+9a0mMVoiNAU16PNhXiX6KFEgQCiA5EJjbil2xVB7nOG9cKcSt5UjHGCmicOtwzgufQO6aOmRGtXYjbHlUWuK/41Div5LZNY9LZBGmujO3USxPxKTwO/lKsIs58ul2rwFlFsgvrwEv8jvQrbn9ISQMRyyb/f0mmKMUXkfov18686he/JmR7Ly3+c8ROtsUNWSXMm5qU4yMRiSOfubYr30xqHFAl0aIVFsvkAVR5g8vef4Ztzqo7JqlzRR6QVhctE2HsuUz8BkT5OsC6B3RwwdUiG/YVGEbEXjtnVv8NQBtD+gF+McP6KuM5zUpM435fNYkN1vKMkqou0a4LiDiWO4nPRRyskvkVSOPrjJP5AVNs0QXcff7BYgE4PsWrcBkgE46s0jUQqPqipD+R4WdSYtpMtZke9JJGci7Wye/FEsNDuv62ypMxIByEGBF2fzwH2XbNinmXd6MJrmZqUiPm+2fUcZTD1zjKV02r81DwiplPbMKVUD6LcfIIM7LztR781ochi6paqP0MoorwpyXS5rWjENsqFRNQfPWUuu+4ydvrUvWsGtexBTkIzwT98JRbHGBkznVjcl+NO+N7CQo2pfdPOt+m0ZarpDEM6UZdynBs5g+4oLOvz2hBy73OcXBw2C74Ycf+ghRcpcQXr1jrtFN7+PiM1i8LHqW33XKZES5Zy8MaX/q/9dX8/FT2C/LQIDj5g7GaRq4KgIu/th+i8pFmxUAQ5lgL2OxsFx4dBxRW7 X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 05494a64-9f56-4433-052d-08db7d585ca5 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 13:04:27.0452 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: zUf906VZk7sgv5PSHktWpSpavkwiHXL3T/p5TEKZIBRvCUj2PPgRXAQ+B6V3xOK2MjtVne9hcrm2xNkA2Klp3w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR06MB5891 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770586416729554492?= X-GMAIL-MSGID: =?utf-8?q?1770586416729554492?= Convert to use devm_platform_ioremap_resource() and fix return value when platform_get_irq fails. Signed-off-by: Yangtao Li --- drivers/iommu/arm/arm-smmu/qcom_iommu.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/iommu/arm/arm-smmu/qcom_iommu.c b/drivers/iommu/arm/arm-smmu/qcom_iommu.c index a503ed758ec3..abf798104830 100644 --- a/drivers/iommu/arm/arm-smmu/qcom_iommu.c +++ b/drivers/iommu/arm/arm-smmu/qcom_iommu.c @@ -633,7 +633,6 @@ static int qcom_iommu_ctx_probe(struct platform_device *pdev) struct qcom_iommu_ctx *ctx; struct device *dev = &pdev->dev; struct qcom_iommu_dev *qcom_iommu = dev_get_drvdata(dev->parent); - struct resource *res; int ret, irq; ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL); @@ -643,14 +642,13 @@ static int qcom_iommu_ctx_probe(struct platform_device *pdev) ctx->dev = dev; platform_set_drvdata(pdev, ctx); - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - ctx->base = devm_ioremap_resource(dev, res); + ctx->base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(ctx->base)) return PTR_ERR(ctx->base); irq = platform_get_irq(pdev, 0); if (irq < 0) - return -ENODEV; + return irq; /* clear IRQs before registering fault handler, just in case the * boot-loader left us a surprise: From patchwork Wed Jul 5 13:04:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5p2O5oms6Z+s?= X-Patchwork-Id: 116135 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp1871682vqx; Wed, 5 Jul 2023 06:31:44 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4WqRt6UAQkv1Q0dtO1yB7jZ4Hw/loFOQQgABQ8vudZTfVmvBtrgFh3ykWvSD7fF1yq9asQ X-Received: by 2002:a6b:7e01:0:b0:785:fbe8:1da0 with SMTP id i1-20020a6b7e01000000b00785fbe81da0mr16818514iom.15.1688563904194; Wed, 05 Jul 2023 06:31:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1688563904; cv=pass; d=google.com; s=arc-20160816; b=UPUHEN0tfiYzvYixhrIlGIMGeVIKmrLbbJ8q/RwoJBwVGJ6eV/0Vz13ZoUt6tPu760 FDdg4PNy3+2zlQy0O7Jvehej6o7jI0MQSOYUZR60bVnMPzGgIRS++IDAYYqHUm4KrUQ5 2AlSi9AB3H+DGge8kwHTVSaF2x9PsIl5ajMbyHqHbAS5NJspK6uecy6/v10NUdk2fs22 7sJ4dsA7oKe4sjyRsrJGcMECiJHkFDlXxCl/YITcKzESNAVY4NngV/SjNPHc6plWmr/N vvOfnaSobCKsbGhm5HP71Mpfqhg8BDZcy2Ygmp+CLWS5e5OwgesKzHugIT/J8jiUT3iL RQgw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=CAXNVLMfiMiePTwicI/t9P1S7D9m5trUOLK6R5mVURc=; fh=Ss3S2CXwMjd0HXDOplqc3YU1UIe6Opt1uXS63tK8b34=; b=C20GbhqKkZqMgtBH3edzQVTyuqklZ66vMrJvv7+TvfSirtkQMRPTJyuu6Gg0psufsU ixc/D5VahFoM2ZjoMWzKPPZWX0HIFi4OwEya2CjsJzzHCDIDSXKaifu4qDpGIu1sF7To /RD63hSl1IZi3Xwr1oj2UKx1V+LEvMLTA7FI4l5VHQfUQHe7Mrz9Ds09BSLVuwJxOyQC 09QzttJEWoxsHnpYXWTe9GTfDJmtR6VOjrUhUKhfzfpvJFuzaRIXo1NX53nvH1TTpQeJ TbNGUlGntHsu2hAeFklB87aewQhEwqXt8H0XKeuNd8jzA4A3Hi+wgH3zDD/jwil9TlcK x3/w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=dDwZmdxJ; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d10-20020a631d4a000000b0053f3e6ec82bsi22514025pgm.774.2023.07.05.06.31.29; Wed, 05 Jul 2023 06:31:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=dDwZmdxJ; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232114AbjGENEh (ORCPT + 99 others); Wed, 5 Jul 2023 09:04:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231857AbjGENEf (ORCPT ); Wed, 5 Jul 2023 09:04:35 -0400 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2102.outbound.protection.outlook.com [40.107.215.102]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C08D712A for ; Wed, 5 Jul 2023 06:04:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LkdyJR/Ys6EOdtwgQrF0F1I66TmvI5vn/2o++8DLUp3R79vEJsHmZ8p9fGLQT0GErNscYk0Wd017Jmq8Zt+F0lG7i7BIMTgjQqOdq/OKyZrPbY94vFugEwYg8Fa3xhGdEOSg3ZNlL0w1rYPpmM2I7C4PaZf+NHeb+EoM5FTKk3weWoQg9RACuGqreCZoz4IUuYEePKzawnMWi2OftNE85sXsCDU3ES13XBwlUaB0LcolEm0rL4gHgY1N0NCUdUNzMhqISjwTjgFSKBNiTCff8x4bJP4zTwlx16L+rSWLlqtsIJXFYjS1YcetbjFfGgs1LfRMdQiAONpXdFYkmGJk9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=CAXNVLMfiMiePTwicI/t9P1S7D9m5trUOLK6R5mVURc=; b=dAmJObrtmSvXqXY7HJLy5WMXezDmP1CvQspiHchNmi42Z8ZFF0O0LU3wQ46Xhm6z/uAq2Eg/Ygn9eRGflmFMivgdEHWsY9dPFNRjVDRAyt3p9OpmRGRPvgxGqKF7SrXPDmS81R5IlJSn9g/3F2flwVyH4CSC4mJ2UKk1iawfaw/pqAkrualSm13h3n77Wntch2Hh/zDQTGtA5z9Ezug2Loc9y70gDIOAwVZjRHlnYeZLi6WbSBXm0zG7HWS0gCwSVELuOBYliiWJ8RhhwrGzAvIu4nRKhn+6xDnlAbxrq76NG3C39Wi0B4K2iF7zwH1WOGiQWJ1GwcE8nzDjwhygbw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CAXNVLMfiMiePTwicI/t9P1S7D9m5trUOLK6R5mVURc=; b=dDwZmdxJfzI4221aybsUOIggUuIfz4FBpViHtIu/rNCgx8RIF6iBDB+r8v9cygIX2cA/SylJ1L3uwPodfmifyDg3XTTw+cGiUILLgWVqKGm8oKsxeVRPvTNYGSVPG0V6Nu4o1be0mA4veO+coicX0Eh9VRZKvCKN0aCc/UhiVk/i16ic8+ypp0Ta7+4YGb+lek7EY0N4EGxXX2dOebiizNZ4jKEKN//6hpwLjSi26bJOetoQOLqa9nBgKRoVo5+48C45asCoNZ2rWQ0aA5Qjkj/eXfEVWgUh7tJhTzBpJugKQQYjNnUButhEWYcyysTl8TbY7x7xjZctSMyUUA+w2w== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) by SEYPR06MB5891.apcprd06.prod.outlook.com (2603:1096:101:d4::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul 2023 13:04:29 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::fa0e:6c06:7474:285c]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::fa0e:6c06:7474:285c%5]) with mapi id 15.20.6565.016; Wed, 5 Jul 2023 13:04:29 +0000 From: Yangtao Li To: Joerg Roedel , Will Deacon , Robin Murphy Cc: Yangtao Li , iommu@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH 2/6] iommu/omap: do some cleanup Date: Wed, 5 Jul 2023 21:04:12 +0800 Message-Id: <20230705130416.46710-2-frank.li@vivo.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230705130416.46710-1-frank.li@vivo.com> References: <20230705130416.46710-1-frank.li@vivo.com> X-ClientProxiedBy: SI1PR02CA0057.apcprd02.prod.outlook.com (2603:1096:4:1f5::10) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SEYPR06MB5891:EE_ X-MS-Office365-Filtering-Correlation-Id: 07ec7b15-a600-4fcd-73d2-08db7d585dc5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vJz/hX+iiV2cTu0Qy6BlKPbhxNmMSmSgHKW2D2u9jZbptIpDH36dTzERJiPCvaaAETcFJoIGbu05sOfnJIIQSH2ahF5EKBzM5A7Dyuhy7QiN19LGCtwA4rW3P1UJSaDI/+A1BvpTYWxHDLhcXEfm8FbFOJFgkM0UyEmv9vH2ptLpytJTzcghA034WOO/F08kka2s4nhMxnqOQG/aNS3WsKjbOwllNtryIs4LlTlAXFBFm/ZyzSaoFMIAo8JlaYfgjQktZpLmDhtW/ZLAQkL2D7/ZIGYS2yBVMK6d7D7N2ctfAPs8NN+BWkIUsSZ3GsuvqrTSVmRiNvuks2T+1cEx5KjrkTae2odSYbSwqBEB1itr3wBxR9E1cJHtcmIPxv63lhj4pe4QhvWg8B1P6+HJYwNpqWnGIv7QoqAlAy1ipEtrVoJ4BVUUNSs9TgERDhqyide21eveZzarZUhqjQK1LvuOWxUQbD5/BNXTVVw0ieTIzvtVSb9X9KNJdsEgEJW7kHcwXlzzNYAyVjEkOrt1CVouenU7BYZakdHl7UVrYPqHFII7mMcpvkK4jNosabxvowPllvVGp2RGBPoKmBJ7iCz5SS7uEGsLd2lFvZjrRlrltL2T7jHhBP3+bn2J5RVB X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5269.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(366004)(346002)(136003)(39860400002)(376002)(451199021)(478600001)(52116002)(6486002)(6666004)(110136005)(66946007)(186003)(6506007)(1076003)(26005)(6512007)(66556008)(2906002)(41300700001)(4326008)(66476007)(316002)(5660300002)(8936002)(8676002)(38100700002)(38350700002)(86362001)(36756003)(83380400001)(2616005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Iu/Og58sb0R43FBDsNniJpnpZ+6SiH1ZJlyuwTfYegHBbIMJrWqoze0R6id99qadxayroQyx9N9CevLV0duj3nuAIvW12/OHs5VhEuNZ4wNtme6bFrcHpEFMBLppfqXt2uwjWlhlPKFOlC0OajW5N05ySF3ExKHVwKLyjmWkuEov821LmjneoG9Ob/MGThGmdcizr/E2mOFduhK5nT20+BCb1VXnH+JR/M7uF4aM2kaHibFA5YmzbTcHmXeAXOq7XEpVRSbcn+Va9MXSX4i/JiANGXXQHLJECFy7dmPeuf1h23cZF4I4fDbF7SiZGOUb3HOj/xjJ2Z1v2zkvm148yYoqLEPtIxhF9G6KuqqLwt/W1kojfCxcMABrH/cXYYc1WMlHcwYGt1QiGrZhmru3rRmLDF5guAIHuYAgKh3EOEglP3tXeFdg3/D3CCF9tv+DPdkt5JqITl4V0TxfMeO9VU1V+nZpu9nv7kLNbDwd0wmaI2vXL4g6jBijjaL16iE3pvIM7tsomjpbxtiB1X71TPZjePB0T1+BJgTSgkEEInG+Ru6Jv52t8SQTaei1eN88lrK5oGC898vglOhP/P4KOpACdc/vCeq+f0lNiCX1yHjVtGuh/B3TLdaGDwAhOPDUsEUO55pUwPx0wR7jGtl3WIPP3+ugZOZ9tUwsS9KueBfAPt+ZV/3LZJtSY7wDXUSoZnq908nNnKDul1xBXl33poBtA1Ya2xQu+c6s6DYCDpvX7pwtjf9uN14lDOuqlKnkQrn4Uy8/cyj2/VGvWUiHP2oxkv2i3ijsLt3GJQck6Y4+iCwl9nnkcPieDSVDRpjJ3GKYn22c9qjuS9uyci8jMh9ncOPxtPOin/n6HrpldoU/5CbPb4Dc/igyvCT/H1JQyujqaNDUFFoCPNrpxmcrZ9bYt5drzZyZKuG+AsQtaT0BwL3V/efc0ksawe95vP9yFT9yOimVSg2eNdqK6xBwBKl9+Nq89hMP9FRt6yZlq/3dKJcIGlF8hOHdFGU+vEzAjSaeJmRYue3T2qKenmx/VCuweJvTfMbFV1/M4Ej845sRKTL6f9BmndzAvI6u7TkO/hyeqw39NzFY223tW/mDwkFPTT8pXaKOG7NiGNk3Ro3poj23mfSPFgnqlwx22X32nRDQRTXRO2h5OdsKUuWFbDIrzOIwNW+aKilxUeZDMtc/6nh1wfFgVI1DT+rsd1Ql3zAA1UDlywxUH4WSgRM79JnmrP75l0RT2JiQkNlbJz/y7PZELlVYjjtjyfS6X1EhrO3+sm4bSy3meHhDY9nTxYbjCM9eY1aLjdySQ+D5Zb5WiqdaPEslllf0khwHXSmuveSqwKyzV6jP1HBS9WvtjnhLk7/mWfnP/WdflwPLMLQTceJKhKBw49q3F/enPxcWt1/U+vulg8dNZWmzs2zWqzlQ8BKWW5Kq1FMu5ywPXqY8Z1zRRO8OdU6WcGzitGkFikb+5VrDNqyje918J4FkU+QyZT4DP8mjjI2Hq8Rt7lzbVEmX8Pt+ejarQQGGq0US+zrEWJ3DyS+CZbY+GxRilxSS+RsHbLEDEIwyqYk4qQM5yn63sWF0LYcN000YTkXq X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 07ec7b15-a600-4fcd-73d2-08db7d585dc5 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 13:04:28.9076 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: IU/o1nQzrSun1bSAdPEjhgK0pj6nXF+icnvUTTZEmWH5TcInJWsXMODaZlWRZILneOdTmlNaHGwLL+RdsmajWg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR06MB5891 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770587584658918680?= X-GMAIL-MSGID: =?utf-8?q?1770587584658918680?= Convert to use devm_platform_ioremap_resource() and fix return value when platform_get_irq fails. Signed-off-by: Yangtao Li --- drivers/iommu/omap-iommu.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c index 537e402f9bba..ed4a29478473 100644 --- a/drivers/iommu/omap-iommu.c +++ b/drivers/iommu/omap-iommu.c @@ -1163,7 +1163,6 @@ static int omap_iommu_probe(struct platform_device *pdev) int err = -ENODEV; int irq; struct omap_iommu *obj; - struct resource *res; struct device_node *of = pdev->dev.of_node; if (!of) { @@ -1205,8 +1204,7 @@ static int omap_iommu_probe(struct platform_device *pdev) spin_lock_init(&obj->iommu_lock); spin_lock_init(&obj->page_table_lock); - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - obj->regbase = devm_ioremap_resource(obj->dev, res); + obj->regbase = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(obj->regbase)) return PTR_ERR(obj->regbase); @@ -1216,7 +1214,7 @@ static int omap_iommu_probe(struct platform_device *pdev) irq = platform_get_irq(pdev, 0); if (irq < 0) - return -ENODEV; + return irq; err = devm_request_irq(obj->dev, irq, iommu_fault_handler, IRQF_SHARED, dev_name(obj->dev), obj); From patchwork Wed Jul 5 13:04:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5p2O5oms6Z+s?= X-Patchwork-Id: 116130 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp1865735vqx; Wed, 5 Jul 2023 06:22:16 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ57kTUj8z70ta0nyH/TD3kIsNOZw5x4BLp+80btHSET7hnyLqpZQi3x//7q2rRTDGBh3VSa X-Received: by 2002:a05:6808:1786:b0:39e:df4f:e68f with SMTP id bg6-20020a056808178600b0039edf4fe68fmr16719018oib.6.1688563336244; Wed, 05 Jul 2023 06:22:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1688563336; cv=pass; d=google.com; s=arc-20160816; b=xhWWC/ZXyPLIr4VzJ05pLzYtAKflSpDRNSMcCg5TVyyrUEknx0/s7L3NNR/lfKrSZE HbaFTLb2SUV3j+zGG8gy8+9ia5c0oV1Q0A6+i4FHKgLodCW6qXA6PvjGZizoxcnPqgcu T4z2QPjou7QBxWNgaMMA5foLI/cI5E3dmmlC/+/6CWFtMy6g98OsT0LmrO9PRv8HsmMk mjhF+4yP6yYDs7XwADLeyp6eKCHE4KIWPbKn5TZ685F59CgsEqa/PRb5xTK/LvUOQUxJ YzTFEUgGFc8AuQmCLflQ5Ikt40/64zSNqSJIEBKNY3MB4l3mWL668lOJjxYBCJ/sPuUq 2DOQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=v2vDKdTnYEZ2BkR7gpe8HiidFcsF9ao4hHyBZX9JBic=; fh=ToHs2YdO86XnoGUFT0TnFHGvycWAf+fUWFtvvtfr4uE=; b=apVXdxaCTnaI2f2Q/Ecla2wyUkxE9Xrnt8HeA2Hxuiemx0WgjiYdcaEG9tUo+J8PO4 z8/v8VGGrFWrwhTxLivtiKdRAyT2LwIRVJpIZgf9W3BgLeoGRbvVscMfQs7EH+sFE3TL HU3ptMesEvgzd+XXBT9gTeymeyDaXWbxK2zvvKPAPgVZS1KNToeLI0UH4Ee27Az/cQqA gODtCFNZU6GNPrheWxkyMbxX/hEN0KMTPE/xxEx39hd7Dnm1xAYR+0yP2EDX38qG/e9p ER/D32APtASv5/fFtUZxvSp2MO9MV076mRlrWk2X/bqCY7jydymfL0hOW8Vf8eq7+rZu riCQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=C4SgY0eP; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n188-20020a6327c5000000b005536fc5187asi22620989pgn.47.2023.07.05.06.22.00; Wed, 05 Jul 2023 06:22:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=C4SgY0eP; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232125AbjGENEj (ORCPT + 99 others); Wed, 5 Jul 2023 09:04:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231204AbjGENEh (ORCPT ); Wed, 5 Jul 2023 09:04:37 -0400 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2102.outbound.protection.outlook.com [40.107.215.102]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 031DCE3; Wed, 5 Jul 2023 06:04:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hsRP8ff67lywLfBG+T5ZDDY+h2CljiS+Ib0A08t8wUR/bQvsjaQhL5QZ+QIRTmcJ+Yc3XMLiYDbmB9gt8sdgbapr24CaQOnnWQvd3aoj9gIc9qRHlgBlbLCfneLZDq3pmgiNwIsUGjBoImjT1/q8rtwGxj5mu8ysA7za0wWpw3fvjJWtoVStyfA3Uo+YNmgRZXOgjSw922LNeAdy+6KUZojHoe3ukyeMI+m3ctkTst5zJL/6aXOjfDw1z8UPOcdGzFKizRoDGkxVN/Mzl3RMbIySMuXfU3R3h+P9oYAF20F3zXqVt2oDMVQi+eV0vAMkV3EAwFfZpLO3BQ9AHuCtCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=v2vDKdTnYEZ2BkR7gpe8HiidFcsF9ao4hHyBZX9JBic=; b=A6ufcOMdqPrkYJ+YyJfqhGHOgyUfeVAZWIsZ624EjFcHmDJTeEeNaHPI6ejCwLEK0rutWVjE7KnGK6RcSFGvuGl2Zsw+gbEEU/nTKh9PIs7/37by4vdIwryBks4T5ZvTtSp4TVJjCneS/Y4IURuElU/ikBzWjUiRhdmjsnEn8nlMZjb9Zbp6y7Y5IwhKgwTxCxQbKzDKMwP5YedHc3nq1CjdifVqL45hw2ENwufZxpCaMpkNEyUqI9MVYWOhJuHhBujV0yItsJV9MEfc97UIs0PoJlxD4TcXJFterJ81AOsn6xKwM2G6uGWdH/OV5xwoBGBDK5W6cFYZaC8t5Jkigg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=v2vDKdTnYEZ2BkR7gpe8HiidFcsF9ao4hHyBZX9JBic=; b=C4SgY0ePnzHpVPIKcLrIwFdLEIDZB4G50b2gFAW+i5s40JosCvHq/yb8nVdCo2EoF3tZTcUhN7CfaR6hNExgVsnusn8hZ042SdYqHqcqeXtm4fQX7YNfOLdOVDA+RTE7P+Dp9VEV173Zn0OmTgBWTu/G2U5wMz2KAYVx3pWNCTKMt60IplVvla2Rnevl+wqWBRDfYfLyidEaUTA2BRd6k8HRVQZKPcDRvAsobhagn2uBqCBjhhsuxhiNBzzoFxpCAsX4YuPIu58BMReTgv/DNIrofsZGBHB37FGy/DBVQdKYShC2PEtzgQFTcKGxQqqCVK1x7VJ71F5E1WP5Tbv1Ug== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) by SEYPR06MB5891.apcprd06.prod.outlook.com (2603:1096:101:d4::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul 2023 13:04:31 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::fa0e:6c06:7474:285c]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::fa0e:6c06:7474:285c%5]) with mapi id 15.20.6565.016; Wed, 5 Jul 2023 13:04:31 +0000 From: Yangtao Li To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Joerg Roedel , Will Deacon , Robin Murphy Cc: Yangtao Li , linux-arm-msm@vger.kernel.org, iommu@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH 3/6] iommu/msm: do some cleanup Date: Wed, 5 Jul 2023 21:04:13 +0800 Message-Id: <20230705130416.46710-3-frank.li@vivo.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230705130416.46710-1-frank.li@vivo.com> References: <20230705130416.46710-1-frank.li@vivo.com> X-ClientProxiedBy: SI1PR02CA0057.apcprd02.prod.outlook.com (2603:1096:4:1f5::10) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SEYPR06MB5891:EE_ X-MS-Office365-Filtering-Correlation-Id: 1070cd5f-4988-488a-7464-08db7d585f5f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nqOmhLZe1CiQ9ZIFG1ZlOZjtBhiot6PcGs8zqcZZXRIJK0gjfiwBtzkBJCVAD9BziHih8kOEpRqhDvKYCnoF4zEPILx+ZTPlmMVw/o6ouPUlsSzgImK4p3mv+SFWaTSucCwwSXba2lcZ83n7xzZvEFSqPmC+8v4VzPcxEA1I7CfnrOHvsL3vRT9Bvb95JifdmwgOln0ckmVuTeAlV8o6lp4whuVN6eLJ99VrELE+OzbI27P18EtKOZjSkZVWMJgW7p41FPfAek2RK1M2Rgp81fBphN84F7qeEwx6WKFw+qOec2FppvOrbYo2YV8w2nRTC3+xAK4KYC+Al5OBP9ltxJIHWrzsGmKp4IE+IyousrfpR7Zsl4fiMww5oW+yp9vcMTOOQN8zrY7hDdU2h9L22a2VD8lWZJFvhIleRhQRmeHOQij+U+adimG6ts3VUMLVzGGBuAG3PQ7cFEX3YgsGy5Nov2a+u3PCP6x0lsUneADgWv4fOVNVf3R9lAEudecOQ2b88KtQMiK6eUG5Oy4/8jZ27Iv6ozpiLZvh/Bvj0qa62knMOyzrtTOLDuYtzlWF41aDDpQzGJTXCAF/qSYegPM53Jl/a0+HVuZ2s+0+al7scKCA3I7QXDm7Kefik+wp X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5269.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(366004)(346002)(136003)(39860400002)(376002)(451199021)(478600001)(52116002)(6486002)(6666004)(110136005)(66946007)(186003)(6506007)(1076003)(26005)(6512007)(66556008)(2906002)(41300700001)(4326008)(66476007)(316002)(5660300002)(8936002)(8676002)(38100700002)(38350700002)(86362001)(36756003)(83380400001)(2616005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: pIYm9A7JBM8BC/Mv+30WTXXq5+3g5Erajf/fgcvaqBAqzioWgWNKkztSHQ29FszaXf9Du76hIREw20bo3lgDctB2goGaCNYypSpn27Bn1caYvEdVUJFxKUqZv5WhvZvfDoIu41ArEgunosWmyIV9JTrq/LzP6201zJXzPByAO6LDUO2Qha2zCg2HhViqcpz8eArkf+D4XvlL9VoY8ZTRoJVG9rlmHtK8FAFWkpPILpJIQGFzm5k/T2OK8OtQI8mYW/2j1RxlSpYYlogcqjVTnFoQXpEoCpqKHhMRB8Rz/R3QyqQr4nwgM8FKJrjcl50zMYkI/kP+bfulViMvpOcjB5sKEvMhgHM4xi9Q3UE19Q8b2U3uglQoOTB6Kp4XJMKqwuOKxJvH/EXThZnaFkYTSbOyJt58EYecmJVk2l56cNx2+WNvQmCedlt4WSq9VZM5PXhuuh6TZY0QNmKFN604h5vbp7HCYCYYWe5r2I63JlO8bdeIJLtrCMjJZlaTr0p1maZYE3jBMt4KOIpcFpoJwpQbTfOMCFIlomS1GLXkXehim/perDcinPvjah7XoKU75MQhtUCX29a5zzzSpBfhJ5qQnq2QXjRn/jpgAt3Ay4cVTlV4dkqzLhbBbEIpbouAbFoedg0hMK9ROPfl6olONnwMf+QMK0T9qYc5sAZNDrG4cMiisaCkDhpT9nHDv4c570Xif82se4+cg5VAsvwxOcomy6kEFBjBj9SDRTsHXu8K/++Yy8LChEMvPY3Erhk77YKHEmpy/gi5x1MqNNu6DZi+JZfqw/XOmIeZ3CJpxF0p3XUJrTuBeQPY/yAFuMUZRQJ8TX7eeHp8oU2Vv0hov5cL6njvoO3bPqQ7iR6cD11w8qYT3t9DvZToa/YnbOlUfimaHZd5WUuXxdsNwPoaV4fYzQh0ePgZJYfLln6mGB/wHDdjgW+COHkWM8RrhtLyxxK1uijZmeGagZQpEJlbLihGLqYoh/QIxNKwMemrnIixlKglP18IrIzkXQ3mcTGuPF42SjaGtUxi/Jl8EUAOWgccAp83EBcYsBtHNT807oLbdchBM7dIgjzfQkGa92jbMBUnaefJdgKldEqyDZUoeecbsXvp5ZnqP+MC3Gr7Ay8BNzkZBn5Bg6KOr187eUxLDdEvq8BiS2lF993RdcLv2hD1ygepQ0mnjRKa7vBi/zx2TSThutSSiRbJW9O0nczU+lulYO/m5d9nreNdDN2p6keIcFj2ROHTFDT7nEeu7MRyH/XwOPPsRN+LkrwOOrHY83QH/4i7ID1cgDGo3LnEH7RB1EzHdpTEt5jCyu9cUc2QYfBHof5vpuMdE7SCminY8Of3tzey/zYcoIkaApxpKHXhUzaRktUZUjdL4fPSR9miLguRE4DfxEK1RsqgKs8EV85b30xF4ZRgBP+MSEmZ2HJX8BdqZblw99Mzo0GzeFukGOKt8f7/0outtif4y7MCYkasQRWgAZZvsJgOPllL3E1FX17f6g1dRo+O8bhVTJzizAa8SF9KMJ63tknmP1IPOsOjiPcFN24ixm/xb56n6LqfgSGzZ2bzFrFsNKfqHIs7fgrE+7lnFcHAea9cdSEu X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1070cd5f-4988-488a-7464-08db7d585f5f X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 13:04:31.5840 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: jvuy1nYgDe9VEGZ7Z5FfJaDK7LBZh283gZxMoG8eSYbkhz1RCHvg8P7dm1UIutw9TB9ULIbNSYH13B7N9OUejw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR06MB5891 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770586989137279444?= X-GMAIL-MSGID: =?utf-8?q?1770586989137279444?= Convert to devm_platform_get_and_ioremap_resource(), remove redundant msg and fix return value when platform_get_irq fails. Signed-off-by: Yangtao Li --- drivers/iommu/msm_iommu.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/iommu/msm_iommu.c b/drivers/iommu/msm_iommu.c index 79d89bad5132..349b46b4b714 100644 --- a/drivers/iommu/msm_iommu.c +++ b/drivers/iommu/msm_iommu.c @@ -735,17 +735,16 @@ static int msm_iommu_probe(struct platform_device *pdev) return dev_err_probe(iommu->dev, ret, "could not prepare iommu_clk\n"); } - r = platform_get_resource(pdev, IORESOURCE_MEM, 0); - iommu->base = devm_ioremap_resource(iommu->dev, r); + iommu->base = devm_platform_get_and_ioremap_resource(pdev, 0, &r); if (IS_ERR(iommu->base)) { - ret = dev_err_probe(iommu->dev, PTR_ERR(iommu->base), "could not get iommu base\n"); + ret = PTR_ERR(iommu->base); goto fail; } ioaddr = r->start; iommu->irq = platform_get_irq(pdev, 0); if (iommu->irq < 0) { - ret = -ENODEV; + ret = iommu->irq; goto fail; } From patchwork Wed Jul 5 13:04:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5p2O5oms6Z+s?= X-Patchwork-Id: 116129 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp1861911vqx; Wed, 5 Jul 2023 06:16:33 -0700 (PDT) X-Google-Smtp-Source: APBJJlGZ6RYWF52yyuhS3inJpGyr135esIDiA3YOGMNHQqrTnA/NLEig8Vd6nD3iBG/MgJDOOMdr X-Received: by 2002:a62:4ed6:0:b0:677:c5bf:dcc7 with SMTP id c205-20020a624ed6000000b00677c5bfdcc7mr17064204pfb.17.1688562993541; Wed, 05 Jul 2023 06:16:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1688562993; cv=pass; d=google.com; s=arc-20160816; b=TfW3K0JrReM94kmrYkBGi+vbI6jVVpoKbctTUpD5A09LgySpaoQhPFNUDiv93DR/hD Y2HeMQ/7U7wnwkrqrD3/HX50WD7hJS06EkXkDjo8I30302csIHN+1rRhRf6Dua1M8HxF bZV1SY7338VQwak6/9tSn52CM6lH2GIoPrFsW6IChmV1cUDX1Xgx+9SzHJ++WtezjOKn KjmZVe/Nt6ikftmflii8Db4QLwqKmcE3HMm8yWHVeNa0QGbTdrQlL6FhZ6ndY7t9qRwO c02oVkzi+fhNwXcWGoJpMbF9+0Ck9LZJCy77g1eKOtD74zenquWaye2Awla26DnhMfPA r8Zg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=z5jXm6dQN4RzzpE/swXSXXJbHtqjwIw1Ubsqg5yY/O4=; fh=SxurIYRjIrzdAvqrjrhLFnSBjY8PvFXAOkTmcxZ5Kpo=; b=tXYHidAqU8NT01tq2winG9Hjvrq1bL9ESyRr1LiEwcAyXsz3nKOZhdaifbxKLHmL8K 4PhMPxwPpQlNBniVDYIw412KR3+4ESh4O4aBsI2saL29M4OH2vVdnKDltg2NAGkfcrc+ HfTT8tWbeoAiC1qJHQ0dELr0TCqwiu1WinETE1O0xP+Ccs0e///51LIudBd0Br9c7LOr 2z8fgBU4L+6e8knp/DBVQnlNDSvWuOZNdYueEZZZadOgGL+rN3ge3QQ5z/v0xy0qvYfK BgG3tXM5/hub27hyo+xSBTy1kcRBefs3D3bmzasg0S0pASW/MFMqgDL3NLgVrG2IKpI3 vFMg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=lzDFXV5R; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h129-20020a636c87000000b0055b53a564efsi12281321pgc.834.2023.07.05.06.16.19; Wed, 05 Jul 2023 06:16:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=lzDFXV5R; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232151AbjGENEp (ORCPT + 99 others); Wed, 5 Jul 2023 09:04:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232117AbjGENEi (ORCPT ); Wed, 5 Jul 2023 09:04:38 -0400 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2102.outbound.protection.outlook.com [40.107.215.102]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38B39DA; Wed, 5 Jul 2023 06:04:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Yg2Ic404T1/tDzjKxho71QnKy5GRhQw0iOhN8EDVEteYqjSWimY2jsDo4VCx3JbXxTjIbOfUAW42NxrDaHrTQwZZX6qsKCRVpySCkcNbguBZI3ZGlrCXkr33qd9tp3lRxuT5uDyJDaQUVAI5fuiIS9Wpwjw6UjHA4b5Qq8Kq9tudYaSyUrj3PNGVsOs3IQfIGD4X+8rM1X/wAsUYq/epPBwgCy39xEZqvgb3epvONI6DaeFiOVu0AQVJ57Ri1f1W7Wg6Lj/A4gj+xHkzUD7RP80nSciHImykWm6FqZz1P5TLpL2FRzmSA8VerC5Cb/aYK9Pwajf8pSFTQuDL664kpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=z5jXm6dQN4RzzpE/swXSXXJbHtqjwIw1Ubsqg5yY/O4=; b=Q4lyEvZcXuof7FTofeeu1t9Q0puvikEPp5HeFt4j800oS+cM+418RewS0J+6N52AIDcARGOVxZpg0FjciD3o7C0JLYUxTh5yRhveoWqp/x/P/2lFFsZeFqCfOtakKAbpdY+tOTm2dvMvslsxqud/sOcrrOXEwEN8dEdoRpQO1Dgh5ji8r+duxl1ie4wPQfvbRHKVJiStwtfdv4tmWfW9V3VmY9JNutLmrm+SQEV1E6umfNXyf51e8dXS1KQP/rdlDko4K7xdiegOt9touvzACBjc4845+UAtCGx/UNbbc+pmOrlBodMOw8Gy0jlzFPuGw18z9zABAIvjRMyb8moZvg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=z5jXm6dQN4RzzpE/swXSXXJbHtqjwIw1Ubsqg5yY/O4=; b=lzDFXV5RTx+r0DgJbNtyV3lexa658Pa1oQkrgGWgGGjsXOxAq2Uu+eEHgJY0ITTquMQXlh38LJRHCeXL1w9mK0xPIp3sxnlWEQUFRV8gJkdG5PpS2aB6P2l2YIAkzXQJIEzBu5ZzQizw7w6D5puXxYrD5hHf02YKFUj2RUpzr7G5hK8Ld6J6U/U50DCluug70c7R7OGGRmLzpDSIwdGyEkYHbtPDU96MMz/TN289K/to3N/Zjao/KApBkSeDtO4IFyziFmpW5bLJlmS6brDuf7TNd/6y19Kp5dsY5T0d+LXUnMYC5RfMt6s83K06exdtYNkB7/Jsu3XefznW4DKosQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) by SEYPR06MB5891.apcprd06.prod.outlook.com (2603:1096:101:d4::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul 2023 13:04:34 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::fa0e:6c06:7474:285c]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::fa0e:6c06:7474:285c%5]) with mapi id 15.20.6565.016; Wed, 5 Jul 2023 13:04:34 +0000 From: Yangtao Li To: Marek Szyprowski , Joerg Roedel , Will Deacon , Robin Murphy , Krzysztof Kozlowski , Alim Akhtar Cc: Yangtao Li , iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/6] iommu/exynos: Convert to devm_platform_ioremap_resource() Date: Wed, 5 Jul 2023 21:04:14 +0800 Message-Id: <20230705130416.46710-4-frank.li@vivo.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230705130416.46710-1-frank.li@vivo.com> References: <20230705130416.46710-1-frank.li@vivo.com> X-ClientProxiedBy: SI1PR02CA0057.apcprd02.prod.outlook.com (2603:1096:4:1f5::10) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SEYPR06MB5891:EE_ X-MS-Office365-Filtering-Correlation-Id: 2cd66c90-37c7-449a-00f9-08db7d5860e4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pDObYfuZ5kpprLtC+PmSuY/iwzVb//Y1blheAQmldHadrHNqeMMzYwPXyXFJA4c7Rk7khNhQw6JqZEN4YG2AcKkvDws4ZxO4UscnXspy5PSKQk7NPeMKr7RuFMo/8trGsiLvLjeyxz11bmYRad8PWJFTCTWwjhBA1cLs+LPw/VVY6D0ZL0vMskSkYhfj/F0v3gdtB3xg3u0A0velpZhuauFizTKGbhnOonk50Sckscrk4Z+rPY9Iq4vMEpYFxAXESvxj1fLOaUu+KXa6+H/vMVy/fRuPzh2hG0e4XChfRP4zvY/oOKDA/zA4dFI/dZuwNsmKnVNbt50X+K2DKNS76780bLCE3Mcp3jGZabqFqrapCbWKpeHff9QqDZ5z7RJc2kOnDIRVJ352fEtkGpSa9ALcyDK2QKffrE4R5BFa/2JqeekPPrTTyj6mk+yxreZ2y/1TvC/3ZdDJKrRhhsVQQRqo0gbnxtlRiz4+7SsHGQ0WaddF1jNXDzQ2C3+MSjiREH8ryDqOihTMEoZHsmi8kHhm0YKKAYNGD9dVUHo5gUwOznPSeEgdVkuOyL2IbI92cPqnvqFM3gENIykcWxfKayHb7GDag519g3OG+4TSDp6xnUJpZue2T+qUNFhGIxky X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5269.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(366004)(346002)(136003)(39860400002)(376002)(451199021)(478600001)(52116002)(6486002)(6666004)(110136005)(66946007)(186003)(6506007)(1076003)(26005)(6512007)(66556008)(2906002)(41300700001)(4326008)(66476007)(316002)(7416002)(5660300002)(8936002)(8676002)(38100700002)(38350700002)(86362001)(36756003)(83380400001)(2616005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: +2YCRJ7x+P9J/m/eIz6uVUrDbGz1iItdMgkVznr50Cv6a6pud4E8ZXT4yIfXF1nbqL30nM1d/NOXEcncyitObqjAmMAAUffOu89sK0vzPFzFJfaQyixUfQ9sczOxDIAun7dk98YUFeBTq6ESZSdDfUiFSEyKZ14zn+zUEgV667wx+IZyRq4E+CUz8cJ+8Ddo45q5JFwhtxv+4POlj/CdNIUnqHAMS2oBPf23F2laLOTcVLGvvAlkNcB2B/p0wDcISDz9qbHnnRyEngxfcSrMz5f60tBnpY98istk5Lq/JnZfA+u6hyb2C5eUo/dcxtf43WA78NpKN7t6nGQi7s43bN697+3XBUhbNRuejivk1v+MYZulxi9W+5ry41d0lJBoRNACNqiyd4kDYTXK1kjU7OfSxSp2pJoI4BwTkIpcAD0FlzSX2gZE9dU52SPibmUOX3rFc7cwkvVla+XGPAcByY7BCS6KmnJRmdg3MHW5KqIpwn6Nzq/mw0VxABEEgev3J7PrVr1VX7TDnEpWzCgBi2dPaCxdptkOln/bx1SlruJyn0/4hhXowy/rtkAJRc6moG4LioF2Zx5t1NHf3ncNzEXtE/qcT2IFyHFU/6dNYze47VRVbAlyrqY9MXxynGy0VouthKKxe09pWpcumwqTqqTsPpDWQWebkGUHDlNFFZ2qcXoq+KBN3RyfIYsiKTpZzdMH0qkov0YQhS389s553Q2rLFyC79/P+TNwxP2ruzjFYfLwVRJgYLpQrFTE9mCqIfegZ0YRKocQpiVn6UKtEpdKx8YA5On4QV3j2NIXAgo/kCN0ohmoURxKaijSEoD9e1KO38ioqDYYJ7lXcO1wOK5I+n9XyuBvFyY2aSoks1an6Ei0po+Mh5Hx+SvoELKVhDw15Y/a1vvtmjxY2RJoCKazmt65bAj6k93ql34j6m532lAYJFvDsr2b052U9kSZfPwv9i8lXBy6V3F3UgUSKZX50PJbtDYUVkrs2w8TDlAYGGuPvZltFoTT1T3R+diJGZliKs54exYQtpMLSpadQSKSzUBxfaiI5nP3Zb8ajAGMMk6ht+ugOz9Mfoq0bmj1SqA8gtzc/TdHjL0/ssSWXVn1VVkR1tNkzThmhiD8mU8UF72b9j4lZtKiFQHo9LlOHcTWeVCc6vpxLZxsej+jJIOYeFTzwpkazmNyYjub+MiGiqbATD8FMGU8xDsbCp0bQGcdxiYyK75m34Z2QhX9tLAOQoXs4+OEe0QyIjCWY7uasiZG4dlPGey8bRwPaDJ/QyWtLF0Ag8OobovhzBYz8KK5/9d39DVInzhH0oc9pbFvDfghbiJNAwMDIw9J1ZMqHDqyc5USVJp+Ab3uHzD0B2+5/TNY1NCtyFRv+8dYLfk8ebkkRCNfCy9C6bStCKBdMs2big8H5KS3YegKag4eIxwEzaJigBs+d9zWiJ11FPlEvWRHdp2Affq1FvxXb++jcrWzmya1+zeHNvejlZQ9eHqcZGULx1dD0GF+4WHIz9iIy2n6rxgwRZWXMZXyfmDdhqHdIvbzGsnKTkq5tiDCVe6x4dFdomgzQQ5berMF9ipm7yVptJKkDvZbFtQf4zzj X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2cd66c90-37c7-449a-00f9-08db7d5860e4 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 13:04:34.1571 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: GxKRRORmEbSVym3vndl8AdAsY5Ipguxr3byntiu4DaBu6AxEwA6dj6gkAeMiKLt6qQlmbtTFWNswGnZhov3XxA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR06MB5891 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770586629505925924?= X-GMAIL-MSGID: =?utf-8?q?1770586629505925924?= Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li Acked-by: Marek Szyprowski --- drivers/iommu/exynos-iommu.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c index c275fe71c4db..ab6208015997 100644 --- a/drivers/iommu/exynos-iommu.c +++ b/drivers/iommu/exynos-iommu.c @@ -725,19 +725,17 @@ static int exynos_sysmmu_probe(struct platform_device *pdev) int irq, ret; struct device *dev = &pdev->dev; struct sysmmu_drvdata *data; - struct resource *res; data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL); if (!data) return -ENOMEM; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - data->sfrbase = devm_ioremap_resource(dev, res); + data->sfrbase = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(data->sfrbase)) return PTR_ERR(data->sfrbase); irq = platform_get_irq(pdev, 0); - if (irq <= 0) + if (irq < 0) return irq; ret = devm_request_irq(dev, irq, exynos_sysmmu_irq, 0, From patchwork Wed Jul 5 13:04:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5p2O5oms6Z+s?= X-Patchwork-Id: 116132 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp1871324vqx; Wed, 5 Jul 2023 06:31:19 -0700 (PDT) X-Google-Smtp-Source: APBJJlH5BR+UN/6faf+RcG9+n4mDfQuCFRM0MisEqclwljkQ7Cr4n9fkkMlnlxktYDDif+I1REdn X-Received: by 2002:a05:6871:60cb:b0:1b0:4e46:7f12 with SMTP id qz11-20020a05687160cb00b001b04e467f12mr10711558oab.43.1688563879203; Wed, 05 Jul 2023 06:31:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1688563879; cv=pass; d=google.com; s=arc-20160816; b=XOFDdHZaUjSnAJlForb0uCWqjjnbUqG0f84xQkoDyhC+a4fTXPr2QsZl0KwzdqxFCs 1eGb4bijN4oKyio3DhMUPyd/YFKBbinew+68pyE2KjMZHvPpfQCKvlwHq/1cXwty9RCn D2pSBWhrOw/gZH4fZi53+ny2EMpq9v40SSFx+6R4Px3D26Dy8Tfz2e39HBaQvwM5P/A3 KGRBwuQBHQ1Jq7LRWpMtJpVi8d9GpLFCQde1W6CcStu0zRduih/xErBHS0UzQzsewCw+ 1gaHPUJlT+4lLa4CuZz+OmP3lAZhudjNw3VCkkrrSEU8+gpy+qXNyoAPVHZeMnsTq3WX 7KYA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Xd3vD87R43+XxY+DGCoQQz3hynb98Cc/gIxYz773wFk=; fh=Ss3S2CXwMjd0HXDOplqc3YU1UIe6Opt1uXS63tK8b34=; b=TYr9M+1WRPcLLgx3XLNi/cOIGhUmLwuJgTMEY5AWLDhVj9z+N7YfaP11wfS8hEgF56 sjx1kTbwNKFMfypauykqnS5Wld/vAsR46DfK4Q0EkITw09P13OjfHWzxs/30W1mbc6aI qk3YMj/0vF0YlbHBb64qyPkk8x32CzdQXSwIp1ltewAMAxEhduPFMzfXOXtnwru1Ulv3 Ugcsglg+S1YXoB156k9cOghDdcbXLzvIR4OMe8F8cGhdXkTfo0E9fEMRkCcVtD111Gel qOCHPzywxiNpKkX5H63U/UebLQsOBqXfllx4fHxz4dSsLfJ9yhGkUmXUDpfm25fFEOh9 hVfw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=A5X3ZxYT; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d10-20020a631d4a000000b0053f3e6ec82bsi22514025pgm.774.2023.07.05.06.30.57; Wed, 05 Jul 2023 06:31:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=A5X3ZxYT; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232159AbjGENEs (ORCPT + 99 others); Wed, 5 Jul 2023 09:04:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232123AbjGENEj (ORCPT ); Wed, 5 Jul 2023 09:04:39 -0400 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2102.outbound.protection.outlook.com [40.107.215.102]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D0A2E3 for ; Wed, 5 Jul 2023 06:04:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BZJ7rRUS519+VdxM3JoGYl5HDhIOHBTtCzbLF9PimaGF1culQINVfbdhgJH5PwaBXw/9TT3OP2QhHUowqvwF23Tj530EJgP+u9r2DlncHdnyt84LB2xHNKp1nzSMIGty/vF9+XIfmEZWClzaYHFB3f8Yq87r3vEAM+/cMG2gAY/+B2AFFBdAoEWGl5oJ0TzpP0Qj8rwNMGrYjAGRCiBuABeAL1sY+sWOqY9lVExJwLW/LDEyNq/dP8V+npHl0+2Ay3mgpMPJSf6b0bdGmJBB3f87SGX0PeObCq5WoFrrMbsvkegZabgjUPsaWJvDqCEaHxC1vWy2/OkEmQx/oF2FuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Xd3vD87R43+XxY+DGCoQQz3hynb98Cc/gIxYz773wFk=; b=QvyPKAhfHhdxlGfs1dAItsUWrJJt/t9UXGnv6x5bms3sJ3dE3UfCP9KVUWT/j2TuuCMfz+WnsszoSJRds3AFIISY7MPE8BYHvdBaHy5+i9CUfmLTbxpyTkRVFh8AcTTo4HVJ1+R6v8pcqaaSbdyTMjtjt9e4gtZr7ALOq1Scc2BeYwitSY7N2j1tkjlmgke6+dZaAI3hPig+tkA5DrGpU6D9UqlV3OJVrSTvhD8Xokt7BoJVZXfX7ApGXZ+tqDkyk8MVRdzo9sVdY1iTuflij+unmeZdjftHLas0OhpMqSKmKsA6Xo6hTK4olzaLFprnATNn/OUli9zQSvyLNGIDeA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Xd3vD87R43+XxY+DGCoQQz3hynb98Cc/gIxYz773wFk=; b=A5X3ZxYTrR0byV289kGdv1vVkt279Uw8S5v5PIPIqzxsthvzlopIc5whvESV4EteRaf8KJlg3bqXi3wnBRrK5ywhIzNiFTwyZmCNR0DyTBAusaUtaafqtpaiT0M8KYcJSK1VSDCLh1mTUbQCHmFs7S1UsYxNYg2CJcYEJbhOB69aUNf0XN89h7kUWW7GpqawVYLzf8uT5b2K3vZa8X/6idD/dwJR6Eot0CwyL19vU7PlJQLBnFVnf2if2fUiPZ4FDWNDt2oDw72iblkiZdSUV+xhV+4F/8nZSxfmJTEFs8eyzrQ9Or654h/kxZfkqykqCS3ITPf6FanGeD8dMfGzsw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) by SEYPR06MB5891.apcprd06.prod.outlook.com (2603:1096:101:d4::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul 2023 13:04:36 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::fa0e:6c06:7474:285c]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::fa0e:6c06:7474:285c%5]) with mapi id 15.20.6565.016; Wed, 5 Jul 2023 13:04:36 +0000 From: Yangtao Li To: Joerg Roedel , Will Deacon , Robin Murphy Cc: Yangtao Li , iommu@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH 5/6] iommu/ipmmu-vmsa: Convert to devm_platform_ioremap_resource() Date: Wed, 5 Jul 2023 21:04:15 +0800 Message-Id: <20230705130416.46710-5-frank.li@vivo.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230705130416.46710-1-frank.li@vivo.com> References: <20230705130416.46710-1-frank.li@vivo.com> X-ClientProxiedBy: SI1PR02CA0057.apcprd02.prod.outlook.com (2603:1096:4:1f5::10) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SEYPR06MB5891:EE_ X-MS-Office365-Filtering-Correlation-Id: d90bafa8-5466-4db5-bfe2-08db7d5861f3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lAkcLRNRsBlAedwDahNxJ+OsQY1fvpaipmL/oI8vzQvWQ6w+Fzkx5zVhoaiGUhJfEsYxQPBk1yI7mMZVtrVJ0tCCt2Vf2Ou0emhOsVgl706V0cqvYNpSoB8XluSp+TjdldeIRAFGVi8BB0erWn4ScyYMlOp7bJJli0+5ZstMatZXNn+1HoH5ziwlWbenG1OeJsiokXW20qMyIdSYscsWfLjmGELBySzqgyygfeevS+I1RZvrOFqao9CX6EkJCf1UwG0ndU/O9jUj8dh5AKJ/p6gocUVbV+n/XHKsWZsDzsssD4w+6tZfh4qif2Slns9/FjH/SgTeY+AgrPsdViUXhBHNBv415Ssg+NTFVmW1oyAL58nJq6ZqeZE2lR/7SdYmpBDy6GjxqE0rdHBny7MFJdUYenr4KIrSDqOl6NpMxnjV2MrDOxeypHBsOM2AI5AmfVAHc3Ef/VOT1CVOQ9pIZgo2lAa7Z61lHQcGvzJz48Zeh4cbTlXdiGoihZFSJXB3lCsYQcNANWDtdbFgRGCZEiUignBHsdh2PTC8H2bbC371N8uOJKtMbIdaZGHwS00OfaffBSHPTlDvpe0YMBB2kpDXI5VbC40Y1pGAdnJ250qMxfGQ57jl4XalPZnQuHHd X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5269.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(366004)(346002)(136003)(39860400002)(376002)(451199021)(478600001)(52116002)(6486002)(6666004)(110136005)(66946007)(186003)(6506007)(1076003)(26005)(6512007)(66556008)(4744005)(2906002)(41300700001)(4326008)(66476007)(316002)(5660300002)(8936002)(8676002)(38100700002)(38350700002)(86362001)(36756003)(83380400001)(2616005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: /emq+h0iTRT16JsCLlk+RBPR1jYXB4SsYL5uf5BHPUtIRE6kccI9BldXVUbfiBj9uvmiIhXns/0bmFNIeHY1qabwiO7istVloNDqUV2IbUcYhvA/shKEOxd/cFdKRfVMTvdWxbGYqHjWH9ql9EUi5tcgDGttErS0jjqN87EXMaW0KUWBEA0N34CqoRNPeYDZG2Ni7ajakFqD7CPSY6ctC3yRnXE3b+JzredEcvd1xs5LvS1vCVZ+PEjqiwI0WSEkgSKA+vRqpMoWeIp0sgQ57ofTKm2Fta9bEd8zwj69ddFvoTDNLNi6O00kFqtZDnAbXG13cCZOHu2BoZC+VjkA5K+f4JQEm5pWviYXb5Oz2qTVl7+tsyq2xxL9DVXrbC+2LZAvTlfRYz6+3l8IlH2jg6wadMk8+M4Xj8CddztE/7m273OTevM0z0GzOd9m1ZwemhKCVt6Lw2E/RuXh7dp6/O5JMWxOD4dA1f3tBy5z6Jav+JQ2ipoWn3JN21MF4xQBUXQC0m9ijuoFWVq0dq5Wlfhc7TlYAVZhntYQuogq0bev5Lcu9j/E4otrDKn/6bbv+y91aM1ErZbXhRXLgKb0ZgJOMHfKJV7YWYcY1HyTvaMSpzaqJrIPnyiPfZVeTZIf4tJNvxcZPeaoxePTnuIjeJX6wNkLw2CHx7x0PCDETKIiYhPjeKRlKr2wmSVo1oxDKmLt1tFASZ1hiYo1J5zbltl+CKD72at0+UWfH12MNXhaoqd3PUVngxX380dG8iMQYnWK9a9/mwuYDPOlCB//5dg2OljsqCwWOJG0uHjADVqtmhmgG5HULVYt6T2qn/BQZohz3xslsjX2axpftUUHCiYqYvyum8sxRYWN8aS9NsdNmtdeIxxmTgLmdRNiMeuUTuN7ctX3IpntRbgN+4Gji2uhqu79dLVkIibvk79xdMz+8wqb5tq5P2WmYAI9ZPUOYaif76R7WqwxGMkA/5UwjNewCA3aliUfv3U55TRKjyAU4eozLxTcC888QD6VmC4M53REHcuBwSah0o9Aj6MAfNqU0LwvMC9w8IIECnI8VNYhWN92gdeltrDmrpglVvBRcKDi5ixZPyAFzA32NQ+7x5G5aWGX50wi+6RlWLl5B5WSXIvYzR2B2t1fD4BClZ6SbbABbvyQJFEuLTSUltsLgUuIrOHPV17H8pvmp60i/Sk+AE9R4ETV2wjJejUJK/hacwslgtVNO/busDBmGCEB/Qw740NXMWZBAmainp/TYrQzvaNyf/02oG08zPVw8p4ATEHMJN4b1zy4yRBfk60Q2wCu4t7ZUKlQWr7HRkf1HIzH47ko60x8mT4rydgiGOeJnRxiR6oSrgpBIRcmXP+9GvEym1Uwx3d/KDUfssptZtbLAaLDQyxpwNmdk4sRGPZe1SEvJ3grwF15ouJx2DroTJvDNkbjjK81XILFmESICOLiBU0iuSF8xGMHRIsWRzav88//hWoCG2X6s7ICH3SXYb2XO8TlBKuMzobRY0LJXxToPv/nm40zEgWSXduo/FlJGLR59StHa6XdXj2tQUw7FLJ4FMF4eXVo5EklDs3Zo0TsLgqNl21xjPK3TItZ2NLV X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: d90bafa8-5466-4db5-bfe2-08db7d5861f3 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 13:04:35.9263 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: efr0DIHMfTg9jpDozsTw5txQ9UUYiijVooLWEV+8EJ6pQaIMvrF0yVUF0Fr70EXX2tkhkOVmPtda4CJtnxPXSA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR06MB5891 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770587558019284001?= X-GMAIL-MSGID: =?utf-8?q?1770587558019284001?= Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li --- drivers/iommu/ipmmu-vmsa.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c index 9f64c5c9f5b9..01cf577e597c 100644 --- a/drivers/iommu/ipmmu-vmsa.c +++ b/drivers/iommu/ipmmu-vmsa.c @@ -976,7 +976,6 @@ static const struct of_device_id ipmmu_of_ids[] = { static int ipmmu_probe(struct platform_device *pdev) { struct ipmmu_vmsa_device *mmu; - struct resource *res; int irq; int ret; @@ -996,8 +995,7 @@ static int ipmmu_probe(struct platform_device *pdev) return ret; /* Map I/O memory and request IRQ. */ - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - mmu->base = devm_ioremap_resource(&pdev->dev, res); + mmu->base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(mmu->base)) return PTR_ERR(mmu->base); From patchwork Wed Jul 5 13:04:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5p2O5oms6Z+s?= X-Patchwork-Id: 116133 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp1871321vqx; Wed, 5 Jul 2023 06:31:19 -0700 (PDT) X-Google-Smtp-Source: APBJJlH58BU+e99gQSmpEQEndZeF1T5DX3ouFyc3l8Zm1aGazwwSy5Blh4ip+uvQ5O8LkakFAEc4 X-Received: by 2002:a17:902:b208:b0:1b8:b2c6:7e8d with SMTP id t8-20020a170902b20800b001b8b2c67e8dmr1190208plr.66.1688563879067; Wed, 05 Jul 2023 06:31:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1688563879; cv=pass; d=google.com; s=arc-20160816; b=r0PEjShiTwjuO5Jl+TKYc1f3Ol88emayPu7Mae9nx1CqH1psfoWzv2w2RR3zJ4YvKv SRREpGfi5Wwuy1Iwgo+n3OV9tlAlwbN5XvhvStULX0FPupr2+RQgOh3BOztPhobUBBbL bY1XliKHcFYUyZ3jHot+Asr+jimstJTk+tBspAQUGlULj8mU7tHT+tkPsf3tG2lfv/tK tHWV3aqud+mPIjJFKltlXoeLQhQz6HVSShZI/cTO8iNXVQucRgFrozYqj+kenfkpDhET DVYX/qC+o9DGo/EjMabq6uWmjU2RSED09iSwxmZzOtRWxazr0GtO/MdbGlEn0O/bzapK IHtA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=f/FKROkns/aT3W5EmDyW7I75f5H4AFux2NcHTMqTyeg=; fh=5mQm0U5TmSYCVdAZnLgsOin/FmJ6A0GeZEY2X2x8tik=; b=uaz0bcNMY2Vp3XJDds/D8hMLVYs+fSKzlDrTtrRwsiHH9IIApr66L1dSSqb4wY3AHZ gpDgE1FvTF2Z5+yNBGwG2GeVY2umFu4gnV8jo8CnUy0kZzQiKtjg2msuhaK2pVwIZawg KZ8wvm+obYZOunUNEFsgkNjXuz48WOZbVne/iljdW/gTrEM/0yqvZ4OMeBZxLsiXKfTD KHntC48g5sRFzrTamhpO/VZSYADzJg65y41rBwagb/7uCt1th25YuGiQM4CAe3cNx7c6 a0kqqNIdnlP3JKzvAPV8VKY13XuTs1pNe2sccXCqSgQUvcZ5D0cu3Y7J5sK8lmx8YxSV AxUQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=mw5fp5zb; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ji20-20020a170903325400b001b8216cfbe0si16221518plb.138.2023.07.05.06.30.46; Wed, 05 Jul 2023 06:31:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=mw5fp5zb; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232191AbjGENE5 (ORCPT + 99 others); Wed, 5 Jul 2023 09:04:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232135AbjGENEm (ORCPT ); Wed, 5 Jul 2023 09:04:42 -0400 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2102.outbound.protection.outlook.com [40.107.215.102]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 013EF170B for ; Wed, 5 Jul 2023 06:04:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jsWqxWcMtZVe6PHyrijfvJjGhv/9akCtqDmFLuHrRc8zuX2ayJIZ3Rj9ermLztnT8GkGqxq5JbgrEMidkNDJ1L+irP5ftzAUHyllg4LhB/hetsGJbZgEaGffeL4DKb0ACRhJ4DCwBICs5f59EECsS7jFD9WKLitSXvsrItbLtsUEg6+syIeLI1xdNMeJlAkNYmA6A7wPpTOUKV5IOBU5FkV48W1qb/ZujTtKtULxFfKqHzuia0kCpSl81Gw1KBEqtdTNsKwg6VE01nAoMSUKYOXUO1Dt39dU0le4OPm1uBGmB3w8mlX2EMU6l6/LYJXcm7wek5J8vkf6ZIa+ZWHEzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=f/FKROkns/aT3W5EmDyW7I75f5H4AFux2NcHTMqTyeg=; b=Lk3PZUjjTatXwMvInN15dFRo+cxqQE2rzPo7XGbHfu+6gX5IxNGObi2ezUkYKt0t4QlbHFRL1Cvho23boIbGk6x2XvPCveDrvSvyFb2pFoaOkVWpemfd9PSql3s/69CDtuRUdzIYoqRyjWpdt1+aujK7x9Qnlfw+bzyPhIU7khwr2sW5p+sCnN4k/1T3kGnAK/+o7vvf7HDIpOzKQNyAvg0eabhadMNiC217SXyEK2oRKcCRStbRJFlWh3dN9TmFyMQ/tE8+xSaPxxHi/2d5es1SNz75pUGK8DTFxD4uF3Y/FbTfzDIuia64p649JChrQpwUiWOZONrRTYPF/C4fSQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=f/FKROkns/aT3W5EmDyW7I75f5H4AFux2NcHTMqTyeg=; b=mw5fp5zbUfOqbRbJrDrr9j7E5QuI70wJxeuO5cNpqoppGXIXQQyMY6+qa3cw1e6bZJDQMpkBmnM16sj+92UndRzhjzygPtB9JicrT8WaaQfdK0ptmn5ZIUlssbikN2xh18NrX/8fUcGI5iO+TFIfvIwNhEsVobQ5tlYI/fWo09aW0RvUwABtIda+ohnRwqP/bpGpFRNmSwpCwFDttM5GCmgbrRqFa3qs6lsaYfYaVj0OnKGSegmuxbvchgSmMRqydtVBkyImz/oWqK6Mw8kX3c4XBIPchkNAosP9oxplBPJi0J20xdZFMDckrIsIlp2gM7MGHT14UoO63yEnthbkdg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) by SEYPR06MB5891.apcprd06.prod.outlook.com (2603:1096:101:d4::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul 2023 13:04:38 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::fa0e:6c06:7474:285c]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::fa0e:6c06:7474:285c%5]) with mapi id 15.20.6565.016; Wed, 5 Jul 2023 13:04:38 +0000 From: Yangtao Li To: Yong Wu , Joerg Roedel , Will Deacon , Robin Murphy , Matthias Brugger , AngeloGioacchino Del Regno Cc: Yangtao Li , iommu@lists.linux.dev, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 6/6] iommu/mediatek: Convert to devm_platform_ioremap_resource() and devm_platform_get_and_ioremap_resource() Date: Wed, 5 Jul 2023 21:04:16 +0800 Message-Id: <20230705130416.46710-6-frank.li@vivo.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230705130416.46710-1-frank.li@vivo.com> References: <20230705130416.46710-1-frank.li@vivo.com> X-ClientProxiedBy: SI1PR02CA0057.apcprd02.prod.outlook.com (2603:1096:4:1f5::10) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SEYPR06MB5891:EE_ X-MS-Office365-Filtering-Correlation-Id: 870f86ab-671e-465f-c37b-08db7d58636e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZR0e7L239CRxNQElPl+JqckKIX6p097PLgV+vXugnQBuJX1bDQqQjpBCozATTrDzwgbi2wK+kEIlbF16yhOGKCO/K8ZZTdRa+3frQkO91M+8CHAHiEsyQtXGj/WK9skicipwu8kQV1xzIbKOeJJw9CkiPzNA2QX1tRfudx9mF86V5l5Qpxg51DMx622a//pvUsTrN91Fr6IejGEO7ss41JrTt1nToXHADbBNYjvyOPwHYyYLND06Dq21qBOOboMWRuJcEvXZLZbsTB0dTbnEPoL211yvQz2c8OtdUIia7tC1GDXP9Q4qDedMawY0OLmUkI4tteKNJT99UAZuhHBdCV1TwupcB7zdNiUd0msMsNIA9MwCt1K0I/rrzaHjLomyN1ZULYmfliBoy2pCVCiLPlJSUxzJpDpbTwi+JxyDWU6JqVI/KuiXtE0R7pdxFHPWZt6sprwCdf0F+1VcPmDLk5fdw/UEi+LIuB078w1IRht7ZqAOWzKpX1xi7irSE1FpPOxQYmk08ATGHMjIvhOkGIUV8/++lm68mUMB4DI9rqcxR2G8oXkZWwi6yiRdE17gwfDsf1zJTAS6SsiC+UEDyt/cNuWL6Ki3nHs5l9tv/SMZCbYM4u7ETcM5JroVt/Ul X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5269.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(366004)(346002)(136003)(39860400002)(376002)(451199021)(478600001)(52116002)(6486002)(6666004)(110136005)(66946007)(186003)(6506007)(1076003)(26005)(6512007)(66556008)(2906002)(41300700001)(4326008)(66476007)(316002)(7416002)(5660300002)(8936002)(8676002)(38100700002)(38350700002)(86362001)(36756003)(83380400001)(2616005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: axo3/Hke4orzFWFk8sRczp4LmujEeFQayPyj2gcZpNgBaE3API4mXWWMdC2KBOhXKrRfwmO1zWf0efCwAc8W/9QBR/6jp2/iCuN3fzsEBKuuPg5RmR0BfOi3MfM4bg5pSeuQgENT/0GTmyfNXFVsbONCVY4s96dev5sGwFmTvnbxv1pBktJUC71uHsqOe8kG0wopAmyvabwKz1pVUZdQwUIqZ3yoZUC4P4Ij5WpM4mc1fM2eRLoO0uGKqKXmJNPvStTeyWhYkdHL0NySldf4UtQt4ryW9huWez/8HtftQhaVFknduCdeKWru7SaRP9Oq1NW55iZj5k0+NlnuMkTioNVIqukNMpuMNy+GH/bzHu5iZFvhxuMiBy/RvAY5xd5RpYRzCcztKUny6XF+B7+1aj3H97YVcGl+QU0AMZn4oscy8KtosRMzt0WvR5uFIDvubTusHFJa2kHTNpr4w5Iz9W6hnI1hoDozXu34BX3L26JJQBUXl53YY8+Ao5KDPkr4jnSgvf0W+aQrtJx20+Yuciealr3g8GHRSM1UvZXpxlcDSfAxMgZQqKsi7Gd1F6NMzwBuVKxQZYFmezgjWnA9GMEgV0uYfKz9Lrt7MHwCXtC2zBxpGJfNesa1JY5cSZ9GJH1QV4eeGof4eGM6qEVTMVjgGlyCEzDRP1FAeM1XowdOr6uHCmv9mI1738trAXnVuCmrKHlNkDpDm1GS7pQroP32ZSSvPGJ1smWJ188sBt+r2GZLIQBTBlUomzrmD2daEvQOk7vkUuFeRLOS2eFV97B9Wd8NhDiphUorx2qiyQujPfhjfTzeDFSyYoz6c2ZBW4l2If1Ffc/+IVFvpW6BTZ+2K4v2/t/puAIgIIAJz15ptEFKEpU3aSkoi68SUS87eXmdOPwgEFpNdun/e6F0WAlQ8OuUwNXu8DOHrvlP4VaL2DaUTQ5Ru0g1RDbOCfzD+9amZARMcBDAAkkDIHjCkrEQ0RCf5fNJD2s7uYR6UrrrzfgsZMM/x5e2sWsaMSzQL6khgMst4dl2eMkEKhSp5wPhgGXSnFt2qv0o7SvDFtLeHwuwxfaQuSKzHU0zJL7E49co2OErRxqdw3TQy3X9QYfrfzNvDtfMeksOZecA/OIyHy+4a0KIAmUus40MlTw1WHLr4iT+uURYMzHPweRlTZmq9tDweZhml9vquiSrnAV+qvkn9BUjIKUmWYxN5NXHwMPEq1v4F+NO8lj/08kGF0FbHW27xZ/lfpgoeBRjfTk8gbZjqqk99oj7HcNxtP1/DRkGr+ecfvjGy2g15o1KOPEmKoDxof9kX1YM/5ZQLduyazuhJVQXnlX+ft07C+tPsRpTOUDQ9UYifVYYBYEtqlSh/+QfJlRMTqMb3jFE10Or+GR5gAqlTnmbZXLRbN2hw/H8AHsFOFkgx3ui/LTw8FcKrsoa47wwMPLiJC6D1Yggkapp3QyOqgUMGoV+UYfGaN9OchFazqKs40GMGmSHzhDoQ0CxQ3sW9E/Xg/KdrgCGUwRiaNCB68uN5DrbBAOiPqtdCzBz97BJ2RhZSeQnbzv0AMv38ThRnksb7mimnVCJ2jDyVf47FRKR/4N6iq7j X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 870f86ab-671e-465f-c37b-08db7d58636e X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 13:04:38.3339 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: +GYVDiyTZfgiWfx+6/UQY21V/klpdSu56kE/G8SDsjj9JS6f6j+CRYW7xZsmd6SAhhNKfcQPAsQneRMyKQiG4Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR06MB5891 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770587558106716827?= X-GMAIL-MSGID: =?utf-8?q?1770587558106716827?= Use devm_platform_ioremap_resource() and devm_platform_get_and_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li --- drivers/iommu/mtk_iommu.c | 9 +++------ drivers/iommu/mtk_iommu_v1.c | 4 +--- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index e93906d6e112..6595a25c103d 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -1264,16 +1264,13 @@ static int mtk_iommu_probe(struct platform_device *pdev) } banks_num = data->plat_data->banks_num; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) - return -EINVAL; + base = devm_platform_get_and_ioremap_resource(pdev, 0, &res); + if (IS_ERR(base)) + return PTR_ERR(base); if (resource_size(res) < banks_num * MTK_IOMMU_BANK_SZ) { dev_err(dev, "banknr %d. res %pR is not enough.\n", banks_num, res); return -EINVAL; } - base = devm_ioremap_resource(dev, res); - if (IS_ERR(base)) - return PTR_ERR(base); ioaddr = res->start; data->bank = devm_kmalloc(dev, banks_num * sizeof(*data->bank), GFP_KERNEL); diff --git a/drivers/iommu/mtk_iommu_v1.c b/drivers/iommu/mtk_iommu_v1.c index 8a0a5e5d049f..2e116241f80b 100644 --- a/drivers/iommu/mtk_iommu_v1.c +++ b/drivers/iommu/mtk_iommu_v1.c @@ -610,7 +610,6 @@ static int mtk_iommu_v1_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct mtk_iommu_v1_data *data; - struct resource *res; struct component_match *match = NULL; void *protect; int larb_nr, ret, i; @@ -628,8 +627,7 @@ static int mtk_iommu_v1_probe(struct platform_device *pdev) return -ENOMEM; data->protect_base = ALIGN(virt_to_phys(protect), MTK_PROTECT_PA_ALIGN); - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - data->base = devm_ioremap_resource(dev, res); + data->base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(data->base)) return PTR_ERR(data->base);