sfp: fix EEPROM reading in the case of non-SFF8472 SFPs
authorRussell King <rmk+kernel@armlinux.org.uk>
Fri, 15 Dec 2017 16:09:41 +0000 (16:09 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 18 Dec 2017 19:57:48 +0000 (14:57 -0500)
commit2794ffc441dde3109804085dc745e8014a4de224
treed80d005d64cb8214246c3940695a77628e3f4eb5
parent20b56ed9f8adfb9a7fb1c878878c54aa4ed645c1
sfp: fix EEPROM reading in the case of non-SFF8472 SFPs

The EEPROM reading was trying to read from the second EEPROM address
if we requested the last byte from the SFF8079 EEPROM, which caused a
failure when the second EEPROM is not present.  Discovered with a
S-RJ01 SFP module.  Fix this.

Fixes: 73970055450e ("sfp: add SFP module support")
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/sfp.c