diff options
author | Himangi Saraogi <himangi774@gmail.com> | 2014-07-10 02:25:00 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-07-11 21:23:49 -0400 |
commit | 3df9fcd59fd829da046ca63518ad8e51482a39e0 (patch) | |
tree | 8a6a1b9a561bbd9113db4ec488c0ab612067fdab /drivers/phy/phy-omap-usb2.c | |
parent | 9820ccba4b1e9c0cdacf254a7be8616357086ebc (diff) |
phy: omap-usb2: fix devm_ioremap_resource error detection code
devm_ioremap_resource returns an ERR_PTR value, not NULL, on failure.
A simplified version of the semantic match that finds this problem is as
follows:
// <smpl>
@@
expression e,e1;
statement S;
@@
*e = devm_ioremap_resource(...);
if (!e1) S
// </smpl>
Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/phy/phy-omap-usb2.c')
-rw-r--r-- | drivers/phy/phy-omap-usb2.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/phy/phy-omap-usb2.c b/drivers/phy/phy-omap-usb2.c index 7007c11fe07d..2063d542b4e4 100644 --- a/drivers/phy/phy-omap-usb2.c +++ b/drivers/phy/phy-omap-usb2.c | |||
@@ -233,8 +233,8 @@ static int omap_usb2_probe(struct platform_device *pdev) | |||
233 | if (phy_data->flags & OMAP_USB2_CALIBRATE_FALSE_DISCONNECT) { | 233 | if (phy_data->flags & OMAP_USB2_CALIBRATE_FALSE_DISCONNECT) { |
234 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 234 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
235 | phy->phy_base = devm_ioremap_resource(&pdev->dev, res); | 235 | phy->phy_base = devm_ioremap_resource(&pdev->dev, res); |
236 | if (!phy->phy_base) | 236 | if (IS_ERR(phy->phy_base)) |
237 | return -ENOMEM; | 237 | return PTR_ERR(phy->phy_base); |
238 | phy->flags |= OMAP_USB2_CALIBRATE_FALSE_DISCONNECT; | 238 | phy->flags |= OMAP_USB2_CALIBRATE_FALSE_DISCONNECT; |
239 | } | 239 | } |
240 | 240 | ||