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+nZpu9nv7k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RilxSS+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);