]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
scsi: Add per-device private data for scsi uclass
authorMichal Simek <michal.simek@xilinx.com>
Tue, 20 Mar 2018 15:02:21 +0000 (16:02 +0100)
committerMichal Simek <michal.simek@xilinx.com>
Tue, 20 Mar 2018 15:05:32 +0000 (16:05 +0100)
This patch is doing what was done by
"dm: ahci: Correct uclass private data"
(sha1: bfc1c6b4838501d10aa48c0e92eaf70976f4b2dd)
with reverting pointer to allocated space.

It is questionable if sata_ceva should use UCLASS_SCSI or move to
UCLASS_SATA but this investigation hasn't been done yet.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/ata/ahci.c
drivers/scsi/scsi-uclass.c

index 690d35c890d2d871e9d92a254f1cf386b0c8077c..80518a93bbd415d27e74a35e0e3f556c2afa63e9 100644 (file)
@@ -935,7 +935,7 @@ static int ahci_scsi_exec(struct udevice *dev, struct scsi_cmd *pccb)
 {
        struct ahci_uc_priv *uc_priv;
 #ifdef CONFIG_DM_SCSI
-       uc_priv = dev_get_uclass_priv(dev->parent);
+       uc_priv = dev_get_uclass_priv(dev);
 #else
        uc_priv = probe_ent;
 #endif
index 31e8999297196cad628d4de381b76e9f59e438fa..50c31b1da68f10b4bac041b961a0b6279e9c2b95 100644 (file)
@@ -10,6 +10,7 @@
  */
 
 #include <common.h>
+#include <ahci.h>
 #include <dm.h>
 #include <scsi.h>
 
@@ -37,4 +38,5 @@ UCLASS_DRIVER(scsi) = {
        .id             = UCLASS_SCSI,
        .name           = "scsi",
        .per_device_platdata_auto_alloc_size = sizeof(struct scsi_platdata),
+       .per_device_auto_alloc_size = sizeof(struct ahci_uc_priv),
 };