diff options
| author | Wentao Liang <vulab@iscas.ac.cn> | 2025-01-20 22:05:47 +0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-04-10 14:44:29 +0200 |
| commit | 60df29b7f83d53086153633c065ee329a38097b9 (patch) | |
| tree | 52844eb0a72dcc59ed775f4210272c84ea5d93a0 | |
| parent | ef27051ba8c4f4f298d210c7d23fec1c295abbfd (diff) | |
| download | linux-60df29b7f83d53086153633c065ee329a38097b9.tar.gz linux-60df29b7f83d53086153633c065ee329a38097b9.tar.bz2 linux-60df29b7f83d53086153633c065ee329a38097b9.zip | |
greybus: gb-beagleplay: Add error handling for gb_greybus_init
[ Upstream commit be382372d55d65b5c7e5a523793ca5e403f8c595 ]
Add error handling for the gb_greybus_init(bg) function call
during the firmware reflash process to maintain consistency
in error handling throughout the codebase. If initialization
fails, log an error and return FW_UPLOAD_ERR_RW_ERROR.
Fixes: 0cf7befa3ea2 ("greybus: gb-beagleplay: Add firmware upload API")
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
Reviewed-by: Ayush Singh <ayush@beagleboard.org>
Link: https://lore.kernel.org/r/20250120140547.1460-1-vulab@iscas.ac.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
| -rw-r--r-- | drivers/greybus/gb-beagleplay.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/greybus/gb-beagleplay.c b/drivers/greybus/gb-beagleplay.c index 473ac3f2d382..da31f1131afc 100644 --- a/drivers/greybus/gb-beagleplay.c +++ b/drivers/greybus/gb-beagleplay.c @@ -912,7 +912,9 @@ static enum fw_upload_err cc1352_prepare(struct fw_upload *fw_upload, cc1352_bootloader_reset(bg); WRITE_ONCE(bg->flashing_mode, false); msleep(200); - gb_greybus_init(bg); + if (gb_greybus_init(bg) < 0) + return dev_err_probe(&bg->sd->dev, FW_UPLOAD_ERR_RW_ERROR, + "Failed to initialize greybus"); gb_beagleplay_start_svc(bg); return FW_UPLOAD_ERR_FW_INVALID; } |
