usb: host: use map_physmem method in ohci-generic

Using map_physmem method instead of typecasting fdt_addr_t to a
pointer directly.

This is inspired by commit 643cacb6d ("usb: ehci: Use map_physmem
in ehci-generic").

Change-Id: I99590eabc763ad73bfb8f0cba7d02f9ef2fb423a
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
This commit is contained in:
Frank Wang 2018-02-23 15:33:46 +08:00 committed by Kever Yang
parent db235eb51f
commit 5ccb6a79f2
1 changed files with 3 additions and 1 deletions

View File

@ -4,6 +4,7 @@
* SPDX-License-Identifier: GPL-2.0+
*/
#include <asm/io.h>
#include <common.h>
#include <clk.h>
#include <dm.h>
@ -27,7 +28,7 @@ struct generic_ohci {
static int ohci_usb_probe(struct udevice *dev)
{
struct ohci_regs *regs = (struct ohci_regs *)devfdt_get_addr(dev);
struct ohci_regs *regs;
struct generic_ohci *priv = dev_get_priv(dev);
int i, err, ret, clock_nb, reset_nb;
@ -100,6 +101,7 @@ static int ohci_usb_probe(struct udevice *dev)
}
}
regs = map_physmem(dev_read_addr(dev), 0x100, MAP_NOCACHE);
err = ohci_register(dev, regs);
if (err)
goto phy_err;