[PATCH] console: Prefer currently selected serial console as stdio device

Marek Vasut marek.vasut at mailbox.org
Mon Mar 16 17:29:23 CET 2026


On 3/16/26 3:44 AM, Simon Glass wrote:

Hello Simon,

>> +                               inputdev = dev;
>> +                       }
>> +                       if ((dev->flags & DEV_FLAGS_OUTPUT) && (outputdev == NULL)) {
>> +                               outputdev = dev;
>> +                       }
>> +                       if (inputdev && outputdev)
>> +                               break;
>>                  }
>> -               if(inputdev && outputdev)
>> +
>> +               if (inputdev && outputdev)
>>                          break;
>>          }
> 
> I think you could have a function like is_suitable(), call it on
> gd->cur_serial_dev and then go into the loop failing that. It might
> give smaller code and avoid the extra loop.

I'll be sending a V2 which is somewhat different. The rest is fixed 
there too.


More information about the U-Boot mailing list