diff mbox series

[2/3] ata: mvebu: use dev_read_addr() to get base address

Message ID 20200804051443.1074096-2-yamada.masahiro@socionext.com
State Accepted
Commit 1450bff3e4719d1b34189bf62ad19d0e3c10a548
Delegated to: Simon Glass
Headers show
Series [1/3] gpio: at91: use dev_read_addr() to get base address | expand

Commit Message

Masahiro Yamada Aug. 4, 2020, 5:14 a.m. UTC
It is strange to use devfdt_get_addr_ptr(), then cast the pointer
back to ulong because you could use devfdt_get_addr() without casting.

Convert it to dev_read_addr(), which is capable to CONFIG_OF_LIVE.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 drivers/ata/ahci_mvebu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stefan Roese Aug. 4, 2020, 6:36 a.m. UTC | #1
On 04.08.20 07:14, Masahiro Yamada wrote:
> It is strange to use devfdt_get_addr_ptr(), then cast the pointer
> back to ulong because you could use devfdt_get_addr() without casting.
> 
> Convert it to dev_read_addr(), which is capable to CONFIG_OF_LIVE.
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
> 
>   drivers/ata/ahci_mvebu.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/ata/ahci_mvebu.c b/drivers/ata/ahci_mvebu.c
> index 8be1826d40..7d82d2ea3f 100644
> --- a/drivers/ata/ahci_mvebu.c
> +++ b/drivers/ata/ahci_mvebu.c
> @@ -39,7 +39,7 @@ static int mvebu_ahci_probe(struct udevice *dev)
>   	 */
>   	board_ahci_enable();
>   
> -	ahci_probe_scsi(dev, (ulong)devfdt_get_addr_ptr(dev));
> +	ahci_probe_scsi(dev, dev_read_addr(dev));

Reviewed-by: Stefan Roese <sr@denx.de>

Thanks,
Stefan
Simon Glass Aug. 22, 2020, 11:18 p.m. UTC | #2
On 04.08.20 07:14, Masahiro Yamada wrote:
> It is strange to use devfdt_get_addr_ptr(), then cast the pointer
> back to ulong because you could use devfdt_get_addr() without casting.
>
> Convert it to dev_read_addr(), which is capable to CONFIG_OF_LIVE.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
>
>   drivers/ata/ahci_mvebu.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
Applied to u-boot-dm, thanks!
diff mbox series

Patch

diff --git a/drivers/ata/ahci_mvebu.c b/drivers/ata/ahci_mvebu.c
index 8be1826d40..7d82d2ea3f 100644
--- a/drivers/ata/ahci_mvebu.c
+++ b/drivers/ata/ahci_mvebu.c
@@ -39,7 +39,7 @@  static int mvebu_ahci_probe(struct udevice *dev)
 	 */
 	board_ahci_enable();
 
-	ahci_probe_scsi(dev, (ulong)devfdt_get_addr_ptr(dev));
+	ahci_probe_scsi(dev, dev_read_addr(dev));
 
 	return 0;
 }