From 5c4d4ee6c9a897923b76cdac227180bbb3115ac1 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Thu, 15 Mar 2012 08:47:48 +0800 Subject: [PATCH] --- yaml --- r: 302107 b: refs/heads/master c: c8237f01db63b458c34222d07f66c5417cfd866b h: refs/heads/master i: 302105: ee920be208867b53ee0d5a203e28807984b64e78 302103: 313a445e6e35b21a44c1fbc609c6b66f4488e6b5 v: v3 --- [refs] | 2 +- trunk/drivers/regulator/max8952.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index 6be439d433be..3e114d9dbd92 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 1f793ff258c7a48e8cc3729ac13bfd1b3850b9c9 +refs/heads/master: c8237f01db63b458c34222d07f66c5417cfd866b diff --git a/trunk/drivers/regulator/max8952.c b/trunk/drivers/regulator/max8952.c index 75d89400c123..e9c0a0ea1528 100644 --- a/trunk/drivers/regulator/max8952.c +++ b/trunk/drivers/regulator/max8952.c @@ -152,8 +152,8 @@ static int max8952_set_voltage(struct regulator_dev *rdev, } if (vid >= 0 && vid < MAX8952_NUM_DVS_MODE) { - max8952->vid0 = (vid % 2 == 1); - max8952->vid1 = (((vid >> 1) % 2) == 1); + max8952->vid0 = vid & 0x1; + max8952->vid1 = (vid >> 1) & 0x1; *selector = vid; gpio_set_value(max8952->pdata->gpio_vid0, max8952->vid0); gpio_set_value(max8952->pdata->gpio_vid1, max8952->vid1); @@ -217,8 +217,8 @@ static int __devinit max8952_pmic_probe(struct i2c_client *client, } max8952->en = !!(pdata->reg_data.constraints.boot_on); - max8952->vid0 = (pdata->default_mode % 2) == 1; - max8952->vid1 = ((pdata->default_mode >> 1) % 2) == 1; + max8952->vid0 = pdata->default_mode & 0x1; + max8952->vid1 = (pdata->default_mode >> 1) & 0x1; if (gpio_is_valid(pdata->gpio_en)) { if (!gpio_request(pdata->gpio_en, "MAX8952 EN")) @@ -241,13 +241,13 @@ static int __devinit max8952_pmic_probe(struct i2c_client *client, gpio_is_valid(pdata->gpio_vid1)) { if (!gpio_request(pdata->gpio_vid0, "MAX8952 VID0")) gpio_direction_output(pdata->gpio_vid0, - (pdata->default_mode) % 2); + (pdata->default_mode) & 0x1); else err = 1; if (!gpio_request(pdata->gpio_vid1, "MAX8952 VID1")) gpio_direction_output(pdata->gpio_vid1, - (pdata->default_mode >> 1) % 2); + (pdata->default_mode >> 1) & 0x1); else { if (!err) gpio_free(pdata->gpio_vid0);