diff options
| author | Peng Fan <[email protected]> | 2026-05-26 15:46:15 +0800 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2026-06-09 16:00:11 -0600 |
| commit | ffbfe1cec387e35eadf522e4a7d6ffdba956158b (patch) | |
| tree | bc93aceca1d0d4931b0f631c9df4f78d7e90394f /drivers/ata | |
| parent | ebb9ee6ef48015d58a08ed8c8e21ad4cd4041e2b (diff) | |
ata: mtk_ahci: Use dev_remap_addr_index() and ofnode API
Use dev_remap_addr_index() instead of devfdt_remap_addr_index() to map the
controller registers, removing the dependency on FDT-specific helpers.
Replace the direct fdt_get_property() lookup combined with dev_of_offset()
by dev_read_prop().
No functional changes.
Signed-off-by: Peng Fan <[email protected]>
Diffstat (limited to 'drivers/ata')
| -rw-r--r-- | drivers/ata/mtk_ahci.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/ata/mtk_ahci.c b/drivers/ata/mtk_ahci.c index 53aabee0a5e..1d4245ee635 100644 --- a/drivers/ata/mtk_ahci.c +++ b/drivers/ata/mtk_ahci.c @@ -45,7 +45,9 @@ static int mtk_ahci_of_to_plat(struct udevice *dev) { struct mtk_ahci_priv *priv = dev_get_priv(dev); - priv->base = devfdt_remap_addr_index(dev, 0); + priv->base = dev_remap_addr_index(dev, 0); + if (!priv->base) + return -EINVAL; return 0; } @@ -54,11 +56,9 @@ static int mtk_ahci_parse_property(struct ahci_uc_priv *hpriv, struct udevice *dev) { struct mtk_ahci_priv *plat = dev_get_priv(dev); - const void *fdt = gd->fdt_blob; /* enable SATA function if needed */ - if (fdt_get_property(fdt, dev_of_offset(dev), - "mediatek,phy-mode", NULL)) { + if (dev_read_prop(dev, "mediatek,phy-mode", NULL)) { plat->mode = syscon_regmap_lookup_by_phandle(dev, "mediatek,phy-mode"); if (IS_ERR(plat->mode)) { @@ -69,8 +69,8 @@ static int mtk_ahci_parse_property(struct ahci_uc_priv *hpriv, SYS_CFG_SATA_MSK, SYS_CFG_SATA_EN); } - ofnode_read_u32(dev_ofnode(dev), "ports-implemented", - &hpriv->port_map); + dev_read_u32(dev, "ports-implemented", &hpriv->port_map); + return 0; } |
