From: Kim, Milo Date: Wed, 5 Sep 2012 04:39:23 +0000 (+0000) Subject: regulator: lp872x: initialize the DVS mode X-Git-Tag: Ubuntu-snapdragon-4.4.0-1029.32~12449^2^5~9 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=86b3fef0c7b5aba1c64ac1e02e68267aeaff44a6;p=mirror_ubuntu-zesty-kernel.git regulator: lp872x: initialize the DVS mode The platform specific configuration(general_config) is optional. However, the DVS settings should be configured explicitly while loading the driver. This patch enables configuring the default DVS mode even though the platform data is not defined. Signed-off-by: Milo(Woogyom) Kim Signed-off-by: Mark Brown --- diff --git a/drivers/regulator/lp872x.c b/drivers/regulator/lp872x.c index d86b6a3e750d..b16a941c1a62 100644 --- a/drivers/regulator/lp872x.c +++ b/drivers/regulator/lp872x.c @@ -796,13 +796,14 @@ static int lp872x_config(struct lp872x *lp) struct lp872x_platform_data *pdata = lp->pdata; int ret; - if (!pdata->update_config) - return 0; + if (!pdata || !pdata->update_config) + goto init_dvs; ret = lp872x_write_byte(lp, LP872X_GENERAL_CFG, pdata->general_config); if (ret) return ret; +init_dvs: return lp872x_init_dvs(lp); }