• L
    regulator: pwm-regulator: Don't assign structure attributes right away · 5ad2cb14
    Lee Jones 提交于
    Perhaps this is just personal preference, but ...
    
    This patch introduces a new local variable to receive and test regulator
    initialisation data.  It simplifies and cleans up the code making it
    that little bit easier to read and maintain.  The local value is assigned
    to the structure attribute when all the others are.  This is the way we
    usually do things.
    
    Prevents this kind of nonsense:
    
    	this->is->just.silly = fetch_silly_value(&pointer);
    	if (!this->is->just.silly) {
    		printk("Silly value failed: %d\n", this->is->just.silly);
    		return this->is->just.silly;
    	}
    Signed-off-by: NLee Jones <lee.jones@linaro.org>
    Signed-off-by: NMark Brown <broonie@kernel.org>
    5ad2cb14
pwm-regulator.c 6.9 KB