From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
broonie@kernel.org, matthias.bgg@gmail.com,
gregkh@linuxfoundation.org, neil@brown.name, blogic@openwrt.org
Cc: linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH 2/4] spi: mt7621: Use the devm_clk_get_enabled() helper to simplify error handling
Date: Tue, 30 Aug 2022 11:46:05 +0200 [thread overview]
Message-ID: <cb85942d-1f41-ee8c-c777-0c47336fb36c@collabora.com> (raw)
In-Reply-To: <05a7fd22719008c8a905d6328aa9548ce40f2a7a.1661599671.git.christophe.jaillet@wanadoo.fr>
Il 27/08/22 13:42, Christophe JAILLET ha scritto:
> The devm_clk_get_enabled() helper:
> - calls devm_clk_get()
> - calls clk_prepare_enable() and registers what is needed in order to
> call clk_disable_unprepare() when needed, as a managed resource.
>
> This helper is well suited for cases where the clock would be kept
> prepared or enabled for the whole lifetime of the driver.
>
> This simplifies the error handling a lot.
>
> The order between spi_unregister_controller() (in the remove function) and
> the clk_disable_unprepare() (now handle by a managed resource) is kept
> the same.
> (see commit 46b5c4fb87ce ("spi: mt7621: Don't leak SPI master in probe
> error path") to see why it matters)
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
next prev parent reply other threads:[~2022-08-30 9:46 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-27 11:41 [PATCH 0/4] spi: mt7621: Fix an erroneous message + clean-ups Christophe JAILLET
2022-08-27 11:42 ` [PATCH 1/4] spi: mt7621: Fix an error message in mt7621_spi_probe() Christophe JAILLET
2022-08-29 11:07 ` Matthias Brugger
2022-08-30 9:46 ` AngeloGioacchino Del Regno
2022-08-27 11:42 ` [PATCH 2/4] spi: mt7621: Use the devm_clk_get_enabled() helper to simplify error handling Christophe JAILLET
2022-08-29 11:14 ` Matthias Brugger
2022-08-30 9:46 ` AngeloGioacchino Del Regno [this message]
2022-08-27 11:42 ` [PATCH 3/4] spi: mt7621: Use devm_spi_register_controller() Christophe JAILLET
2022-08-29 11:16 ` Matthias Brugger
2022-08-27 11:42 ` [PATCH 4/4] spi: mt7621: Remove 'clk' from 'struct mt7621_spi' Christophe JAILLET
2022-08-29 11:18 ` Matthias Brugger
2022-08-29 17:23 ` Christophe JAILLET
2022-08-29 20:54 ` [PATCH 0/4] spi: mt7621: Fix an erroneous message + clean-ups Mark Brown
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=cb85942d-1f41-ee8c-c777-0c47336fb36c@collabora.com \
--to=angelogioacchino.delregno@collabora.com \
--cc=blogic@openwrt.org \
--cc=broonie@kernel.org \
--cc=christophe.jaillet@wanadoo.fr \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-spi@vger.kernel.org \
--cc=matthias.bgg@gmail.com \
--cc=neil@brown.name \
/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®