The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Yemike Abhilash Chandra <y-abhilashchandra@ti.com>,
	mchehab@kernel.org, robh@kernel.org, krzk+dt@kernel.org,
	conor+dt@kernel.org, hverkuil+cisco@kernel.org
Cc: sakari.ailus@linux.intel.com, bparrot@ti.com,
	jai.luthra@ideasonboard.com, dale@farnsworth.org,
	linux-media@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, u-kumar1@ti.com,
	Sukrut Bellary <sbellary@baylibre.com>
Subject: Re: [PATCH V4 4/4] media: ti: vpe: Add the VIP driver
Date: Fri, 17 Oct 2025 07:23:28 +0200	[thread overview]
Message-ID: <8554dfe1-6dec-49b4-9c34-e51bd4e28404@kernel.org> (raw)
In-Reply-To: <87e5f31a-5c3d-4cc0-8146-1b6b5923136b@kernel.org>

On 17/10/2025 07:19, Krzysztof Kozlowski wrote:
> On 15/10/2025 07:40, Yemike Abhilash Chandra wrote:
>> +static int vip_probe_complete(struct platform_device *pdev)
>> +{
>> +	struct vip_shared *shared = platform_get_drvdata(pdev);
>> +	struct vip_ctrl_module *ctrl = NULL;
>> +	struct vip_port *port;
>> +	struct vip_dev *dev;
>> +	struct device_node *parent = pdev->dev.of_node;
>> +	struct fwnode_handle *ep = NULL;
>> +	struct of_phandle_args args;
>> +	int ret, i, slice_id, port_id, p;
>> +
>> +	/* Allocate ctrl before using it */
>> +	ctrl = devm_kzalloc(&pdev->dev, sizeof(*ctrl), GFP_KERNEL);
>> +	if (!ctrl)
>> +		return -ENOMEM;
>> +
>> +	if (parent && of_property_present(parent, "ti,ctrl-module")) {
>> +		ctrl->syscon_pol = syscon_regmap_lookup_by_phandle(parent,
>> +								   "ti,ctrl-module");
>> +		if (IS_ERR(ctrl->syscon_pol))
>> +			return dev_err_probe(&pdev->dev, PTR_ERR(ctrl->syscon_pol),
>> +				     "Failed to get ti,ctrl-module regmap\n");
>> +	}
>> +
>> +	ret = of_parse_phandle_with_fixed_args(parent, "ti,ctrl-module",
>> +					       5, 0, &args);
> 
> 1. You leak parent.


I meant args->np, obviously.

> 2. Why you can't just just take it from syscon call? This is not only
> leaking, but actually duplicated and unnecessary.
> 
>> +
Best regards,
Krzysztof

      reply	other threads:[~2025-10-17  5:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-15  5:40 [PATCH V4 0/4] Add support for TI VIP Yemike Abhilash Chandra
2025-10-15  5:40 ` [PATCH V4 1/4] media: ti: vpe: Re-introduce multi-instance and multi-client support Yemike Abhilash Chandra
2025-10-15  5:40 ` [PATCH V4 2/4] media: ti: vpe: Export vpdma_load_firmware() function Yemike Abhilash Chandra
2025-10-15  5:40 ` [PATCH V4 3/4] dt-bindings: media: ti: vpe: Add support for Video Input Port Yemike Abhilash Chandra
2025-10-21  6:46   ` Krzysztof Kozlowski
2025-10-15  5:40 ` [PATCH V4 4/4] media: ti: vpe: Add the VIP driver Yemike Abhilash Chandra
2025-10-17  5:19   ` Krzysztof Kozlowski
2025-10-17  5:23     ` Krzysztof Kozlowski [this message]

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=8554dfe1-6dec-49b4-9c34-e51bd4e28404@kernel.org \
    --to=krzk@kernel.org \
    --cc=bparrot@ti.com \
    --cc=conor+dt@kernel.org \
    --cc=dale@farnsworth.org \
    --cc=devicetree@vger.kernel.org \
    --cc=hverkuil+cisco@kernel.org \
    --cc=jai.luthra@ideasonboard.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=robh@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=sbellary@baylibre.com \
    --cc=u-kumar1@ti.com \
    --cc=y-abhilashchandra@ti.com \
    /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