[U-Boot] [PATCH RESEND] ahci: dm: Fix memory allocation for uclass private data
Jean-Jacques Hiblot
jjhiblot at ti.com
Wed Jul 19 10:57:13 UTC 2017
Allocate manually the uclass private data in ahci_init_dm(). Don't do this
in the declaration of the scsi uclass driver with
.per_device_auto_alloc_size because it is AHCI specific.
Signed-off-by: Jean-Jacques Hiblot <jjhiblot at ti.com>
---
Since the last merge of u-boot-dm, the DM driver for AHCI on OMAP5 paltforms is
broken. This patche fixes the issue. It had previsouly been sent as part of a
series "dm: ahci: Fix dwc_ahci".
Jean-Jacques
drivers/ata/ahci.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 6da412d..1d88472 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -1090,7 +1090,13 @@ int ahci_init(void __iomem *base)
int ahci_init_dm(struct udevice *dev, void __iomem *base)
{
- struct ahci_uc_priv *uc_priv = dev_get_uclass_priv(dev);
+ struct ahci_uc_priv *uc_priv;
+
+ uc_priv = calloc(1, sizeof(struct ahci_uc_priv));
+ if (!uc_priv)
+ return -ENOMEM;
+
+ dev->uclass_priv = uc_priv;
return ahci_init_common(uc_priv, base);
}
--
1.9.1
More information about the U-Boot
mailing list