Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp504308pxb; Fri, 15 Apr 2022 04:58:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJypqlerYbbXglv/6KCFjDX66jDOxbfg5HMM3Wzii7bDUHTEGeMfpoJJhN6LD+9g0wxro60U X-Received: by 2002:a17:906:9b89:b0:6da:ac6b:e785 with SMTP id dd9-20020a1709069b8900b006daac6be785mr6067540ejc.295.1650023929697; Fri, 15 Apr 2022 04:58:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650023929; cv=none; d=google.com; s=arc-20160816; b=r0jCfXgEUKW0prGus8sM/IXJMwn2LpCY9EEPJf5xD90QjYgBOlOCUJ8ocSXO2pqnbb 0fq4dbJiHXZbEPNdy6GAmDAjuHWJRf2No1zLM/RrgspcIKKXs7iCYo+G3sS1bUya3DkY v6jMf9yJOjiKuBSPePJGBtLgo5XgDlfdn01wx99CRR8cz2vo/Dg1Ni4zir3NesoB0zxU TZlR8TElE242RmTaa5P1l5ziT2y17/fd0XNFYwaIo0BaCLyECCwAXnsO8PF3k+XqnHu6 gf/dmuESTb+TiHFwvEmWaDjMjW3hB21R7WDELlKZIrd69C+612DH933JaiY3umISc3f8 si5A== 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=FkWAjmD+NWOUcnrbrdxrhplHrg9bsbGs+Zenggg82iE=; b=GNL+dWnWrtaqk8ioxj+hhliGFi3pzcCQNcwlQ7eiCCJK0zcSwMxRhp1UNVgGuTtUSy b8FL8cBXAvLdlzOtnDWLaQ0QRYj9aSnBRPZ3jvpAMmzad3XTbiI4kJGZvoMut1w8dE9R EHMi/iNdMhn9pvrKQF7tXP7d1TanygSdskR/XHuGj0VQOkZqoQ42/h2fjKRCPyEtj2pG sdJ0K0RS9OXP/Qdjb2OBQ/eLCtgpQQrpNOsjcZaa4im86jrnsh63wMNr6o9uwUA5bAsL 0EUOlCDXOLMDSAMiAK+XA1Yz/fzg7pom9MqNyQiA1QRb6yCjsZJ1cMC+HRQVSOx6yoxf VAkw== 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 l22-20020a056402125600b0041d7955f911si902398edw.79.2022.04.15.04.58.24; Fri, 15 Apr 2022 04:58:49 -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 S243575AbiDNMp6 (ORCPT + 99 others); Thu, 14 Apr 2022 08:45:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243512AbiDNMpp (ORCPT ); Thu, 14 Apr 2022 08:45:45 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B962D8FE5D for ; Thu, 14 Apr 2022 05:43:14 -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 88EA31424; Thu, 14 Apr 2022 05:43:14 -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 8E4143F70D; Thu, 14 Apr 2022 05:43:12 -0700 (PDT) From: Robin Murphy To: joro@8bytes.org, will@kernel.org Cc: iommu@lists.linux-foundation.org, sven@svenpeter.dev, robdclark@gmail.com, m.szyprowski@samsung.com, baolu.lu@linux.intel.com, yong.wu@mediatek.com, mjrosato@linux.ibm.com, gerald.schaefer@linux.ibm.com, zhang.lyra@gmail.com, thierry.reding@gmail.com, vdumpa@nvidia.com, jean-philippe@linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 12/13] iommu/virtio: Clean up bus_set_iommu() Date: Thu, 14 Apr 2022 13:42:41 +0100 Message-Id: <4db34a35e07f3741a658465045b78c96a569c591.1649935679.git.robin.murphy@arm.com> X-Mailer: git-send-email 2.28.0.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_PASS,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. Signed-off-by: Robin Murphy --- drivers/iommu/virtio-iommu.c | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/drivers/iommu/virtio-iommu.c b/drivers/iommu/virtio-iommu.c index 25be4b822aa0..371f8657c0ce 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 @@ -1146,26 +1145,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 +1153,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.28.0.dirty