Skip to content

Commit

Permalink
ARM: mx5: check for error in ioremap
Browse files Browse the repository at this point in the history
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
  • Loading branch information
Fabio Estevam authored and Sascha Hauer committed Dec 14, 2010
1 parent bb477de commit 28a4f90
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arch/arm/mach-mx5/board-cpuimx51.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ static int initialize_otg_port(struct platform_device *pdev)
void __iomem *usbother_base;

usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K);
if (!usb_base)
return -ENOMEM;
usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET;

/* Set the PHY clock to 19.2MHz */
Expand All @@ -196,6 +198,8 @@ static int initialize_usbh1_port(struct platform_device *pdev)
void __iomem *usbother_base;

usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K);
if (!usb_base)
return -ENOMEM;
usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET;

/* The clock for the USBH1 ULPI port will come externally from the PHY. */
Expand Down
4 changes: 4 additions & 0 deletions arch/arm/mach-mx5/board-cpuimx51sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ static int initialize_otg_port(struct platform_device *pdev)
void __iomem *usbother_base;

usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K);
if (!usb_base)
return -ENOMEM;
usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET;

/* Set the PHY clock to 19.2MHz */
Expand All @@ -175,6 +177,8 @@ static int initialize_usbh1_port(struct platform_device *pdev)
void __iomem *usbother_base;

usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K);
if (!usb_base)
return -ENOMEM;
usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET;

/* The clock for the USBH1 ULPI port will come from the PHY. */
Expand Down
4 changes: 4 additions & 0 deletions arch/arm/mach-mx5/board-mx51_babbage.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,8 @@ static int initialize_otg_port(struct platform_device *pdev)
void __iomem *usbother_base;

usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K);
if (!usb_base)
return -ENOMEM;
usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET;

/* Set the PHY clock to 19.2MHz */
Expand All @@ -280,6 +282,8 @@ static int initialize_usbh1_port(struct platform_device *pdev)
void __iomem *usbother_base;

usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K);
if (!usb_base)
return -ENOMEM;
usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET;

/* The clock for the USBH1 ULPI port will come externally from the PHY. */
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-mx5/board-mx51_efikamx.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ static int initialize_otg_port(struct platform_device *pdev)
void __iomem *usb_base;
void __iomem *usbother_base;
usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K);
if (!usb_base)
return -ENOMEM;
usbother_base = (void __iomem *)(usb_base + MX5_USBOTHER_REGS_OFFSET);

/* Set the PHY clock to 19.2MHz */
Expand Down
4 changes: 4 additions & 0 deletions arch/arm/plat-mxc/ehci.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,10 @@ int mxc_initialize_usb_hw(int port, unsigned int flags)
int ret = 0;

usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K);
if (!usb_base) {
printk(KERN_ERR "%s(): ioremap failed\n", __func__);
return -ENOMEM;
}

switch (port) {
case 0: /* OTG port */
Expand Down

0 comments on commit 28a4f90

Please sign in to comment.