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: 699701 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 58978EB64DA for ; Wed, 5 Jul 2023 13:04:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231313AbjGENEf (ORCPT ); Wed, 5 Jul 2023 09:04:35 -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+hdqKQM5BFQoZdX2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kgE46s0jUQqPqipD+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 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org 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: