mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sagar Cheluvegowda <quic_scheluve@quicinc.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Vinod Koul <vkoul@kernel.org>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Jose Abreu <joabreu@synopsys.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	"Rob Herring" <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	Bhupesh Sharma <bhupesh.sharma@linaro.org>, <kernel@quicinc.com>,
	Andrew Halaney <ahalaney@redhat.com>,
	<linux-arm-msm@vger.kernel.org>, <netdev@vger.kernel.org>,
	<linux-stm32@st-md-mailman.stormreply.com>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>, <devicetree@vger.kernel.org>
Subject: Re: [PATCH v2 2/3] net: stmmac: Add interconnect support
Date: Fri, 28 Jun 2024 14:58:24 -0700	[thread overview]
Message-ID: <22edcb67-9c25-4d16-ab5c-7522c710b1e2@quicinc.com> (raw)
In-Reply-To: <974114ca-98ed-44a7-a038-eb3f71bd03ef@lunn.ch>



On 6/26/2024 5:12 PM, Andrew Lunn wrote:
> On Wed, Jun 26, 2024 at 04:36:06PM -0700, Sagar Cheluvegowda wrote:
>>
>>
>> On 6/26/2024 6:07 AM, Andrew Lunn wrote:
>>>> +	plat->axi_icc_path = devm_of_icc_get(&pdev->dev, "axi");
>>>> +	if (IS_ERR(plat->axi_icc_path)) {
>>>> +		ret = (void *)plat->axi_icc_path;
>>>
>>> Casting	to a void * seems odd. ERR_PTR()?
>>>
>>> 	Andrew
>>
>> The output of devm_of_icc_get is a pointer of type icc_path,
>> i am getting below warning when i try to ERR_PTR instead of Void*
>> as ERR_PTR will try to convert a long integer to a Void*.
>>
>> "warning: passing argument 1 of ‘ERR_PTR’ makes integer from pointer without a cast"
>>
> 
> https://elixir.bootlin.com/linux/v6.10-rc5/source/drivers/crypto/qce/core.c#L224
> https://elixir.bootlin.com/linux/v6.10-rc5/source/drivers/gpu/drm/msm/adreno/a3xx_gpu.c#L591
> https://elixir.bootlin.com/linux/v6.10-rc5/source/drivers/gpu/drm/msm/adreno/a3xx_gpu.c#L597
> https://elixir.bootlin.com/linux/v6.10-rc5/source/drivers/spi/spi-qup.c#L1052
> 
> Sorry, PTR_ERR().
> 
> In general, a cast to a void * is a red flag and will get looked
> at. It is generally wrong. So you might want to fixup where ever you
> copied this from.
> 
> 	Andrew
the return type of stmmac_probe_config_dt is a pointer of type plat_stmmacenet_data,
as PTR_ERR would give long integer value i don't think it would be ideal to
return an integer value here, if casting plat->axi_icc_path to a void * doesn't look
good, let me if the below solution is better or not?


 	plat->axi_icc_path = devm_of_icc_get(&pdev->dev, "axi");
	if (IS_ERR(plat->axi_icc_path)) {
		rc = PTR_ERR(plat->axi_icc_path);
		ret = ERR_PTR(rc);
		goto error_hw_init;
	}

	plat->ahb_icc_path = devm_of_icc_get(&pdev->dev, "ahb");
	if (IS_ERR(plat->ahb_icc_path)) {
		rc = PTR_ERR(plat->ahb_icc_path);
		ret = ERR_PTR(rc);
		goto error_hw_init;
	}

	plat->stmmac_rst = devm_reset_control_get_optional(&pdev->dev,
							   STMMAC_RESOURCE_NAME);
	if (IS_ERR(plat->stmmac_rst)) {
		ret = plat->stmmac_rst;
		goto error_hw_init;
	}

	plat->stmmac_ahb_rst = devm_reset_control_get_optional_shared(
							&pdev->dev, "ahb");
	if (IS_ERR(plat->stmmac_ahb_rst)) {
		ret = plat->stmmac_ahb_rst;
		goto error_hw_init;
	}

	return plat;

error_hw_init:
	clk_disable_unprepare(plat->pclk);
error_pclk_get:
	clk_disable_unprepare(plat->stmmac_clk);

	return ret;
}

Regards,
Sagar

  reply	other threads:[~2024-06-28 21:58 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-25 23:49 [PATCH v2 0/3] Add interconnect support for stmmac driver Sagar Cheluvegowda
2024-06-25 23:49 ` [PATCH v2 1/3] dt-bindings: net: qcom: ethernet: Add interconnect properties Sagar Cheluvegowda
2024-06-26  7:39   ` Krzysztof Kozlowski
2024-06-26 14:53   ` Andrew Halaney
2024-07-02 18:50     ` Sagar Cheluvegowda
2024-06-25 23:49 ` [PATCH v2 2/3] net: stmmac: Add interconnect support Sagar Cheluvegowda
2024-06-26  7:40   ` Krzysztof Kozlowski
2024-06-28 19:43     ` Sagar Cheluvegowda
2024-06-28 20:12       ` Andrew Lunn
2024-06-26 13:07   ` Andrew Lunn
2024-06-26 23:36     ` Sagar Cheluvegowda
2024-06-27  0:12       ` Andrew Lunn
2024-06-28 21:58         ` Sagar Cheluvegowda [this message]
2024-06-28 22:23           ` Andrew Lunn
2024-06-28 22:41             ` Sagar Cheluvegowda
2024-06-26 14:54   ` Andrew Halaney
2024-06-26 23:38     ` Sagar Cheluvegowda
2024-06-27  0:14       ` Andrew Lunn
2024-06-28 19:55         ` Sagar Cheluvegowda
2024-06-25 23:49 ` [PATCH v2 3/3] net: stmmac: Bring down the clocks to lower frequencies when mac link goes down Sagar Cheluvegowda
2024-06-26 14:58   ` Andrew Halaney
2024-06-26 15:10     ` Andrew Lunn
2024-06-28 21:50     ` Sagar Cheluvegowda
2024-07-01 19:18       ` Sagar Cheluvegowda
2024-06-28 22:16   ` Russell King (Oracle)
2024-07-02 23:38     ` Sagar Cheluvegowda

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=22edcb67-9c25-4d16-ab5c-7522c710b1e2@quicinc.com \
    --to=quic_scheluve@quicinc.com \
    --cc=ahalaney@redhat.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andrew@lunn.ch \
    --cc=bhupesh.sharma@linaro.org \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=joabreu@synopsys.com \
    --cc=kernel@quicinc.com \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=linux@armlinux.org.uk \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=robh@kernel.org \
    --cc=vkoul@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

all inboxes | Powered by JetHome®