Hello.

On 06/27/2014 07:09 PM, dingu...@altera.com wrote:

From: Dinh Nguyen <dingu...@altera.com>

This patch fixes this sparse warning:

drivers/usb/dwc2/platform.c:168:25: warning: incorrect type in argument 1 
(different address spaces)
drivers/usb/dwc2/platform.c:168:25:    expected void const *ptr
drivers/usb/dwc2/platform.c:168:25:    got void [noderef] <asn:2>*regs
drivers/usb/dwc2/platform.c:169:37: warning: incorrect type in argument 1 
(different address spaces)
drivers/usb/dwc2/platform.c:169:37:    expected void const *ptr
drivers/usb/dwc2/platform.c:169:37:    got void [noderef] <asn:2>*regs

Signed-off-by: Dinh Nguyen <dingu...@altera.com>
---
  drivers/usb/dwc2/platform.c |    4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c
index a10e7a3..443c321 100644
--- a/drivers/usb/dwc2/platform.c
+++ b/drivers/usb/dwc2/platform.c
@@ -165,8 +165,8 @@ static int dwc2_driver_probe(struct platform_device *dev)

        res = platform_get_resource(dev, IORESOURCE_MEM, 0);
        hsotg->regs = devm_ioremap_resource(&dev->dev, res);
-       if (IS_ERR(hsotg->regs))
-               return PTR_ERR(hsotg->regs);
+       if (!hsotg->regs)
+               return -ENOMEM;

   This is wrong -- devm_ioremap_resource() returns error pointer, not NULL.

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to