]> git.dujemihanovic.xyz Git - u-boot.git/commit
mmc: rockchip_sdhci: Fix use of device private data
authorJonas Karlman <jonas@kwiboo.se>
Tue, 18 Apr 2023 16:46:26 +0000 (16:46 +0000)
committerKever Yang <kever.yang@rock-chips.com>
Fri, 21 Apr 2023 07:16:01 +0000 (15:16 +0800)
commitb8c394b7268d5a8f927b30296ffe9cb4d71b06fc
tree4ea48def88ef0d952edbc10ad824d0aa480198dd
parentc1425ed8f873a1739874639bc120aab89a443539
mmc: rockchip_sdhci: Fix use of device private data

The device private data is misused in rockchip_sdhci_of_to_plat and
rockchip_sdhci_execute_tuning.

In these functions dev_get_priv is assigned to struct sdhci_host:

  struct sdhci_host *host = dev_get_priv(dev);

Instead, the sdhci host should refer to host in struct rockchip_sdhc:

  struct rockchip_sdhc *priv = dev_get_priv(dev);
  struct sdhci_host *host = &priv->host;

Because host is the first member in struct rockchip_sdhc this is not a
real problem, lets fix it anyway and also use priv name consistently.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
drivers/mmc/rockchip_sdhci.c