net: sfp: move module insert reporting out of probe
authorRussell King <rmk+kernel@armlinux.org.uk>
Sun, 10 Nov 2019 14:07:25 +0000 (14:07 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 12 Nov 2019 00:17:01 +0000 (16:17 -0800)
commit73f5e847d83a2e1a06b47190291d2eebf6353499
treebfd2090b986a5d3f5166c1830c37769696b343bb
parentb036a554d0806a711cdd0abb4f5fdbbf0253cc46
net: sfp: move module insert reporting out of probe

Move the module insertion reporting out of the probe handling, but
after we have detected that the upstream has attached (since that is
whom we are reporting insertion to.)

Only report module removal if we had previously reported a module
insertion.

This gives cleaner semantics, and means we can probe the module before
we have an upstream attached.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/sfp.c