[U-Boot] [PATCH] blk: Check if_type in blk_get_devnum_by_typename

Juha Sarlin jsub at sarlin.mobi
Sun Nov 24 23:56:59 UTC 2019


> On 24 Nov 2019, at 19:37, Heinrich Schuchardt <xypron.glpk at gmx.de> wrote:
> 
> On 11/24/19 7:09 PM, Juha Sarlin wrote:
>> While searching for a BLK device, this function checks only for a
>> matching devnum. It should check if_type, too.
> 
> Could you, please, describe in which cases you have observed a problem
> and how it can be reproduced.
> 
> According to the function description the relevant interface type check is
> device_get_uclass_id(dev->parent) != uclass_id

I was wrong, it isn't really a bug. I was misled by all the other blk-finding functions that check if_type instead of parent class. I think that checking if_type would work here, too.

Or perhaps this case is the first step towards removing the if_type field in the future? There seems to be a 1-1 mapping from almost every if_type to uclass_id.



More information about the U-Boot mailing list