From: "Kryštof Černý" <cleverline1mc@gmail.com>
To: Krzysztof Kozlowski <krzk@kernel.org>,
Rob Herring <robh@kernel.org>, Conor Dooley <conor+dt@kernel.org>,
Stefan Wahren <stefan.wahren@chargebyte.com>,
Stefan Wahren <wahrenst@gmx.net>
Cc: Ben Gardner <bgardner@wabtec.com>,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v4 2/3] w1: ds2482: Add regulator support
Date: Wed, 27 Nov 2024 15:21:22 +0100 [thread overview]
Message-ID: <d83667b9-23a2-4f1c-9a9a-12ce1e3a3983@gmail.com> (raw)
In-Reply-To: <20241125-ds2482-add-reg-v4-2-475a7a08df96@gmail.com>
I2C_FUNC_SMBUS_WRITE_BYTE_DATA |
> @@ -457,6 +459,10 @@ static int ds2482_probe(struct i2c_client *client)
> goto exit;
> }
>
> + ret = devm_regulator_get_enable(&client->dev, "vcc");
> + if (ret)
> + return dev_err_probe(&client->dev, ret, "Failed to enable regulator\n");
This will cause a memory leak of `data`, I would refactor the driver a
bit in the next patch revision. Should I create a separate commit that
switches from kzalloc() to devm_kzalloc() or keep it in patch 2/3? The
separate commits way seems correct to me, so it is clearly
distinguished. Sorry that I missed it.
> +
> data->client = client;
> i2c_set_clientdata(client, data);
Best regards,
Kryštof Černý
next prev parent reply other threads:[~2024-11-27 14:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-25 22:47 [PATCH v4 0/3] Add support for attaching a regulator to w1: ds2482 Kryštof Černý via B4 Relay
2024-11-25 22:47 ` [PATCH v4 1/3] dt-bindings: w1: ds2482: Add vcc-supply property Kryštof Černý via B4 Relay
2024-11-25 22:47 ` [PATCH v4 2/3] w1: ds2482: Add regulator support Kryštof Černý via B4 Relay
2024-11-27 14:21 ` Kryštof Černý [this message]
2024-11-27 14:47 ` Stefan Wahren
2024-11-27 15:07 ` Krzysztof Kozlowski
2024-11-25 22:47 ` [PATCH v4 3/3] w1: ds2482: Fix datasheet URL 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=d83667b9-23a2-4f1c-9a9a-12ce1e3a3983@gmail.com \
--to=cleverline1mc@gmail.com \
--cc=bgardner@wabtec.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzk@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh@kernel.org \
--cc=stefan.wahren@chargebyte.com \
--cc=wahrenst@gmx.net \
/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®