Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2190847pxb; Mon, 11 Jan 2021 03:29:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJykYbn5viV1XyQqTJMWXczjtvRderqEPZGdpNrz8tkRxiAFOJYG3XB/bw0HGtZFW5YCifIn X-Received: by 2002:a17:906:971a:: with SMTP id k26mr10806748ejx.515.1610364575241; Mon, 11 Jan 2021 03:29:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610364575; cv=none; d=google.com; s=arc-20160816; b=zZbrXTgi4rbCi3w0BB7RGzGPcDPT1PPjmS8EWyeqTxdfw80PlWjztIOC8PT2ykyrzP UHdSILzkuHJNWmiDFIGgUQiuGlf7GYcySf3BjrS8fEd5D3DcIm8LTp+tbCsg3f1AsPZy OTMVZEmAbjdtf9E4257ISecfSwa9g104Xm0iipAMATXNKa672QLF72PN98O8zCUh4rHL 0yTAD1v45rdqWGXrsJMrLWzsl/gHjgYzZTq3Nav+Vj3xhBABDxtFmd+efm1UR0Nu6u16 cY3ukQ7ShSDvhhjUJYVYdXcFFd290Dg+L0WcsTw6elCpk2Zo3QpIMJuBWEZz+DIspRzx GYtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=SDyof2GfgfVHtlk4OT8Tl2q+R33UR10QTpHDc3s9bHg=; b=UdxQ4KKMhsoKKzt3nWEV+3ci9ZSNV/O6Y2mhi2uFUIrDF7amvzOV0nGoBSN17h2f0q V2ZVyrUDyaVwtgD+JhWqhz/XO9/YknuHLTCFQ+8x63k1tflOZ41W8x7NR2SMu576HtUr /slWrQ+m6HJTG1SgGPkY7a5aLyQl1IcF60x6FcCDp+gJkemCINaUpKpgZ1wAM1LVCkXu Yx1uAWCXassk3ceDaVkoXNh1pSIqNTvsIJU4yX2V1KG+ra3kH5fllT2SZwq5Fign+/Ev jbx+yfYfwZNgm9w8tIW5dQUpUh1ZcT5yuZqPyDY2OOKVZYzzhd9C8sx9idkPeK7cASSJ 7M5w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bu21si7002281edb.199.2021.01.11.03.29.11; Mon, 11 Jan 2021 03:29:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730062AbhAKLYz (ORCPT + 99 others); Mon, 11 Jan 2021 06:24:55 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:47325 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1730059AbhAKLYw (ORCPT ); Mon, 11 Jan 2021 06:24:52 -0500 X-UUID: 5647ea5a765d4fa7a6f57cc9c5db4f5c-20210111 X-UUID: 5647ea5a765d4fa7a6f57cc9c5db4f5c-20210111 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 2113113936; Mon, 11 Jan 2021 19:24:07 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 11 Jan 2021 19:24:06 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 11 Jan 2021 19:24:05 +0800 From: Yong Wu To: Joerg Roedel , Rob Herring , Matthias Brugger , Will Deacon , Robin Murphy CC: Krzysztof Kozlowski , Evan Green , Tomasz Figa , , , , , , , , , Nicolas Boichat , , Subject: [PATCH v6 31/33] iommu/mediatek: Remove unnecessary check in attach_device Date: Mon, 11 Jan 2021 19:19:12 +0800 Message-ID: <20210111111914.22211-32-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210111111914.22211-1-yong.wu@mediatek.com> References: <20210111111914.22211-1-yong.wu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This priv_data is set in the of_xlate. if of_xlate failed, it should not enter attach_device. remove the unnecessary check. Signed-off-by: Yong Wu --- drivers/iommu/mtk_iommu.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index 7403a7cb90ea..084fb4394ffc 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -453,9 +453,6 @@ static int mtk_iommu_attach_device(struct iommu_domain *domain, struct device *m4udev = data->dev; int ret, domid; - if (!data) - return -ENODEV; - domid = mtk_iommu_get_domain_id(dev, data->plat_data); if (domid < 0) return domid; @@ -492,9 +489,6 @@ static void mtk_iommu_detach_device(struct iommu_domain *domain, { struct mtk_iommu_data *data = dev_iommu_priv_get(dev); - if (!data) - return; - mtk_iommu_config(data, dev, false, 0); } -- 2.18.0