summaryrefslogtreecommitdiff
path: root/drivers/mfd/88pm805.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2012-07-11 09:27:54 +0800
committerSamuel Ortiz <sameo@linux.intel.com>2012-07-16 15:26:37 +0200
commit46b65a8fe63ece3b01d7d0c5e3bb5b9f478c44d5 (patch)
tree5e79493ab517ea4ac97fe0ec9351d8e5dcffd250 /drivers/mfd/88pm805.c
parente102befe7a254f7b827fecc19eba0c5af03d1bf3 (diff)
mfd: Fix checking return value of 88pm8xx regmap_read()
Check the return value of regmap_read() rather than the read value. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd/88pm805.c')
-rw-r--r--drivers/mfd/88pm805.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/mfd/88pm805.c b/drivers/mfd/88pm805.c
index d59ca6bae096..6146583589f6 100644
--- a/drivers/mfd/88pm805.c
+++ b/drivers/mfd/88pm805.c
@@ -192,6 +192,7 @@ static struct regmap_irq_chip pm805_irq_chip = {
static int __devinit device_805_init(struct pm80x_chip *chip)
{
int ret = 0;
+ unsigned int val;
struct regmap *map = chip->regmap;
if (!map) {
@@ -199,12 +200,12 @@ static int __devinit device_805_init(struct pm80x_chip *chip)
return -EINVAL;
}
- regmap_read(map, PM805_CHIP_ID, &ret);
+ ret = regmap_read(map, PM805_CHIP_ID, &val);
if (ret < 0) {
dev_err(chip->dev, "Failed to read CHIP ID: %d\n", ret);
goto out_irq_init;
}
- chip->version = ret;
+ chip->version = val;
chip->regmap_irq_chip = &pm805_irq_chip;