phylib: simplify bogus phy_device_create() result
authorSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Fri, 28 Aug 2015 18:34:34 +0000 (21:34 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 28 Aug 2015 21:15:24 +0000 (14:15 -0700)
Get rid of the bogus string of type casts where ERR_PTR() is enough.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/phy_device.c

index 55f01788df5ec3beb734938e48cb620c3aeedd3d..ff7dcb3e8f271a657564ec54a136e26c724f647d 100644 (file)
@@ -157,7 +157,7 @@ struct phy_device *phy_device_create(struct mii_bus *bus, int addr, int phy_id,
        /* We allocate the device, and initialize the default values */
        dev = kzalloc(sizeof(*dev), GFP_KERNEL);
        if (NULL == dev)
-               return (struct phy_device *)PTR_ERR((void *)-ENOMEM);
+               return ERR_PTR(-ENOMEM);
 
        dev->dev.release = phy_device_release;