bnx2: Fix compiler warning in bnx2_disable_forced_2g5().
authorMichael Chan <mchan@broadcom.com>
Tue, 8 Jun 2010 07:21:30 +0000 (07:21 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sat, 12 Jun 2010 01:37:07 +0000 (18:37 -0700)
commitcbd6890c5987cd7115147e1dd2c10d729afabb08
tree074d6e8fcb69fdc2d5a2d07d7a284c76f08b8771
parentfc0ba8e87189b02683177116932fa580ab97b7ff
bnx2: Fix compiler warning in bnx2_disable_forced_2g5().

drivers/net/bnx2.c: In function 'bnx2_disable_forced_2g5':
drivers/net/bnx2.c:1489: warning: 'bmcr' may be used uninitialized in this function

We fix it by checking return values from all bnx2_read_phy() and proceeding
to do read-modify-write only if the read operation is successful.

The related bnx2_enable_forced_2g5() is also fixed the same way.

Reported-by: Prarit Bhargava <prarit@redhat.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bnx2.c