linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Robert Foss <robert.foss@linaro.org>
Cc: geert+renesas@glider.be, catalin.marinas@arm.com,
	agx@sigxcpu.org, todor.too@gmail.com,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	AngeloGioacchino Del Regno <kholk11@gmail.com>,
	will@kernel.org, Anson.Huang@nxp.com, agross@kernel.org,
	Andrey Konovalov <andrey.konovalov@linaro.org>,
	linux-media@vger.kernel.org, devicetree@vger.kernel.org,
	Tomasz Figa <tfiga@chromium.org>,
	arnd@arndb.de, linux-arm-msm@vger.kernel.org, robh+dt@kernel.org,
	mchehab@kernel.org, linux-arm-kernel@lists.infradead.org,
	Sarvesh Sridutt <Sarvesh.Sridutt@smartwirelesscompute.com>,
	max.oss.09@gmail.com, linux-kernel@vger.kernel.org,
	leoyang.li@nxp.com, michael@walle.cc,
	Azam Sadiq Pasha Kapatrala Syed <akapatra@quicinc.com>,
	shawnguo@kernel.org
Subject: Re: [PATCH v1 04/17] media: camss: Make ISPIF subdevice optional
Date: Fri, 8 Jan 2021 13:07:17 -0600	[thread overview]
Message-ID: <X/itZVFeM0XeV9Sx@builder.lan> (raw)
In-Reply-To: <20210108120429.895046-5-robert.foss@linaro.org>

On Fri 08 Jan 06:04 CST 2021, Robert Foss wrote:

> This driver supports multiple architecture versions of the Qualcomm ISP.
> The CAMSS architecure which this driver is name after, and with the
> introduction of this series, the Titan architecture.
> 
> The ISPIF is IP-block that is only present in the CAMSS architecture.

"is an IP-block"

