• Axel Lin's avatar
    regulator: max8997: Properly handle gpio_request failure · 8fa25eda
    Axel Lin authored
    Convert to devm_gpio_request to save a few error handling code.
    
    This patch properly handle the gpio_request failure with -EBUSY, we should
    return error rather than ommit the gpio_request failure with -EBUSY.
    
    I think one of the reason we got -EBUSY is because current code does not free
    gpios in max8997_pmic_remove(). So it got -EBUSY when reload the module.
    
    Yest another reason is in current code if gpio_request() returns -EBUSY,
    the rest of the code still calls gpio_direction_output to config buck125_gpios
    and set gpio value in max8997_set_gpio().  This looks wrong to me.
    Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
    Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
    8fa25eda
max8997.c 29.4 KB