net: phy: sfp: warn the user when no tx_disable pin is available
[linux-2.6-microblaze.git] / drivers / net / phy / sfp.c
index 4ab6e9a..a91d122 100644 (file)
@@ -1065,6 +1065,15 @@ static int sfp_probe(struct platform_device *pdev)
        if (poll)
                mod_delayed_work(system_wq, &sfp->poll, poll_jiffies);
 
+       /* We could have an issue in cases no Tx disable pin is available or
+        * wired as modules using a laser as their light source will continue to
+        * be active when the fiber is removed. This could be a safety issue and
+        * we should at least warn the user about that.
+        */
+       if (!sfp->gpio[GPIO_TX_DISABLE])
+               dev_warn(sfp->dev,
+                        "No tx_disable pin: SFP modules will always be emitting.\n");
+
        return 0;
 }