lkml.org 
[lkml]   [2019]   [Jul]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 1/2] Regulator: Core: Add clock-enable to fixed-regulator
On Tue, Jul 30, 2019 at 07:30:04PM +0200, Philippe Schenker wrote:
> From: Philippe Schenker <philippe.schenker@toradex.com>
>
> This adds the possibility to enable a fixed-regulator with a clock.

Why? What does the hardware which makes this make sense look like?
Your cover letter didn't explain at all clearly, it just said that
there's a circuit that is connected to a clock which somehow switches
something but it's not clear. It's certainly not clear that this should
be in the core, the circuit doesn't sound like a good idea at all.

> Signed-off-by: <philippe.schenker@toradex.com>
> Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>

This needs a cleanup.

>
> /* cares about last_off_jiffy only if off_on_delay is required by
> @@ -2796,6 +2805,9 @@ static int _regulator_is_enabled(struct regulator_dev *rdev)
> if (rdev->ena_pin)
> return rdev->ena_gpio_state;
>
> + if (rdev->ena_clk)
> + return (rdev->ena_clk_state > 0) ? 1 : 0;
> +

Please write normal conditional statements, this isn't helping
legibility. Though in this case the ternery operator is totally
redundant anyway...
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2019-07-30 20:11    [W:0.050 / U:0.940 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site