Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp5320931pxv; Wed, 7 Jul 2021 00:36:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxD8qGFNfsuwpQk9r1DLJ4rR7t+NsrW9lGaHWGHiNwOtJyRJQIfkRPRJVfWxKKdoL+GD2Js X-Received: by 2002:a17:906:dbec:: with SMTP id yd12mr22261131ejb.102.1625643399080; Wed, 07 Jul 2021 00:36:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625643399; cv=none; d=google.com; s=arc-20160816; b=V8BM3EC/B9R8DNeIJCHYjAoL+Cu9YiB6kZRq2evqRGRqCsXvtsw8xiiApWkvEdWvxo KBvrGXBDWDtAN4ySwHlidBK6MEC9zCs/8qh64rglQqy1LrcwpHpH48Gzz7ff9zQNeLRx fU6cHHWCoDzT2iM49Ujot4K06NKxKL7yq8SjjJH/h+m2kBk4Jneh3UShSJSyAisoPEmD RhDTcGU5DyA7Rf5Mvnod81q1i0Ig846IrRbqin81ApbyomZUbphC1ZKeEkDcVGvNzG88 +kzpfX3dOQDxmDFcxfkSGhMdHWWiaZXV5IrsqPkJwQ3MzXscPV+3JFBQOENPVIpNJJ8g B1oA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=cz5Yf26hS0mQEs4OKDDFPHwtGleZDBuXb5hOWYwdOV4=; b=yBkwk+svj2yhINZQ8VL9xeT1yhjzvv158FwRbrsaf5B1Z5mROjhDJ4OgZW0rY5e9SE qzfHAtfwX3T2HBmjfIH6nxZeyoRTiAIDiRZkDop23pzqOGDl72EuTvNLdnqJecyNz0/r 0M/3s/mZ/tiG7YYSF/N5Hkmrywcvr7i98UsTxDtmejSwOJ666aGcvR7hcTQA1MmsadUE mLSwnhLKFkT5YcGGLwQ08qRPBSECnKsoTVd1FET6EThckc2mdcX7ckzQFzyTdjlut1Nc OSgLRO82/mAaUfEb4SAMMm3ZBIOB7msoV6V6gpQZMq2xV4eW1zSsKp0Ydb/HVNlQzABo pEMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="cf/lds2u"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bh4si14910849ejb.56.2021.07.07.00.36.16; Wed, 07 Jul 2021 00:36:39 -0700 (PDT) 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; dkim=pass header.i=@chromium.org header.s=google header.b="cf/lds2u"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230373AbhGGHht (ORCPT + 99 others); Wed, 7 Jul 2021 03:37:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230501AbhGGHhs (ORCPT ); Wed, 7 Jul 2021 03:37:48 -0400 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A830C06175F for ; Wed, 7 Jul 2021 00:35:08 -0700 (PDT) Received: by mail-pj1-x1035.google.com with SMTP id 22-20020a17090a0c16b0290164a5354ad0so3169445pjs.2 for ; Wed, 07 Jul 2021 00:35:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cz5Yf26hS0mQEs4OKDDFPHwtGleZDBuXb5hOWYwdOV4=; b=cf/lds2uXZML++gxAnlsKaNN9m0W9hvYqI8NMIfH7HW/ri1D+YjOSJ8H8329TEDwCM f0EPCHqhkbD0TD/R7ETL+mS9V0EUq/8uJQM59sU8wqqG9ZB2lWxEA8Aqi++WraUAKdh/ 1DwfBbbfvdpYzYXxTAZeEhSDFBGaFTP6Zwq6M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cz5Yf26hS0mQEs4OKDDFPHwtGleZDBuXb5hOWYwdOV4=; b=Vc6JbnC5eRBu0XCerdXV8vF+LrIO5mtjT9LJ7JIe8iUrlQnZiibwJ/DzpgLIliobBL 0j8sKRF+qEFVkNk0eFLdSIMffLE0s04pGIQXiMEFjmhbkgSOavBlF1urjaDOxfLcr9ER D1uz/XMsMcqCVA5XyAJS8++Byg7EeXKkrKNfa8JuisYXONiKC+N1dDjDH3Dkbj0rrPxC 4GX1ruZUrwfD2cqZD5sutyX14uOoD2HwWCuxdylnarzViB8uaQRPnQ6KnYgSuwHYZRA4 aspqfHZg2xIpZl7/SUmN+XuT4yW3d87PA9/iWIaxwoUrLE5xpD9ERbacX7FvjygGAZ+6 2gSQ== X-Gm-Message-State: AOAM532/2QuPn1120OfISb6WfNZqRLEU/s2KilHZgzZLHmhUijvt2vGe 5iHLIfyQ7ADvCKVws0TuURvXcJQBVqIRig== X-Received: by 2002:a17:90b:4b82:: with SMTP id lr2mr16752540pjb.111.1625643307806; Wed, 07 Jul 2021 00:35:07 -0700 (PDT) Received: from localhost ([2401:fa00:9:14:ccb9:d95f:4dac:dbc4]) by smtp.gmail.com with UTF8SMTPSA id m10sm19087343pff.215.2021.07.07.00.35.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 07 Jul 2021 00:35:07 -0700 (PDT) From: Eizan Miyamoto To: linux-kernel@vger.kernel.org Cc: houlong.wei@mediatek.com, enric.balletbo@collabora.com, wenst@chromium.org, yong.wu@mediatek.com, chunkuang.hu@kernel.org, Eizan Miyamoto , Andrew-CT Chen , Matthias Brugger , Mauro Carvalho Chehab , Minghsiu Tsai , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH v4 5/8] media: mtk-mdp: search for vpu node instead of linking it to a property Date: Wed, 7 Jul 2021 17:34:07 +1000 Message-Id: <20210707173108.v4.5.I0cbd6691d3edfa2757bd6f5de7acfce94b101480@changeid> X-Mailer: git-send-email 2.32.0.93.g670b81a890-goog In-Reply-To: <20210707073410.999625-1-eizan@chromium.org> References: <20210707073410.999625-1-eizan@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since there is only one vpu node, it suffices to search for it instead of having a link coded into the primary mdp device node. Signed-off-by: Eizan Miyamoto --- (no changes since v1) drivers/media/platform/mtk-mdp/mtk_mdp_comp.c | 6 ---- drivers/media/platform/mtk-mdp/mtk_mdp_core.c | 28 +++++++++++++------ 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/drivers/media/platform/mtk-mdp/mtk_mdp_comp.c b/drivers/media/platform/mtk-mdp/mtk_mdp_comp.c index fdbb46a5330a..3d9bb7265159 100644 --- a/drivers/media/platform/mtk-mdp/mtk_mdp_comp.c +++ b/drivers/media/platform/mtk-mdp/mtk_mdp_comp.c @@ -117,12 +117,6 @@ static int mtk_mdp_comp_bind(struct device *dev, struct device *master, if (vpu_node) { int ret; - mdp->vpu_dev = of_find_device_by_node(vpu_node); - if (WARN_ON(!mdp->vpu_dev)) { - dev_err(dev, "vpu pdev failed\n"); - of_node_put(vpu_node); - } - ret = v4l2_device_register(dev, &mdp->v4l2_dev); if (ret) { dev_err(dev, "Failed to register v4l2 device\n"); diff --git a/drivers/media/platform/mtk-mdp/mtk_mdp_core.c b/drivers/media/platform/mtk-mdp/mtk_mdp_core.c index 267e4cb4bf32..48e9a557c446 100644 --- a/drivers/media/platform/mtk-mdp/mtk_mdp_core.c +++ b/drivers/media/platform/mtk-mdp/mtk_mdp_core.c @@ -113,6 +113,7 @@ static void release_of(struct device *dev, void *data) static int mtk_mdp_master_bind(struct device *dev) { int status; + struct device_node *vpu_node; struct mtk_mdp_dev *mdp = dev_get_drvdata(dev); status = component_bind_all(dev, mdp); @@ -121,15 +122,24 @@ static int mtk_mdp_master_bind(struct device *dev) goto err_component_bind_all; } - if (mdp->vpu_dev) { - int ret = vpu_wdt_reg_handler(mdp->vpu_dev, mtk_mdp_reset_handler, mdp, - VPU_RST_MDP); - if (ret) { - dev_err(dev, "Failed to register reset handler\n"); - goto err_wdt_reg; - } - } else { - dev_err(dev, "no vpu_dev found\n"); + vpu_node = of_find_node_by_name(NULL, "vpu"); + if (!vpu_node) { + dev_err(dev, "unable to find vpu node"); + status = -ENODEV; + goto err_wdt_reg; + } + + mdp->vpu_dev = of_find_device_by_node(vpu_node); + if (!mdp->vpu_dev) { + dev_err(dev, "unable to find vpu device"); + status = -ENODEV; + goto err_wdt_reg; + } + + status = vpu_wdt_reg_handler(mdp->vpu_dev, mtk_mdp_reset_handler, mdp, VPU_RST_MDP); + if (status) { + dev_err(dev, "Failed to register reset handler\n"); + goto err_wdt_reg; } status = mtk_mdp_register_m2m_device(mdp); -- 2.32.0.93.g670b81a890-goog