[PATCH 1/1] blk: simplify blk_get_devnum_by_typename()

Tom Rini trini at konsulko.com
Mon Oct 25 17:46:54 CEST 2021


On Mon, Oct 25, 2021 at 09:18:49AM -0600, Simon Glass wrote:
> Hi Heinrich,
> 
> On Mon, 25 Oct 2021 at 02:00, Heinrich Schuchardt
> <heinrich.schuchardt at canonical.com> wrote:
> >
> > On 10/25/21 09:54, Heinrich Schuchardt wrote:
> > > On 10/24/21 21:54, Simon Glass wrote:
> > >> Hi Heinrich,
> > >>
> > >> On Sat, 23 Oct 2021 at 08:06, Heinrich Schuchardt
> > >> <heinrich.schuchardt at canonical.com> wrote:
> > >>>
> > >>> The block descriptor contains the if_type. There is no need to first
> > >>> look
> > >>> up the uclass for the if_type and then to check the parent device's
> > >>> uclass
> > >>> to know if the device has the correct if_type.
> > >>>
> > >>> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>
> > >>> ---
> > >>>   drivers/block/blk-uclass.c | 35 +----------------------------------
> > >>>   1 file changed, 1 insertion(+), 34 deletions(-)
> > >>
> > >> This seems to be heading in the wrong direction though.
> > >>
> > >> The IF_TYPE should really go away and be replaced with the UCLASS ID,
> > >> I think.
> > >>
> > >> At present we have lots of calls to blk_create_device_f() which
> > >> specify the type. I think we should drop the IF_TYPE_.. arg to that
> > >> function and have it figured out from the uclass, in the interim.
> > >>
> > >> But why do we need IF_TYPE now?
> > >
> > > I admit that this patch is just an intermediate step.
> > >
> > > We can replace IF_TYPE by ULASS ID once SPL block devices are always
> > > using the driver model. Have we reached this point yet? I have not seen
> > > drivers/block/blk_legacy.c being deleted.
> >
> > qemu_malta64, qemu_malta64el, qemu_malta, qemu_maltael are examples of
> > defconfigs requiring drivers/block/blk_legacy.c
> 
> Yes, we seem to have BLK on only for MMC and USB, but malta64 (for
> example) uses IDE.
> 
> The problem seems to be HAVE_BLOCK_DEVICE which should not be used.
> 
> +Tom Rini
> 
> Should we remove HAVE_BLOCK_DEVICE at this point, or make it depend on BROKEN?

Daniel, do you know what's up with malta and what needs to be migrated
to DM, possibly, at this point still, wrt storage devices?  Thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20211025/8e5b8646/attachment.sig>


More information about the U-Boot mailing list