Skip to content

Commit

Permalink
pxa168_eth: remove unneeded null check
Browse files Browse the repository at this point in the history
"pep->pd" isn't checked consistently in this function.  For example it's
dereferenced unconditionally on the next line after the end of the if
condition.  This function is only called from pxa168_eth_probe() and
pep->pd is always non-NULL so I removed the check.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Dan Carpenter authored and David S. Miller committed Aug 24, 2010
1 parent ef24b16 commit 4169591
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/net/pxa168_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -1414,10 +1414,8 @@ static int ethernet_phy_setup(struct net_device *dev)
{
struct pxa168_eth_private *pep = netdev_priv(dev);

if (pep->pd != NULL) {
if (pep->pd->init)
pep->pd->init();
}
if (pep->pd->init)
pep->pd->init();
pep->phy = phy_scan(pep, pep->pd->phy_addr & 0x1f);
if (pep->phy != NULL)
phy_init(pep, pep->pd->speed, pep->pd->duplex);
Expand Down

0 comments on commit 4169591

Please sign in to comment.