devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oliver Neukum <oneukum@suse.com>
To: Stanley Chang <stanley_chang@realtek.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Vinod Koul <vkoul@kernel.org>,
	Kishon Vijay Abraham I <kishon@kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Alan Stern <stern@rowland.harvard.edu>,
	Flavio Suligoi <f.suligoi@asem.it>, Roy Luo <royluo@google.com>,
	Bagas Sanjaya <bagasdotme@gmail.com>, Ray Chi <raychi@google.com>,
	linux-phy@lists.infradead.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org
Subject: Re: [PATCH v9 2/5] phy: realtek: usb: Add driver for the Realtek SoC USB 2.0 PHY
Date: Wed, 26 Jul 2023 10:13:53 +0200	[thread overview]
Message-ID: <a11f0ec8-7eaa-aa3e-8b86-555e5dbe6e3e@suse.com> (raw)
In-Reply-To: <20230725033318.8361-2-stanley_chang@realtek.com>


Hi,

On 25.07.23 05:31, Stanley Chang wrote:
> +static int get_phy_data_by_efuse(struct rtk_phy *rtk_phy,
> +				 struct phy_parameter *phy_parameter, int index)
> +{
> +	struct phy_cfg *phy_cfg = rtk_phy->phy_cfg;
> +	u8 value = 0;
> +	struct nvmem_cell *cell;
> +	struct soc_device_attribute rtk_soc_groot[] = {
> +		    { .family = "Realtek Groot",},
> +		    { /* empty */ } };
> +
> +	if (!phy_cfg->check_efuse)
> +		goto out;
> +
> +	/* Read efuse for usb dc cal */
> +	cell = nvmem_cell_get(rtk_phy->dev, "usb-dc-cal");
> +	if (IS_ERR(cell)) {
> +		dev_dbg(rtk_phy->dev, "%s no usb-dc-cal: %ld\n",
> +			__func__, PTR_ERR(cell));
> +	} else {
> +		unsigned char *buf;
> +		size_t buf_size;
> +
> +		buf = nvmem_cell_read(cell, &buf_size);
> +		value = buf[0] & phy_cfg->dc_driving_mask;
> +
> +		kfree(buf);
> +		nvmem_cell_put(cell);

nvmem_cell_read() can take NULL as the second argument.
You are throwing away buf_size anyway.

	Regards
		Oliver


  reply	other threads:[~2023-07-26  8:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-25  3:31 [PATCH v9 1/5] usb: phy: add usb phy notify port status API Stanley Chang
2023-07-25  3:31 ` [PATCH v9 2/5] phy: realtek: usb: Add driver for the Realtek SoC USB 2.0 PHY Stanley Chang
2023-07-26  8:13   ` Oliver Neukum [this message]
2023-07-27  1:56     ` Stanley Chang[昌育德]
2023-07-25  3:31 ` [PATCH v9 3/5] phy: realtek: usb: Add driver for the Realtek SoC USB 3.0 PHY Stanley Chang
2023-07-25  3:31 ` [PATCH v9 4/5] dt-bindings: phy: realtek: Add Realtek DHC RTD SoC USB 2.0 PHY Stanley Chang
2023-07-25  3:31 ` [PATCH v9 5/5] dt-bindings: phy: realtek: Add Realtek DHC RTD SoC USB 3.0 PHY Stanley Chang

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=a11f0ec8-7eaa-aa3e-8b86-555e5dbe6e3e@suse.com \
    --to=oneukum@suse.com \
    --cc=bagasdotme@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=f.suligoi@asem.it \
    --cc=gregkh@linuxfoundation.org \
    --cc=kishon@kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=raychi@google.com \
    --cc=robh+dt@kernel.org \
    --cc=royluo@google.com \
    --cc=stanley_chang@realtek.com \
    --cc=stern@rowland.harvard.edu \
    --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;
as well as URLs for NNTP newsgroup(s).