Skip to content

Commit 154e29d

Browse files
Quang Nguyengregkh
authored andcommitted
spi: rpc-if: Use correct device for hardware reinitialization on resume
[ Upstream commit 7b25dba ] rpcif_spi_resume() currently passes the SPI controller device to rpcif_hw_init(), but the function should be called with the RPC interface device. Retrieve the rpcif private data from the SPI controller and pass rpc->dev instead. Also propagate the return value of rpcif_hw_init() so that a failure during resume is properly reported rather than silently ignored. Fixes: ad47287 ("spi: rpc-if: Add resume support for RZ/G3E") Signed-off-by: Quang Nguyen <quang.nguyen.wx@renesas.com> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://patch.msgid.link/20260618081932.172168-1-biju.das.jz@bp.renesas.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent e58aef5 commit 154e29d

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

drivers/spi/spi-rpc-if.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,12 @@ static int __maybe_unused rpcif_spi_suspend(struct device *dev)
192192
static int __maybe_unused rpcif_spi_resume(struct device *dev)
193193
{
194194
struct spi_controller *ctlr = dev_get_drvdata(dev);
195+
struct rpcif *rpc = spi_controller_get_devdata(ctlr);
196+
int ret;
195197

196-
rpcif_hw_init(dev, false);
198+
ret = rpcif_hw_init(rpc->dev, false);
199+
if (ret)
200+
return ret;
197201

198202
return spi_controller_resume(ctlr);
199203
}

0 commit comments

Comments
 (0)