Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The kerneldoc for devm_clk_bulk_get_enable() incorrectly states that it returns a valid IS_ERR() condition on failure.
--
--- Patch [1]: [PATCH net-next v2 1/7] clk: Add devm_clk_bulk_get_enable() ---
commit 319855f04a85138c6a1bce0e994003875d466d17
Author: Suraj Gupta <[email protected]>
clk: Add devm_clk_bulk_get_enable()
This commit introduces devm_clk_bulk_get_enable() to allow consumers to
get, prepare, and enable a fixed set of mandatory clocks with device-managed
cleanup.
> diff --git a/include/linux/clk.h b/include/linux/clk.h
> index 998ba3f261dac..0289ac4c6e48e 100644
> --- a/include/linux/clk.h
> +++ b/include/linux/clk.h
[ ... ]
> @@ -502,6 +502,22 @@ int __must_check devm_clk_bulk_get(struct device *dev, int num_clks,
> */
> int __must_check devm_clk_bulk_get_optional(struct device *dev, int num_clks,
> struct clk_bulk_data *clks);
> +/**
> + * devm_clk_bulk_get_enable - Get and enable bulk clocks (managed)
> + * @dev: device for clock "consumer"
> + * @num_clks: the number of clk_bulk_data
> + * @clks: pointer to the clk_bulk_data table of consumer
> + *
> + * Behaves the same as devm_clk_bulk_get() but also prepares and enables the
> + * clocks in one operation with management. The clks will automatically be
> + * disabled, unprepared and freed when the device is unbound.
> + *
> + * Return: 0 if all clocks specified in clk_bulk_data table are obtained and
> + * enabled successfully. Otherwise returns valid IS_ERR() condition containing
> + * errno.
> + */
> +int __must_check devm_clk_bulk_get_enable(struct device *dev, int num_clks,
> + struct clk_bulk_data *clks);
[Severity: Low]
Is this return description accurate for an integer return type? The function
returns an int, but the documentation suggests checking it with IS_ERR(),
which is designed for pointers. Using IS_ERR() on an int return value will
trigger compiler warnings. Should this just say it returns a negative error
code on failure?
--
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.