Message ID | 20200414131542.25608-7-joro@8bytes.org (mailing list archive) |
---|---|
State | Not Applicable |
Headers | show
Return-Path: <SRS0=kFJz=56=vger.kernel.org=linux-samsung-soc-owner@kernel.org> Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D858281 for <patchwork-linux-samsung-soc@patchwork.kernel.org>; Tue, 14 Apr 2020 13:28:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CA5B82075E for <patchwork-linux-samsung-soc@patchwork.kernel.org>; Tue, 14 Apr 2020 13:28:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731962AbgDNN05 (ORCPT <rfc822;patchwork-linux-samsung-soc@patchwork.kernel.org>); Tue, 14 Apr 2020 09:26:57 -0400 Received: from 8bytes.org ([81.169.241.247]:34802 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2502867AbgDNNQA (ORCPT <rfc822;linux-samsung-soc@vger.kernel.org>); Tue, 14 Apr 2020 09:16:00 -0400 Received: by theia.8bytes.org (Postfix, from userid 1000) id 6FC18495; Tue, 14 Apr 2020 15:15:52 +0200 (CEST) From: Joerg Roedel <joro@8bytes.org> To: Joerg Roedel <joro@8bytes.org>, Will Deacon <will@kernel.org>, Robin Murphy <robin.murphy@arm.com>, Marek Szyprowski <m.szyprowski@samsung.com>, Kukjin Kim <kgene@kernel.org>, Krzysztof Kozlowski <krzk@kernel.org>, David Woodhouse <dwmw2@infradead.org>, Lu Baolu <baolu.lu@linux.intel.com>, Andy Gross <agross@kernel.org>, Bjorn Andersson <bjorn.andersson@linaro.org>, Matthias Brugger <matthias.bgg@gmail.com>, Rob Clark <robdclark@gmail.com>, Heiko Stuebner <heiko@sntech.de>, Gerald Schaefer <gerald.schaefer@de.ibm.com>, Thierry Reding <thierry.reding@gmail.com>, Jonathan Hunter <jonathanh@nvidia.com>, Jean-Philippe Brucker <jean-philippe@linaro.org> Cc: iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-s390@vger.kernel.org, linux-tegra@vger.kernel.org, virtualization@lists.linux-foundation.org, Joerg Roedel <jroedel@suse.de> Subject: [PATCH v2 06/33] iommu/amd: Return -ENODEV in add_device when device is not handled by IOMMU Date: Tue, 14 Apr 2020 15:15:15 +0200 Message-Id: <20200414131542.25608-7-joro@8bytes.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200414131542.25608-1-joro@8bytes.org> References: <20200414131542.25608-1-joro@8bytes.org> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: <linux-samsung-soc.vger.kernel.org> X-Mailing-List: linux-samsung-soc@vger.kernel.org |
Series |
iommu: Move iommu_group setup to IOMMU core code
|
expand
|
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index 504f2db75eda..3e0d27f7622e 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c @@ -2157,9 +2157,12 @@ static int amd_iommu_add_device(struct device *dev) struct amd_iommu *iommu; int ret, devid; - if (!check_device(dev) || get_dev_data(dev)) + if (get_dev_data(dev)) return 0; + if (!check_device(dev)) + return -ENODEV; + devid = get_device_id(dev); if (devid < 0) return devid;