Skip to content

Commit 2f0d67b

Browse files
commodobebarino
authored andcommitted
clk: tegra: clk-tegra124-dfll-fcpu: don't use devm functions for regulator
The purpose of the device-managed functions is to bind the life-time of an object to that of a parent device object. This is not the case for the 'vdd-cpu' regulator in this driver. A reference is obtained via devm_regulator_get() and immediately released with devm_regulator_put(). In this case, the usage of devm_ functions is slightly excessive, as the un-managed versions of these functions is a little cleaner (and slightly more economical in terms of allocation). This change converts the devm_regulator_{get,put}() to regulator_{get,put}() in the get_alignment_from_regulator() function of this driver. Signed-off-by: Alexandru Ardelean <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Thierry Reding <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
1 parent 3f4e557 commit 2f0d67b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/clk/tegra/clk-tegra124-dfll-fcpu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -537,15 +537,15 @@ static void get_alignment_from_dt(struct device *dev,
537537
static int get_alignment_from_regulator(struct device *dev,
538538
struct rail_alignment *align)
539539
{
540-
struct regulator *reg = devm_regulator_get(dev, "vdd-cpu");
540+
struct regulator *reg = regulator_get(dev, "vdd-cpu");
541541

542542
if (IS_ERR(reg))
543543
return PTR_ERR(reg);
544544

545545
align->offset_uv = regulator_list_voltage(reg, 0);
546546
align->step_uv = regulator_get_linear_step(reg);
547547

548-
devm_regulator_put(reg);
548+
regulator_put(reg);
549549

550550
return 0;
551551
}

0 commit comments

Comments
 (0)