> In order to support the Titan architecture, make the ISPIF an optional
> subdevice.
> 
> Signed-off-by: Robert Foss <robert.foss@linaro.org>
> ---
>  .../media/platform/qcom/camss/camss-ispif.c   | 144 ++++++++++--------
>  .../media/platform/qcom/camss/camss-ispif.h   |   3 +-
>  drivers/media/platform/qcom/camss/camss.c     | 113 +++++++++-----
>  drivers/media/platform/qcom/camss/camss.h     |   2 +-
>  4 files changed, 160 insertions(+), 102 deletions(-)
> 
> diff --git a/drivers/media/platform/qcom/camss/camss-ispif.c b/drivers/media/platform/qcom/camss/camss-ispif.c
[..]
> -int msm_ispif_subdev_init(struct ispif_device *ispif,
> +int msm_ispif_subdev_init(struct camss *camss,
>  			  const struct resources_ispif *res)
>  {
> -	struct device *dev = to_device(ispif);
> -	struct platform_device *pdev = to_platform_device(dev);
> +	struct ispif_device *ispif = camss->ispif;
> +	struct platform_device *pdev = to_platform_device(camss->dev);

It seems like several of the changes in this function is replacing
dev with camss->dev. If you retained a struct device *dev = camss->dev;
you would avoid this.

>  	struct resource *r;
>  	int i;
>  	int ret;
>  
> +	if (res == NULL && ispif == NULL)

Afaict this function is called conditional on camss->ispif != NULL, and
I don't see anything that would cause res to becomes NULL if is hasn't
been before this change.

So I think this check is unnecessary?

> +		return 0;
> +
> +	ispif->camss = camss;
> +
>  	/* Number of ISPIF lines - same as number of CSID hardware modules */
> -	if (to_camss(ispif)->version == CAMSS_8x16)
> +	if (camss->version == CAMSS_8x16)
>  		ispif->line_num = 2;
> -	else if (to_camss(ispif)->version == CAMSS_8x96 ||
> -		 to_camss(ispif)->version == CAMSS_660)
> +	else if (camss->version == CAMSS_8x96 ||
> +		 camss->version == CAMSS_660)
>  		ispif->line_num = 4;
>  	else
>  		return -EINVAL;
>  
> -	ispif->line = devm_kcalloc(dev, ispif->line_num, sizeof(*ispif->line),
> -				   GFP_KERNEL);
> +	ispif->line = devm_kcalloc(camss->dev, ispif->line_num,
> +			sizeof(*ispif->line), GFP_KERNEL);
>  	if (!ispif->line)
>  		return -ENOMEM;
>  
[..]
> @@ -1393,6 +1410,9 @@ void msm_ispif_unregister_entities(struct ispif_device *ispif)
>  {
>  	int i;
>  
> +	if (!ispif)
> +		return;

I like this, but later in the patch you make the calls to this function
conditional on ispif != NULL. You should only need one of the checks.

Regards,
Bjorn

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-01-08 19:08 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-08 12:04 [PATCH v1 00/17] Add support for SDM845 Camera Subsystem Robert Foss
2021-01-08 12:04 ` [PATCH v1 01/17] media: camss: Fix comment using wrong function name Robert Foss
2021-01-08 18:51   ` Bjorn Andersson
2021-01-13 10:04     ` Robert Foss
2021-01-08 12:04 ` [PATCH v1 02/17] media: camss: Fix vfe_isr comment typo Robert Foss
2021-01-08 18:51   ` Bjorn Andersson
2021-01-13 10:04     ` Robert Foss
2021-01-08 12:04 ` [PATCH v1 03/17] media: camss: Add CAMSS_845 camss version Robert Foss
2021-01-08 12:04 ` [PATCH v1 04/17] media: camss: Make ISPIF subdevice optional Robert Foss
2021-01-08 19:07   ` Bjorn Andersson [this message]
2021-01-13 15:02     ` Robert Foss
2021-01-13 22:28   ` Andrey Konovalov
2021-01-14  9:55     ` Robert Foss
2021-01-08 12:04 ` [PATCH v1 06/17] media: camss: Add support for VFE hardware version Titan 170 Robert Foss
2021-01-14 10:48   ` Andrey Konovalov
2021-01-14 12:07     ` Robert Foss
2021-01-08 12:04 ` [PATCH v1 07/17] media: camss: Add missing format identifiers Robert Foss
2021-01-08 12:04 ` [PATCH v1 08/17] media: camss: Refactor CSID HW version support Robert Foss
2021-01-08 12:04 ` [PATCH v1 09/17] media: camss: Add support for CSID hardware version Titan 170 Robert Foss
2021-01-08 12:04 ` [PATCH v1 10/17] media: camss: Add support for CSIPHY " Robert Foss
2021-01-08 12:04 ` [PATCH v1 11/17] media: camss: Remove per VFE power domain toggling Robert Foss
2021-01-08 12:04 ` [PATCH v1 12/17] media: dt-bindings: media: qcom, camss: Add bindings for SDM845 camss Robert Foss
2021-01-09  1:44   ` [PATCH v1 12/17] media: dt-bindings: media: qcom,camss: " Laurent Pinchart
2021-01-08 12:04 ` [PATCH v1 13/17] media: camss: Enable SDM845 Robert Foss
2021-01-08 12:04 ` [PATCH v1 14/17] arm64: defconfig: Build Qcom CAMSS as module Robert Foss
2021-01-08 12:04 ` [PATCH v1 15/17] arm64: dts: sdm845: Add CAMSS ISP node Robert Foss
2021-01-08 12:04 ` [PATCH v1 16/17] arm64: dts: sdm845-db845c: " Robert Foss
2021-01-09  1:47   ` Laurent Pinchart
2021-01-13 10:03     ` Robert Foss
2021-01-08 12:04 ` [PATCH v1 17/17] arm64: dts: sdm845-db845c: Enable ov8856 sensor and connect to ISP Robert Foss

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=X/itZVFeM0XeV9Sx@builder.lan \
    --to=bjorn.andersson@linaro.org \
    --cc=Anson.Huang@nxp.com \
    --cc=Sarvesh.Sridutt@smartwirelesscompute.com \
    --cc=agross@kernel.org \
    --cc=agx@sigxcpu.org \
    --cc=akapatra@quicinc.com \
    --cc=andrey.konovalov@linaro.org \
    --cc=arnd@arndb.de \
    --cc=catalin.marinas@arm.com \
    --cc=devicetree@vger.kernel.org \
    --cc=geert+renesas@glider.be \
    --cc=kholk11@gmail.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=leoyang.li@nxp.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=max.oss.09@gmail.com \
    --cc=mchehab@kernel.org \
    --cc=michael@walle.cc \
    --cc=robert.foss@linaro.org \
    --cc=robh+dt@kernel.org \
    --cc=shawnguo@kernel.org \
    --cc=tfiga@chromium.org \
    --cc=todor.too@gmail.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).