Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp765030pxb; Tue, 5 Apr 2022 22:21:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwEN8FHdRxUS88naDPi1RhMSodEmHqIlCQzMBQ2AtfGfM2RwjRAOB1lIrqQQRdWYqKVMZ4k X-Received: by 2002:a05:6a00:218d:b0:4fd:f7a4:d4ad with SMTP id h13-20020a056a00218d00b004fdf7a4d4admr6952940pfi.83.1649222478666; Tue, 05 Apr 2022 22:21:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649222478; cv=none; d=google.com; s=arc-20160816; b=J//L4c0W0gI0R6EXRXsY37YeQvYT11RTuqD/F83MfSTOGDj01UzJI5BO6ZbbIOI59x WuOF6eRSP0ttqbDVBFBpZqBF6jmm1/KYS89SNuv4lOnkFER6Elcum4ruFpEdM+2TxNdo svsQZNOA8FTxTAwKNBs7wpsb6LmSehhj4paZqumW52mUNMAtrKOGrqMjoHZdvYEDyd3d 1mxvQxFVHTGjil7TNiBLtUPJ5I79r3EWyYFekpfhpHCoROvaTnoCiQvdejJqzndPOBmd sNmmnuGfMFDQuErIzdzTkGLKhBnMMbmOomfMJAX5GOmSjo+VCSi1DpokLzZ/Kz6ZjcUh ehPQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=jJ8+bWzYpiCn7T2ATO/o8ilB4LQVeerq5KnicdzaHNw=; b=AJ79EuspL/kn8OmtiGX9nfYKP3O4fO5AOK22c1sjJDnXcZoACtaVqTRpDDZtwjByzI L408rNyUc4INHx/HdUYlm91RHT0S20YKL9gmUbxq95flDYfJHs1ueCnH1LVRqg5pno4/ 5WRLW4L46Ldq3ET8WP4o0jzdB48rwLgJ7PWO39uXhhW+oUwVXbBAjY/ME+wqRhCbyfQe n37IQpsaCSs7pe1Axo4Q6oXFlstLx2MDr0o28EhwegjMoHbzJo03JTKNMqNjDzvfIefJ PWJ+5HVnhYjlllpsD2snJqYg/bckYNGaO6XzS6aaBakQQiyRUta1wdFppHNG0/NaF16X 0g1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FAujfifh; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id cp5-20020a170902e78500b00156ea908d59si662489plb.304.2022.04.05.22.21.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 22:21:18 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FAujfifh; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3216D16D8CF; Tue, 5 Apr 2022 20:43:15 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1842469AbiDFBbn (ORCPT + 99 others); Tue, 5 Apr 2022 21:31:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351455AbiDEKCy (ORCPT ); Tue, 5 Apr 2022 06:02:54 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3155F73063; Tue, 5 Apr 2022 02:52:07 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CB76661743; Tue, 5 Apr 2022 09:52:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D3FE9C385A2; Tue, 5 Apr 2022 09:52:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649152326; bh=Yw9KpInkgsNYhh+OCNup/aC8fKxzxvvo6UbYxOjbCnQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FAujfifh5yOVQqwUC1X9dwRkS3eNvF0/JqLRGPL7xYVczqfWLNs0hBAr8WA6rifyl Oru0E4ySXsV3+gl65kkPD4oqiB7+FdEJs32WGWKgx0Rb9PImyl0r98d1y7vJaXK0Df X5U2ebg07sj4zDwLrf0QrX3TzlvSrS53+q1m+qE0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yong Wu , Joerg Roedel , AngeloGioacchino Del Regno , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.15 735/913] media: iommu/mediatek: Return ENODEV if the device is NULL Date: Tue, 5 Apr 2022 09:29:57 +0200 Message-Id: <20220405070401.864562970@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 From: Yong Wu [ Upstream commit 2fb0feed51085db77606de9b9477c96894328809 ] 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 Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- 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.34.1