Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1279515pxj; Fri, 18 Jun 2021 03:44:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyetrMZf1aPyOxjIoKAEC0KhPdJdv97KdjLTeH3tU8n05Kl7qDAhtYwhPdT74XlhN0tL37r X-Received: by 2002:a5d:97d9:: with SMTP id k25mr7549273ios.197.1624013057410; Fri, 18 Jun 2021 03:44:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624013057; cv=none; d=google.com; s=arc-20160816; b=pxSmOi64PFc1VUYHcl64xulr0669v70PMtWC7vviv6F35ePDxldEo6v5nCVU3Y3lir tRdjzDG7bY3/AADA+/6KTztMJCK03hF/2HB5e3YUCFvweGeUIXRn7WtqVir5kKSDtyKr zgZR+j072IokxxUUNERD7If5EV0AcRXTD8XUIcS/UVUNgoQsX3c8ddkVKil7PmsFB8Bq rJjXcVZRuI2rUrJjs7whZbMQltkF2lk2OVsSOBWbOK7h4Lo2fsJ0ciJQxo5waO1CRMGJ EBO7/UlzYn0LkpHyDv8/qgd0uUadQUXMsF23ezy5/QPSrE+21wppKcfubHFkF9LIMYpV ezFQ== 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=Zi7IELJ4JOaUAbM1DjeUA9NzNlwKb+WJHoeuipTJh1o=; b=p0HxwzexnistsEuWOw08cNfCC4p8jICmwKAsUw+/VedBWZvF4i6P926ehq51LVQntD 5AIS0S6SkOneLfN8Y8YMCCTsdyHrub/gm6o6MJuS7ckkn3wLKh3wmjzvDV9g2LW0aa4v u6RDbWfWVXVdRlFLL0zRFC0IyivmVtsAehGljPBxznQfeg3bbBKan1lEu601rOyH0YQu WmHVlv2Az2NHivicxnBAgM0shDB2GQiTFoL8dGnt5b0MxnHO1L8JXzOTNq6iUHzzHkNe iqM+N+LpCp9wHbdgA1XR+QOZHHZr+s3KS18onq6heAm5vMmWpCYv9WpthorYqeGp9/XX Djnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=btun3AMr; 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 j1si2085854ila.160.2021.06.18.03.44.05; Fri, 18 Jun 2021 03:44:17 -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=btun3AMr; 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 S232174AbhFRHzQ (ORCPT + 99 others); Fri, 18 Jun 2021 03:55:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233523AbhFRHzK (ORCPT ); Fri, 18 Jun 2021 03:55:10 -0400 Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 082FBC061767 for ; Fri, 18 Jun 2021 00:53:01 -0700 (PDT) Received: by mail-pg1-x52f.google.com with SMTP id t9so7119727pgn.4 for ; Fri, 18 Jun 2021 00:53:01 -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=Zi7IELJ4JOaUAbM1DjeUA9NzNlwKb+WJHoeuipTJh1o=; b=btun3AMrfxJb7yR0q11FW27P6OLfmnJTdE6FEJ/f7vf4QAzRSqgVq9YBsqGk3LsxAC Bdk376B3bKNBrW3bVAsxL9TlUyX6u8I7afAdAxb0lASCoBaj+uXQa2I8yZbVUZIOKuKr bjxB7Dz6DtX4UnCd+U/Thfo2RNRkYuOpEwn/g= 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=Zi7IELJ4JOaUAbM1DjeUA9NzNlwKb+WJHoeuipTJh1o=; b=KGzQx7TtcpjPtfFHInLmUbS3hoQkxBNifJL8CTiOiAO0J0Cos53J3RG4q89qvnc0rR kwv9+TgtU7gxKs9ST7ftCPspORofxZao9h/12U37el26wtdKcqqTQoRdHowsZ655iFTb komohuXKpaRX0XbR2eZ4PE+W8nRj4QGUn66JwYoepdYxk5uDJpfRQwliQ2BsXGTFnQCo dLGPj83hCuVM8p3jwEr80ZjekITLJUuDBqFoqiQkxdRXx4yGCxEWHJhuH6G0JBI59ivc 5dRxJsMuwKl4xblIj/UaEMvRdvCdB83zUu2b2lN6o9yG/01Ji5SkjdB6fYDLa2FTRjjj OwQA== X-Gm-Message-State: AOAM533nvn1Nk5NlZ20LqPhInLsFUXPNYt5d5LgIBYxMM9LnGYD2f7R0 QAncvY2VCtXbFMizSWCzzElVkas0u1VA9Yzw X-Received: by 2002:a05:6a00:1629:b029:2ef:f4de:244f with SMTP id e9-20020a056a001629b02902eff4de244fmr3894275pfc.6.1624002780347; Fri, 18 Jun 2021 00:53:00 -0700 (PDT) Received: from localhost ([2401:fa00:9:14:3e8:19ca:3d8a:e112]) by smtp.gmail.com with UTF8SMTPSA id 35sm6706429pjo.16.2021.06.18.00.52.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 18 Jun 2021 00:53:00 -0700 (PDT) From: Eizan Miyamoto To: linux-kernel@vger.kernel.org Cc: yong.wu@mediatek.com, houlong.wei@mediatek.com, enric.balletbo@collabora.com, chunkuang.hu@kernel.org, wenst@chromium.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 v3 5/8] media: mtk-mdp: search for vpu node instead of linking it to a property Date: Fri, 18 Jun 2021 17:52:06 +1000 Message-Id: <20210618175059.v3.5.I0cbd6691d3edfa2757bd6f5de7acfce94b101480@changeid> X-Mailer: git-send-email 2.32.0.288.g62a8d224e6-goog In-Reply-To: <20210618075209.1157766-1-eizan@chromium.org> References: <20210618075209.1157766-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.288.g62a8d224e6-goog