Skip to content

Commit

Permalink
pinctrl: baytrail: add warning for BYT_VAL_REG retrieval failure
Browse files Browse the repository at this point in the history
Add warning for BYT_VAL_REG retrieval failure and continue such case
to avoid unintended reads/writes in pm_ops.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Link: https://lore.kernel.org/r/20230616203356.27343-3-raag.jadav@intel.com
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
  • Loading branch information
Raag Jadav authored and Andy Shevchenko committed Jun 19, 2023
1 parent 5a9fa4c commit 9d49882
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/pinctrl/intel/pinctrl-baytrail.c
Original file line number Diff line number Diff line change
Expand Up @@ -1758,6 +1758,10 @@ static int byt_gpio_suspend(struct device *dev)
vg->context.pads[i].conf0 = value;

reg = byt_gpio_reg(vg, pin, BYT_VAL_REG);
if (!reg) {
dev_warn(vg->dev, "Pin %i: can't retrieve VAL\n", i);
continue;
}
value = readl(reg) & BYT_VAL_RESTORE_MASK;
vg->context.pads[i].val = value;
}
Expand Down Expand Up @@ -1794,6 +1798,10 @@ static int byt_gpio_resume(struct device *dev)
}

reg = byt_gpio_reg(vg, pin, BYT_VAL_REG);
if (!reg) {
dev_warn(vg->dev, "Pin %i: can't retrieve VAL\n", i);
continue;
}
value = readl(reg);
if ((value & BYT_VAL_RESTORE_MASK) !=
vg->context.pads[i].val) {
Expand Down

0 comments on commit 9d49882

Please sign in to comment.