Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1552401imw; Tue, 5 Jul 2022 11:24:41 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uF+FHR/x4wXPO/+kgFx87lsUMT+GFbLYN15uienvtSnRBHimh/I88kaJ3hiWwgUgwPrxsY X-Received: by 2002:a17:90b:1e03:b0:1ef:967b:a9ac with SMTP id pg3-20020a17090b1e0300b001ef967ba9acmr6319723pjb.97.1657045480775; Tue, 05 Jul 2022 11:24:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657045480; cv=none; d=google.com; s=arc-20160816; b=hXK1JdgdEOGKi8HI+v+6JIOxNMaOaCTr5KPXKoeSvkBgdKpfy1lhfPvFtVpnnTKp5J DdqVUR9b/MVJBDHsiuG/AZ2dGV65sCZXZHswATrwVB6+aUtVWNRlVHSe+vqfekf0Fxkq i10NM3AumbdlunGTrTCaF55mLv8h4BYk5avbiGsaG9kUBrk1HUDjHcnSDMmdsgM0eFFe 4e83baTbrY4Zw/VGNSDZNr5LKQ2q2xQ6x83d2givCYyZk3zEG+R0mHRZQDaEHRnCDoZV vpkTbySuSrHI0ZwtBHMea/13fb5gFqEpiLSm2/vKh5UwtT806my2jzk7Qt36gPZtHLBg aTjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=SRPWZ9IouAHzXxxIs4XltIdKnRFy2xFCEBh74be8csg=; b=Quz5ORcnsjZngKtjmC4pKMGEYINuvLO9AexoV4dMp/C85z2BVP5lYlPllKgzJ9UE6/ GxEqwUd3h/EKzbKLjLWuEaeoqBBAHCGQ1lLtJnB/GUUvl/QAAioTJlfQDf8zoCeMVguK lmpxcF3f3R9Z9stJEsQlrl/HlPZIyQfBQaleQ2facHNDLJHSF0EXzOL/rfQl6H/Qf13+ wQv7luFkk3EFrWSE4gdzieff3UvpxrBQgzzc9gaM22liP8WG8iRR+/M/okUJfnPKZYip H/Hr2MaotoJIelCGjRWjqjBUEnZ34BQS5BM2xHqj9ELtHuSOKu0773fLly34+qSMZlm/ H2lg== ARC-Authentication-Results: i=1; mx.google.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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h64-20020a636c43000000b0040db3296a05si14484114pgc.581.2022.07.05.11.24.29; Tue, 05 Jul 2022 11:24:40 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233204AbiGERJs (ORCPT + 99 others); Tue, 5 Jul 2022 13:09:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233288AbiGERJP (ORCPT ); Tue, 5 Jul 2022 13:09:15 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 553EA1F634; Tue, 5 Jul 2022 10:09:08 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7CF561576; Tue, 5 Jul 2022 10:09:08 -0700 (PDT) Received: from e121345-lin.cambridge.arm.com (e121345-lin.cambridge.arm.com [10.1.196.40]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 9DCF03F66F; Tue, 5 Jul 2022 10:09:06 -0700 (PDT) From: Robin Murphy To: joro@8bytes.org Cc: will@kernel.org, iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, baolu.lu@linux.intel.com, suravee.suthikulpanit@amd.com, vasant.hegde@amd.com, mjrosato@linux.ibm.com, gerald.schaefer@linux.ibm.com, schnelle@linux.ibm.com, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 14/15] iommu/virtio: Clean up bus_set_iommu() Date: Tue, 5 Jul 2022 18:08:37 +0100 Message-Id: X-Mailer: git-send-email 2.36.1.dirty In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 Stop calling bus_set_iommu() since it's now unnecessary, and simplify the probe failure path accordingly. Reviewed-by: Jean-Philippe Brucker Signed-off-by: Robin Murphy --- v3: No change drivers/iommu/virtio-iommu.c | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/drivers/iommu/virtio-iommu.c b/drivers/iommu/virtio-iommu.c index 25be4b822aa0..bcbd10ec4ccb 100644 --- a/drivers/iommu/virtio-iommu.c +++ b/drivers/iommu/virtio-iommu.c @@ -7,7 +7,6 @@ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt -#include #include #include #include @@ -17,7 +16,6 @@ #include #include #include -#include #include #include #include @@ -1146,26 +1144,6 @@ static int viommu_probe(struct virtio_device *vdev) iommu_device_register(&viommu->iommu, &viommu_ops, parent_dev); -#ifdef CONFIG_PCI - if (pci_bus_type.iommu_ops != &viommu_ops) { - ret = bus_set_iommu(&pci_bus_type, &viommu_ops); - if (ret) - goto err_unregister; - } -#endif -#ifdef CONFIG_ARM_AMBA - if (amba_bustype.iommu_ops != &viommu_ops) { - ret = bus_set_iommu(&amba_bustype, &viommu_ops); - if (ret) - goto err_unregister; - } -#endif - if (platform_bus_type.iommu_ops != &viommu_ops) { - ret = bus_set_iommu(&platform_bus_type, &viommu_ops); - if (ret) - goto err_unregister; - } - vdev->priv = viommu; dev_info(dev, "input address: %u bits\n", @@ -1174,9 +1152,6 @@ static int viommu_probe(struct virtio_device *vdev) return 0; -err_unregister: - iommu_device_sysfs_remove(&viommu->iommu); - iommu_device_unregister(&viommu->iommu); err_free_vqs: vdev->config->del_vqs(vdev); -- 2.36.1.dirty