[PATCH 0/2] mfd: gateworks-gsc: Propagate I2C write and store errors
From: shao.mingyin
Date: Sun Nov 08 2026 - 02:20:42 EST
The GSC regmap bus wraps register accesses in an I2C retry loop to work
around a chip errata, but gsc_write() throws away the result of the last
transfer. Every write through regmap therefore looks successful, and
gsc_powerdown()'s existing error checks can never fire. The powerdown
sysfs attribute has the same problem on a smaller scale: it ignores both
the argument parse error and the value returned by gsc_powerdown().
1/2 returns the last transfer result from gsc_write(), so regmap_write()
and gsc_powerdown()'s checks start to work. 2/2 returns the kstrtol()
and gsc_powerdown() errors from gsc_store() instead of reporting a
successful store; its gsc_powerdown() error path is only reachable with
1/2 applied.
The patches apply independently and can be applied in either order,
although 2/2's gsc_powerdown() error path only becomes reachable once
1/2 is in place. The read counterpart in gsc_read() is handled by a
separate patch and is not a dependency here.
Shao Mingyin (2):
mfd: gateworks-gsc: Propagate I2C write errors
mfd: gateworks-gsc: Propagate errors from gsc_store()
drivers/mfd/gateworks-gsc.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
---
base-commit: 7649ba73f9e7e1e04d0b46213e39c79ae09dd55c