Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

greybus: gb-beagleplay: Add error handling for gb_greybus_init

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>

authored by

Wentao Liang and committed by
Greg Kroah-Hartman
be382372 a64dcfb4

+3 -1
+3 -1
drivers/greybus/gb-beagleplay.c
··· 912 912 cc1352_bootloader_reset(bg); 913 913 WRITE_ONCE(bg->flashing_mode, false); 914 914 msleep(200); 915 - gb_greybus_init(bg); 915 + if (gb_greybus_init(bg) < 0) 916 + return dev_err_probe(&bg->sd->dev, FW_UPLOAD_ERR_RW_ERROR, 917 + "Failed to initialize greybus"); 916 918 gb_beagleplay_start_svc(bg); 917 919 return FW_UPLOAD_ERR_FW_INVALID; 918 920 }