Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2751168rwb; Mon, 15 Aug 2022 10:43:20 -0700 (PDT) X-Google-Smtp-Source: AA6agR6/c2Jck0NluAxqCwZqixpjMN5U+XmF+d1W2tH4Irm1/dHvHB/2AR/hHHwVfZ74SXUNSF4f X-Received: by 2002:aa7:db44:0:b0:43d:267c:edd9 with SMTP id n4-20020aa7db44000000b0043d267cedd9mr15515192edt.385.1660585400279; Mon, 15 Aug 2022 10:43:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660585400; cv=none; d=google.com; s=arc-20160816; b=tEupiNnkx6yS7n20Q0wUCqsPcRODh16BlPSaigHtZYrauD45GnCk3Tqrd1XpO+0XkG /XlKYMUFpbXY+Uz0ksOp/teuoNRZodL9K/JjTbqiB+pn62x7RoyLh1SLEX5LcRDG/vRq CcJoHeN+8CLORNIsNRqXGJfojYDsWU5sNbvjpLhr27Ohm6X3g9k9q0zGtYarU0n67WXW VGEfM+a4KnlNSwS97U8GVL+bGC5aFzgDDGhNmo6FLWgzgvAYHEOPfNch7OS1iq8Svg+n 6fHjlU+/EUDUtJMeg/XbK1yXDW1SjucrVvtvB7EQHD/T/FgLR4oSx6F2HcJa+j2hKZx4 qMoA== 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=z0wlg2mflc8ZLR1gPJeLAkM6Vb1UrxkMC5x3kiQO18c=; b=Ao5Ic5SsdwDEYlcNpZ8Ixg6KXZvyq3ljJu+GKS/HXotIdekOsm0KARc18wWWva0ArN 05VGqFqZEURVwZWw3xjqw3+baF5zjxoFPvn2k/nC5qE9izaYW+nSVbOFxGaB9+qwFjPE JWLPwB+RF7jwqbEvj9w6GdJ2ldWowAT+jigUrFwbNExJoMWOeJ10PVSGWveFsxB0+Ss9 ueF+ssymajlUrpm8lA5bBYnhZTV9z3l8vylc9yeK9Q7g68/iCWo6CZj4EN5z+fY85zlZ iBkHTDFQnJjxmbM8u4QFZokzppawOLEgeX0NVj1icHzik8vFqGj+JBixnOPbnUoU27cO 7D4g== 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 dt22-20020a170907729600b00730a3ab65e2si8349946ejc.611.2022.08.15.10.42.54; Mon, 15 Aug 2022 10:43:20 -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 S233467AbiHOQW2 (ORCPT + 99 others); Mon, 15 Aug 2022 12:22:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232409AbiHOQUs (ORCPT ); Mon, 15 Aug 2022 12:20:48 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id F23941D30A for ; Mon, 15 Aug 2022 09:20:47 -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 86B08113E; Mon, 15 Aug 2022 09:20:48 -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 4DAC43F70D; Mon, 15 Aug 2022 09:20:46 -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, kevin.tian@intel.com, suravee.suthikulpanit@amd.com, vasant.hegde@amd.com, mjrosato@linux.ibm.com, schnelle@linux.ibm.com, linux-kernel@vger.kernel.org Subject: [PATCH v4 15/16] iommu/virtio: Clean up bus_set_iommu() Date: Mon, 15 Aug 2022 17:20:16 +0100 Message-Id: <0ff6f9166081724510e6772e43d45b317cab8c58.1660572783.git.robin.murphy@arm.com> 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 --- v4: 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 08eeafc9529f..31ab9d622b67 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 @@ -1145,26 +1143,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", @@ -1173,9 +1151,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