mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 23:32:14 +00:00
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>
This commit is contained in:
parent
e102befe7a
commit
46b65a8fe6
2 changed files with 12 additions and 9 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue