net: sfp: move sfp_register_socket call from sfp_remove to sfp_probe
Commit c4ba68b8691e4 backported from upstream to 4.14 stable was probably applied wrongly, and instead of calling sfp_register_socket in sfp_probe, the socket registering code was put into sfp_remove. This is obviously wrong. The commit first appeared in 4.14.104. Fix it for the next 4.14 release. Fixes: c4ba68b8691e4 ("net: sfp: do not probe SFP module before we're attached") Cc: stable <stable@vger.kernel.org> Cc: Russell King <rmk+kernel@armlinux.org.uk> Cc: David S. Miller <davem@davemloft.net> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Sasha Levin <sashal@kernel.org> Signed-off-by: Marek Behún <marek.behun@nic.cz> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
1ec8f1f0bf
commit
f5393c3670
@ -878,6 +878,10 @@ static int sfp_probe(struct platform_device *pdev)
|
||||
if (poll)
|
||||
mod_delayed_work(system_wq, &sfp->poll, poll_jiffies);
|
||||
|
||||
sfp->sfp_bus = sfp_register_socket(sfp->dev, sfp, &sfp_module_ops);
|
||||
if (!sfp->sfp_bus)
|
||||
return -ENOMEM;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -887,10 +891,6 @@ static int sfp_remove(struct platform_device *pdev)
|
||||
|
||||
sfp_unregister_socket(sfp->sfp_bus);
|
||||
|
||||
sfp->sfp_bus = sfp_register_socket(sfp->dev, sfp, &sfp_module_ops);
|
||||
if (!sfp->sfp_bus)
|
||||
return -ENOMEM;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user