drivers: phy: tweaks to phy_create()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 6 Dec 2013 12:21:19 +0000 (17:51 +0530)
committerMarek Szyprowski <m.szyprowski@samsung.com>
Thu, 15 May 2014 05:29:17 +0000 (07:29 +0200)
commit0865e22f6a7287a79e6f62c34b116f9acb5ff293
tree9bb783d5a3e421815b08f9415ca982e4eb2e1d1d
parent62fa5041f74759a5d12cb90230aa44fd8699546a
drivers: phy: tweaks to phy_create()

If this was called with a NULL "dev" then it lead to a NULL dereference
when we called dev_WARN().  I have changed it to WARN_ON() so that we
get a stack dump and can fix the caller.

The rest of this patch is just cleanup like returning directly instead
of having do-nothing gotos.  Using descriptive labels instead of
GW-BASIC style "err0" and "err1".  I also flipped the order of
put_device() and ida_remove() so they are a mirror reflection of the
order they were allocated.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[backport from upstream commit 52797d293287f5a98bd686616527b102b077ac39]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I695ba238d040b484d1be1f10f7752a7dac164aab
drivers/phy/phy-core.c