Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp746028pxb; Tue, 5 Apr 2022 21:29:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwSy/H1GlG9RniTfSJ7JaM32fyWufKhwDN9gaPv15wWIjXQImNYokB4fHE6QoFNOPL9WhBJ X-Received: by 2002:a17:90a:7145:b0:1ca:97b5:96ae with SMTP id g5-20020a17090a714500b001ca97b596aemr7943196pjs.64.1649219393002; Tue, 05 Apr 2022 21:29:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649219392; cv=none; d=google.com; s=arc-20160816; b=FGJMGdRZBEu5RB/JoyVwtpzjS7WAn7Z91W+t+knqevaYTgPDf/BzLJbUexMNSuYUWC aMzctsFJnhFRbZwf9F0IGmW/7b3Aq0yowVItMR8eoMThrxUSZX+NMHhHvd9ljtbaCA8v U9rr+RJh/aenvjcD6+U+gXbnPqUXHKLnYfy/d0XngXJjw6MopJu7Wz6RvQBdOc/NNMq3 m1HVdOdkK43Al3o3D2+TcPtbAQDo/lRf7823IokbxOBMyRBD87blzdxLbnDrx8q7FMsQ il7gLFxh71PsI5aiGYKkgfAu2rdzIOEimoKc0WHe9RK8DBfO6Tz+98U/i6TfNpGttA0q icSg== 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=utRX+FKzKGOhWUruC699gQ1r9GagRoOg8O0pZA2bdiEAsZDIZ3jIV7XrwzG1ZNTu9r cA2PW/BpuM7tlDOInZ3e632YIIaocm7hAvAn6+ICY5YQYq/V++z4yoLq4MgBtHW9e93/ OEwC60boQ97XYIlP7iFpuK3ZnGGoNtbYA8DGyVRzlGn9EojeqEz+d178dxfqOkYTn5kE d4h4cq/NsBXHlFlIUvD6XeteroJ9XmX3H+/J9BiKyHRG923gMw9Z9I1Py3jxyynoyanm GUG1HyTqWKdBXFv8TsjU2QacIV9Vd56NPrVwI9t1Hl5G70ySGc2kyrBFm2eg4dAJiLqR gZiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="nbEHyq/K"; 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 q22-20020a631f56000000b003816043ef28si15007942pgm.285.2022.04.05.21.29.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 21:29:52 -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="nbEHyq/K"; 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 93237179B17; Tue, 5 Apr 2022 19:52:38 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351315AbiDEKCF (ORCPT + 99 others); Tue, 5 Apr 2022 06:02:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234193AbiDEIYn (ORCPT ); Tue, 5 Apr 2022 04:24:43 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D95712AC8; Tue, 5 Apr 2022 01:20:20 -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 3428760FFB; Tue, 5 Apr 2022 08:20:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 41DABC385A2; Tue, 5 Apr 2022 08:20:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649146819; bh=Yw9KpInkgsNYhh+OCNup/aC8fKxzxvvo6UbYxOjbCnQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nbEHyq/KmI0HilHKuvRBzjE7cGj7JK8JPtPIGPiyjnjZzYL7ohfSZ5rqy7ji7oKMu 1g2uy8cryi+wDS5WgXw7f3C/b99iiHAQF55yrMv1C0rQkeLpsQeAcc50NTNV38Xpp5 6XPbJa1pzLg20rTIagQimbrdb4mTacDVrjmp896Y= 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.17 0900/1126] media: iommu/mediatek: Return ENODEV if the device is NULL Date: Tue, 5 Apr 2022 09:27:27 +0200 Message-Id: <20220405070433.942304612@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070407.513532867@linuxfoundation.org> References: <20220405070407.513532867@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