Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp2850871pxb; Mon, 17 Jan 2022 07:02:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJz6IzUZtFa4P0kgZIFgy3lUieLrX2jvLLyjpVQBHwpNCPYkg72XUa26r0W4i0Rdgzs4u4uM X-Received: by 2002:a63:2b87:: with SMTP id r129mr19814369pgr.232.1642431767591; Mon, 17 Jan 2022 07:02:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642431767; cv=none; d=google.com; s=arc-20160816; b=IZv4ZQi0bLKVx3tyPsAjnQSIiCwO0XhH3l27rPkxA6gjuG8VIwj0uYWS9oS+VJbqDc n1kiRg/MLEZ6sUmQMrWY+DB0UuVDgnPX0yu8GQwcbGBQJkFhKuSF8tFzfoxseKrse0m7 GOBb2Rv41/JfACxlc8h0V1ID2rbYPD0ECde2EajExP6q8v1kD80tB0sW5DwFh18226Na v6aWM+blnrdVlR/3aJnRLFNMsBvvnid0Wqt6HTpO04sZhJ3YQCqdXhDKfyvn3rH3ZAlu 54lxFbLxbAbIrseSzlDI3r0ZwQFg9LBQ3+wETMzMt8KAmV0qKClFhe8kEe9h4JVWx7N1 J3jg== 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=k7QHrw67uNXgCDbZWimIWEWLhFp+qKD7HNGZzlblILM=; b=sgRsZ0B3J4zcsIbmMPbThqKUrmeITvoRkIE3bCfzL3whZ1LDmMTAhiOZuOsBcbPnzj dtxB6iWV7Tr/qK6SC37HKHlz6Qf0hRkyznMBjWAOXfBL6VR0Fj8+bWXfTjVD440P/6M+ /XAXJDUzLQYQF8owVI3fHCAZGnPQ19GyLQVWcApAmFqbVYINdea8DRMwPg8cE5FsPVYO 5hcyeEu2NxJTuFHFq/7Vpokx8ZgbAzshm7Jg89O+EiwRY6QNsrbRuL54jkcv3X1HfGtn QlBMjbpELOukeel/E8kUBVhkTPJSwGb6jWpBAW3oZHX0QqwCp3VwZuP9t/ept9uRIYUK kvIw== 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 z13si13790567plo.615.2022.01.17.07.02.34; Mon, 17 Jan 2022 07:02:47 -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 S233003AbiAQHGJ (ORCPT + 99 others); Mon, 17 Jan 2022 02:06:09 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:45174 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S237263AbiAQHGI (ORCPT ); Mon, 17 Jan 2022 02:06:08 -0500 X-UUID: da03fcd1b0fe4a34828adc6cef4fcf2c-20220117 X-UUID: da03fcd1b0fe4a34828adc6cef4fcf2c-20220117 Received: from mtkmbs10n2.mediatek.inc [(172.21.101.183)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1790191130; Mon, 17 Jan 2022 15:06:04 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.792.15; Mon, 17 Jan 2022 15:06:03 +0800 Received: from localhost.localdomain (10.17.3.154) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 17 Jan 2022 15:06:01 +0800 From: Yong Wu To: Matthias Brugger , Hans Verkuil , Joerg Roedel , Rob Herring , Krzysztof Kozlowski , David Airlie , "Mauro Carvalho Chehab" CC: Evan Green , Robin Murphy , Tomasz Figa , Will Deacon , , , , , , , , , Matthias Kaehlcke , , , , , , Daniel Vetter , Chun-Kuang Hu , Philipp Zabel , Tiffany Lin , "Dafna Hirschfeld" , Hsin-Yi Wang , Eizan Miyamoto , , Frank Wunderlich , , , , AngeloGioacchino Del Regno Subject: [PATCH v10 03/13] iommu/mediatek: Return ENODEV if the device is NULL Date: Mon, 17 Jan 2022 15:05:00 +0800 Message-ID: <20220117070510.17642-4-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20220117070510.17642-1-yong.wu@mediatek.com> References: <20220117070510.17642-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 The platform device is created at: of_platform_default_populate_init: arch_initcall_sync ->of_platform_populate ->of_platform_device_create_pdata When entering our probe, all the devices should be already created. if it is null, means NODEV. Currently we don't get the fail case. It's a minor fix, no need add fixes tags. Signed-off-by: Yong Wu Acked-by: Joerg Roedel Reviewed-by: AngeloGioacchino Del Regno --- drivers/iommu/mtk_iommu.c | 2 +- drivers/iommu/mtk_iommu_v1.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index 25b834104790..77ae20ff9b35 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -848,7 +848,7 @@ static int mtk_iommu_probe(struct platform_device *pdev) plarbdev = of_find_device_by_node(larbnode); if (!plarbdev) { of_node_put(larbnode); - return -EPROBE_DEFER; + return -ENODEV; } data->larb_imu[id].dev = &plarbdev->dev; diff --git a/drivers/iommu/mtk_iommu_v1.c b/drivers/iommu/mtk_iommu_v1.c index 1467ba1e4417..68bf02f87cfd 100644 --- a/drivers/iommu/mtk_iommu_v1.c +++ b/drivers/iommu/mtk_iommu_v1.c @@ -604,7 +604,7 @@ static int mtk_iommu_probe(struct platform_device *pdev) plarbdev = of_find_device_by_node(larbnode); if (!plarbdev) { of_node_put(larbnode); - return -EPROBE_DEFER; + return -ENODEV; } data->larb_imu[i].dev = &plarbdev->dev; -- 2.18.0