lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <8a9b245c-50fe-4750-bf22-e6d76242c5fa@oss.qualcomm.com>
Date: Sat, 1 Nov 2025 10:33:11 +0200
From: Dmitry Baryshkov <dmitry.baryshkov@....qualcomm.com>
To: Krishna Kurapati PSSNV <krishna.kurapati@....qualcomm.com>,
        Heikki Krogerus <heikki.krogerus@...ux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Rob Herring <robh@...nel.org>,
        Krzysztof Kozlowski <krzk+dt@...nel.org>,
        Conor Dooley <conor+dt@...nel.org>,
        Biju Das <biju.das.jz@...renesas.com>, linux-usb@...r.kernel.org,
        devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v5 2/2] usb: typec: hd3ss3220: Enable VBUS based on ID pin
 state

On 31/10/2025 08:45, Krishna Kurapati PSSNV wrote:
> 
> 
> On 10/27/2025 6:49 PM, Dmitry Baryshkov wrote:
>> On Mon, Oct 27, 2025 at 11:47:13AM +0200, Heikki Krogerus wrote:
>>> Hi Krishna,
>>>
>>>> +static int hd3ss3220_get_vbus_supply(struct hd3ss3220 *hd3ss3220)
>>>> +{
>>>> +    struct device_node *hd3ss3220_node = hd3ss3220->dev->of_node;
>>>> +    struct device_node *np;
>>>> +
>>>> +    np = of_graph_get_remote_node(hd3ss3220_node, 0, 0);
>>>> +    if (!np) {
>>>> +        dev_err(hd3ss3220->dev, "failed to get device node");
>>>> +        return -ENODEV;
>>>> +    }
>>>
>>> So I guess that's the connector node. Why can't you just place the
>>> regulator reference to the hd3ss3220 controller node instead of the
>>> connector like the port controllers do?
>>>
>>> That would allow us to do a simple devm_regulator_get_optional() call
>>> that's not tied to DT only.
>>
>> But we have devm_of_regulator_get_optional(), it was mentioned in the
>> previous email if I'm not mistaken. If we need, we should add
>> devm_fwnode_regulator_get(_optional).
>>
>> vbus supply is described as a part of the usb-c-connector schema, so
>> it is not that logical to describe it as a part of the Type-C
>> controller.
>>
>>
> 
> I tried the following as suggested:
> 
> hd3ss3220->vbus =  devm_of_regulator_get_optional(hd3ss3220->dev, 
> to_of_node(connector),
> if (IS_ERR(hd3ss3220->vbus))
>    hd3ss3220->vbus = NULL;
> 
> If there is a vbus supply I see its returning proper handle pointer.
> Else it returned ENODEV. (which is fine for our case as there is no vbus 
> in DT).
> 
> Can I mark the function as a void one. Instead of returning any int 
> value, would it be fine if to just mark vbus as NULL and proceed ?

You can only ignore -ENODEV. Any other error should be propagated back 
and cause an error in probing the hd3ss3220 driver.

> 
> Regards,
> Krishna,


-- 
With best wishes
Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