[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <21698603-2780-4f23-8a77-7be98fdd3ab3@kernel.org>
Date: Wed, 9 Apr 2025 12:10:16 +0200
From: Krzysztof Kozlowski <krzk@...nel.org>
To: Ze Huang <huangze@...t.edu.cn>, Vinod Koul <vkoul@...nel.org>,
Kishon Vijay Abraham I <kishon@...nel.org>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley
<conor+dt@...nel.org>, Yixun Lan <dlan@...too.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Philipp Zabel <p.zabel@...gutronix.de>,
Thinh Nguyen <Thinh.Nguyen@...opsys.com>,
Paul Walmsley <paul.walmsley@...ive.com>, Palmer Dabbelt
<palmer@...belt.com>, Albert Ou <aou@...s.berkeley.edu>,
Alexandre Ghiti <alex@...ti.fr>
Cc: linux-phy@...ts.infradead.org, devicetree@...r.kernel.org,
linux-riscv@...ts.infradead.org, spacemit@...ts.linux.dev,
linux-kernel@...r.kernel.org, linux-usb@...r.kernel.org
Subject: Re: [PATCH 5/7] phy: spacemit: add USB3 support for K1 PCIe/USB3
combo PHY
On 09/04/2025 11:43, Ze Huang wrote:
>>> + priv->phy = devm_phy_create(dev, NULL, &spacemit_combphy_ops);
>>> + if (IS_ERR(priv->phy))
>>> + return dev_err_probe(dev, PTR_ERR(priv->phy),
>>> + "failed to create combphy\n");
>>> +
>>> + dev_set_drvdata(dev, priv);
>>> + phy_set_drvdata(priv->phy, priv);
>> Both make no sense. Look what this function does.
>
> It does seem redundant at first glance, but pdev->dev is the parent of
> phy->dev.
> pdev->dev->driver_data will be used in spacemit_combphy_xlate()
> phy->dev->driver_data will be used in phy_ops functions
>
> I've checked some other drivers that did the same:
> - phy-zynqmp.c at lines 990 and 1026
> - phy-rockchip-samsung-hdptx.c at lines 1989 and 2000
Indeed, right. It's fine.
Best regards,
Krzysztof
Powered by blists - more mailing lists