mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-04 10:43:35 +00:00
sandbox: cros_ec: exynos: Drop use of cros_ec_get_error()
This function is really just a call to uclass_get_device() and there is no reason why the caller cannot do it. Update sandbox and snow accordingly. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Minkyu Kang <mk7.kang@samsung.com>
This commit is contained in:
parent
566bf3a869
commit
a2a63a35b2
3 changed files with 12 additions and 19 deletions
|
@ -306,14 +306,16 @@ int checkboard(void)
|
||||||
#ifdef CONFIG_BOARD_LATE_INIT
|
#ifdef CONFIG_BOARD_LATE_INIT
|
||||||
int board_late_init(void)
|
int board_late_init(void)
|
||||||
{
|
{
|
||||||
stdio_print_current_devices();
|
struct udevice *dev;
|
||||||
|
int ret;
|
||||||
|
|
||||||
if (cros_ec_get_error()) {
|
stdio_print_current_devices();
|
||||||
|
ret = uclass_first_device_err(UCLASS_CROS_EC, &dev);
|
||||||
|
if (ret && ret != -ENODEV) {
|
||||||
/* Force console on */
|
/* Force console on */
|
||||||
gd->flags &= ~GD_FLG_SILENT;
|
gd->flags &= ~GD_FLG_SILENT;
|
||||||
|
|
||||||
printf("cros-ec communications failure %d\n",
|
printf("cros-ec communications failure %d\n", ret);
|
||||||
cros_ec_get_error());
|
|
||||||
puts("\nPlease reset with Power+Refresh\n\n");
|
puts("\nPlease reset with Power+Refresh\n\n");
|
||||||
panic("Cannot init cros-ec device");
|
panic("Cannot init cros-ec device");
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -59,12 +59,15 @@ int board_init(void)
|
||||||
#ifdef CONFIG_BOARD_LATE_INIT
|
#ifdef CONFIG_BOARD_LATE_INIT
|
||||||
int board_late_init(void)
|
int board_late_init(void)
|
||||||
{
|
{
|
||||||
if (cros_ec_get_error()) {
|
struct udevice *dev;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
ret = uclass_first_device_err(UCLASS_CROS_EC, &dev);
|
||||||
|
if (ret && ret != -ENODEV) {
|
||||||
/* Force console on */
|
/* Force console on */
|
||||||
gd->flags &= ~GD_FLG_SILENT;
|
gd->flags &= ~GD_FLG_SILENT;
|
||||||
|
|
||||||
printf("cros-ec communications failure %d\n",
|
printf("cros-ec communications failure %d\n", ret);
|
||||||
cros_ec_get_error());
|
|
||||||
puts("\nPlease reset with Power+Refresh\n\n");
|
puts("\nPlease reset with Power+Refresh\n\n");
|
||||||
panic("Cannot init cros-ec device");
|
panic("Cannot init cros-ec device");
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -25,15 +25,3 @@ struct udevice *board_get_cros_ec_dev(void)
|
||||||
}
|
}
|
||||||
return dev;
|
return dev;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cros_ec_get_error(void)
|
|
||||||
{
|
|
||||||
struct udevice *dev;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
ret = uclass_get_device(UCLASS_CROS_EC, 0, &dev);
|
|
||||||
if (ret && ret != -ENODEV)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue