mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: "Kryštof Černý" <cleverline1mc@gmail.com>
Cc: Rob Herring <robh@kernel.org>, Conor Dooley <conor+dt@kernel.org>,
	Stefan Wahren <stefan.wahren@chargebyte.com>,
	Ben Gardner <bgardner@wabtec.com>,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v2 1/3] w1: ds2482: Add regulator support
Date: Sun, 24 Nov 2024 11:50:17 +0100	[thread overview]
Message-ID: <40684c50-6f6d-493c-97db-ff3bd8883259@kernel.org> (raw)
In-Reply-To: <c8f40177-1d81-4c8e-8319-e78623cded42@gmail.com>

On 24/11/2024 11:22, Kryštof Černý wrote:
>>> +	/* Get the vcc regulator */
>>> +	data->vcc_reg = devm_regulator_get(&client->dev, "vcc");
>>> +	if (IS_ERR(data->vcc_reg))
>>> +		return PTR_ERR(data->vcc_reg);
>>> +
>>> +	/* Enable the vcc regulator */
>>> +	ret = regulator_enable(data->vcc_reg);
>>
>> You wanted devm_regulator_get_enable().
>>
>> ... but your comment also suggests devm_regulator_get_enable_optional().
>>
> 
> This is a good point, my implementation is based on observation of a few 
> other drivers and it's not needed in this case. This will reduce the 
> amount of changes.
> 
> I think my wording was not correct. By optionally I meant that most 
> hardware designs do not use a separate power supply regulator, so they 
> do not need to specify one, but the device needs power to function.
> My current view is that it should not be optional after all, so I would 
> go with devm_regulator_get_enable(). Could you please tell me your view 
> on this?
> 


Sure, fine.

Best regards,
Krzysztof

  reply	other threads:[~2024-11-24 10:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-22  8:53 [PATCH v2 0/3] Add support for attaching a regulator to w1: ds2482 Kryštof Černý via B4 Relay
2024-11-22  8:53 ` [PATCH v2 1/3] w1: ds2482: Add regulator support Kryštof Černý via B4 Relay
2024-11-23 16:32   ` Krzysztof Kozlowski
2024-11-24 10:22     ` Kryštof Černý
2024-11-24 10:50       ` Krzysztof Kozlowski [this message]
2024-11-22  8:53 ` [PATCH v2 2/3] w1: ds2482: Fix datasheet URL Kryštof Černý via B4 Relay
2024-11-22  8:53 ` [PATCH v2 3/3] dt-bindings: w1: ds2482: Add vcc-supply property Kryštof Černý via B4 Relay

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=40684c50-6f6d-493c-97db-ff3bd8883259@kernel.org \
    --to=krzk@kernel.org \
    --cc=bgardner@wabtec.com \
    --cc=cleverline1mc@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=stefan.wahren@chargebyte.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

all inboxes | Powered by JetHome®