mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-12-22 18:01:29 +01:00
Instead of duplicating the ufs_scsi_bind() call in every driver, call it from UFS uclass .post_bind callback for every driver in one place. While doing so, inline ufs_scsi_bind() directly into ufs_post_bind() as trivial device_bind_driver() call. Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Link: https://patch.msgid.link/20251028142335.18125-5-marek.vasut+renesas@mailbox.org [narmstrong: also updated the rockchip and mediatek drivers] Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
37 lines
669 B
C
37 lines
669 B
C
// SPDX-License-Identifier: GPL-2.0+
|
|
/*
|
|
* Copyright (C) 2023 tinylab.org
|
|
* Author: Bin Meng <bmeng@tinylab.org>
|
|
*/
|
|
|
|
#include <dm.h>
|
|
#include <errno.h>
|
|
#include <pci.h>
|
|
#include <ufs.h>
|
|
#include <dm/device_compat.h>
|
|
#include "ufs.h"
|
|
|
|
static int ufs_pci_probe(struct udevice *dev)
|
|
{
|
|
int err;
|
|
|
|
err = ufshcd_probe(dev, NULL);
|
|
if (err)
|
|
dev_err(dev, "%s failed (ret=%d)\n", __func__, err);
|
|
|
|
return err;
|
|
}
|
|
|
|
U_BOOT_DRIVER(ufs_pci) = {
|
|
.name = "ufs_pci",
|
|
.id = UCLASS_UFS,
|
|
.probe = ufs_pci_probe,
|
|
};
|
|
|
|
static struct pci_device_id ufs_supported[] = {
|
|
{ PCI_DEVICE(PCI_VENDOR_ID_REDHAT, PCI_DEVICE_ID_REDHAT_UFS) },
|
|
{},
|
|
};
|
|
|
|
U_BOOT_PCI_DEVICE(ufs_pci, ufs_supported);
|