From patchwork Fri Dec 29 22:56:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 758866 Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ACBCA14ABF for ; Fri, 29 Dec 2023 22:56:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="GQJKCTil" Received: by mail-lf1-f45.google.com with SMTP id 2adb3069b0e04-50e7b9cca2fso4415530e87.3 for ; Fri, 29 Dec 2023 14:56:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703890614; x=1704495414; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jWBx35fV7am+45bKhj9ZTSkIR2B0OijQCf07KK7Jt+Q=; b=GQJKCTilWbpzTQX6HNAvNLkD1L3x4Kst3d84N0N8ZcLjdJlLBrapkbL6HeXta6SAPM fpkjbO1Ql6Vp2k+DvRj+w1Q8jMwMVECgYJAsHRzHEqyHjkHnE9s2v/Dt2UFfTpAIBBxQ hj7GdAnYhj0bCki0lKjkbbv5r8VgWQUoAxy9WWPyTQiKaZ76cthJ4gGRMz0++rGt4eat qj5i7oFDlLlTTbO56DRrb9M/XQ6JFZJw+9HFBo6ugknil7BAlHLSYLbQr7x1imJFxvLY +3WXg1JNd9EBcKREESU5yErYQrc1IcY/O5VMbFFAiftfvy4BZ552dX6qRgWVxpR31Ce/ PgTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703890614; x=1704495414; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jWBx35fV7am+45bKhj9ZTSkIR2B0OijQCf07KK7Jt+Q=; b=srkIBpTR+6oXTkx+fF7oeeD2Zo6vVypepiaqI5hEc72PDSho0wtOMfjXe56EVpfBi5 wmTD1sph6B/hdIZwqJEBtHBfCVdtiNbH3CCCkPEXQQji3kGF4MmTcBdoSyyfxfKg77ck 8kjCpQFWVCc8wdjnI+pccfSciDpgrw/hHqtGKynhK+dhb9dG5k3LYOiA1bphj+EoFMZR 4ohAhBTb8opCs26q+NAH6h5bwTTUH/TADG9Wt+PPtxv1aRJjeqySbsocrvzVzef7lbxf T3v+AWbf54hgNbkFLArpjsf9Nacvx8kcSAjTPPIzgnLtlQQ7S1ZvRrX+zPL8uGUjMPAx MYgA== X-Gm-Message-State: AOJu0YxTMI75KYnX6pBGSTnIxp4oHx/RTzgM/LW9vavFtmV+vuzi4ILn 6ls4k5HA2O7DXevxiH5kyiUp1Tpp8qNE1Q== X-Google-Smtp-Source: AGHT+IEsqRR6tFpvAIToSg3ICrRygtYsNovZRsfVa0nASyoZr6OoPbwyPxFEPhrlxt6uLlFRSiEtQg== X-Received: by 2002:ac2:58ca:0:b0:50e:7c6e:dcaf with SMTP id u10-20020ac258ca000000b0050e7c6edcafmr3144927lfo.35.1703890613826; Fri, 29 Dec 2023 14:56:53 -0800 (PST) Received: from umbar.unikie.fi ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id j26-20020ac2455a000000b0050e7f5794cbsm1326952lfm.309.2023.12.29.14.56.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Dec 2023 14:56:53 -0800 (PST) From: Dmitry Baryshkov To: Rob Clark , Sean Paul , Abhinav Kumar , Kuogee Hsieh , Sankeerth Billakanti Cc: Bjorn Andersson , Konrad Dybcio , Stephen Boyd , David Airlie , Daniel Vetter , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: [PATCH 03/14] drm/msm/dp: parse DT from dp_parser_get Date: Sat, 30 Dec 2023 00:56:39 +0200 Message-Id: <20231229225650.912751-4-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231229225650.912751-1-dmitry.baryshkov@linaro.org> References: <20231229225650.912751-1-dmitry.baryshkov@linaro.org> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 It makes little sense to split the submodule get and actual DT parsing. Call dp_parser_parse() directly from dp_parser_get(), so that the parser data is fully initialised once it is returned to the caller. Signed-off-by: Dmitry Baryshkov Reviewed-by: Konrad Dybcio --- drivers/gpu/drm/msm/dp/dp_display.c | 6 ------ drivers/gpu/drm/msm/dp/dp_parser.c | 8 +++++++- drivers/gpu/drm/msm/dp/dp_parser.h | 3 --- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index d37d599aec27..67b48f0a6c83 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -1266,12 +1266,6 @@ static int dp_display_probe(struct platform_device *pdev) return -EPROBE_DEFER; } - rc = dp->parser->parse(dp->parser); - if (rc) { - DRM_ERROR("device tree parsing failed\n"); - goto err; - } - rc = dp_power_client_init(dp->power); if (rc) { DRM_ERROR("Power client create failed\n"); diff --git a/drivers/gpu/drm/msm/dp/dp_parser.c b/drivers/gpu/drm/msm/dp/dp_parser.c index 7032dcc8842b..2d9d126c119b 100644 --- a/drivers/gpu/drm/msm/dp/dp_parser.c +++ b/drivers/gpu/drm/msm/dp/dp_parser.c @@ -315,13 +315,19 @@ static int dp_parser_parse(struct dp_parser *parser) struct dp_parser *dp_parser_get(struct platform_device *pdev) { struct dp_parser *parser; + int ret; parser = devm_kzalloc(&pdev->dev, sizeof(*parser), GFP_KERNEL); if (!parser) return ERR_PTR(-ENOMEM); - parser->parse = dp_parser_parse; parser->pdev = pdev; + ret = dp_parser_parse(parser); + if (ret) { + dev_err(&pdev->dev, "device tree parsing failed\n"); + return ERR_PTR(ret); + } + return parser; } diff --git a/drivers/gpu/drm/msm/dp/dp_parser.h b/drivers/gpu/drm/msm/dp/dp_parser.h index 90a2cdbbe344..4ccc432b4142 100644 --- a/drivers/gpu/drm/msm/dp/dp_parser.h +++ b/drivers/gpu/drm/msm/dp/dp_parser.h @@ -67,7 +67,6 @@ struct dss_module_power { * * @pdev: platform data of the client * @mp: gpio, regulator and clock related data - * @parse: function to be called by client to parse device tree. */ struct dp_parser { struct platform_device *pdev; @@ -76,8 +75,6 @@ struct dp_parser { u32 max_dp_lanes; u32 max_dp_link_rate; struct drm_bridge *next_bridge; - - int (*parse)(struct dp_parser *parser); }; /**