Commit bfc1c6b4838501d10aa48c0e92eaf70976f4b2dd

Authored by Simon Glass
Committed by Jaehoon Chung
1 parent 068a2fc1d5

dm: ahci: Correct uclass private data

This is expected to be attached to the uclass and the code operates that
way, but the uclass has not been updated. Fix it to avoid using memory at
address 0.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: 47fc61a (dm: ahci: Drop use of probe_ent)

Showing 2 changed files with 3 additions and 1 deletions Side-by-side Diff

drivers/ata/ahci-uclass.c
... ... @@ -6,10 +6,12 @@
6 6 */
7 7  
8 8 #include <common.h>
  9 +#include <ahci.h>
9 10 #include <dm.h>
10 11  
11 12 UCLASS_DRIVER(ahci) = {
12 13 .id = UCLASS_AHCI,
13 14 .name = "ahci",
  15 + .per_device_auto_alloc_size = sizeof(struct ahci_uc_priv),
14 16 };
... ... @@ -935,7 +935,7 @@
935 935 {
936 936 struct ahci_uc_priv *uc_priv;
937 937 #ifdef CONFIG_DM_SCSI
938   - uc_priv = dev_get_uclass_priv(dev);
  938 + uc_priv = dev_get_uclass_priv(dev->parent);
939 939 #else
940 940 uc_priv = probe_ent;
941 941 #endif