aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorYi Zou <yi.zou@intel.com>2011-04-01 19:06:04 -0400
committerJames Bottomley <James.Bottomley@suse.de>2011-05-01 11:19:05 -0400
commit38b34aca30ef1296bbc552505d80c69f274f0872 (patch)
tree72f947566e791871997a5448a19f6dc05d1623ed /drivers
parentee5df628c1d7f3ff4db3174f7c00873c94f616d9 (diff)
[SCSI] fcoe: remove unnecessary module state check
The check of module state being MODULE_STATE_LIVE is no longer needed for the individual fcoe transport driver, e.g., fcoe.ko, as sysfs entries now go to libfcoe now, if it reaches fcoe.ko, it has to be already registered. The module state check for libfcoe will guard the possible race condition of sysfs being writable before module_init function is called and after module_exit. Signed-off-by: Yi Zou <yi.zou@intel.com> Tested-by: Ross Brattain <ross.b.brattain@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/fcoe/fcoe.c47
1 files changed, 0 insertions, 47 deletions
diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c
index 9e7206ebadf0..34408d945175 100644
--- a/drivers/scsi/fcoe/fcoe.c
+++ b/drivers/scsi/fcoe/fcoe.c
@@ -1783,17 +1783,6 @@ static int fcoe_disable(struct net_device *netdev)
1783 int rc = 0; 1783 int rc = 0;
1784 1784
1785 mutex_lock(&fcoe_config_mutex); 1785 mutex_lock(&fcoe_config_mutex);
1786#ifdef CONFIG_FCOE_MODULE
1787 /*
1788 * Make sure the module has been initialized, and is not about to be
1789 * removed. Module paramter sysfs files are writable before the
1790 * module_init function is called and after module_exit.
1791 */
1792 if (THIS_MODULE->state != MODULE_STATE_LIVE) {
1793 rc = -ENODEV;
1794 goto out_nodev;
1795 }
1796#endif
1797 1786
1798 rtnl_lock(); 1787 rtnl_lock();
1799 fcoe = fcoe_hostlist_lookup_port(netdev); 1788 fcoe = fcoe_hostlist_lookup_port(netdev);
@@ -1805,7 +1794,6 @@ static int fcoe_disable(struct net_device *netdev)
1805 } else 1794 } else
1806 rc = -ENODEV; 1795 rc = -ENODEV;
1807 1796
1808out_nodev:
1809 mutex_unlock(&fcoe_config_mutex); 1797 mutex_unlock(&fcoe_config_mutex);
1810 return rc; 1798 return rc;
1811} 1799}
@@ -1824,17 +1812,6 @@ static int fcoe_enable(struct net_device *netdev)
1824 int rc = 0; 1812 int rc = 0;
1825 1813
1826 mutex_lock(&fcoe_config_mutex); 1814 mutex_lock(&fcoe_config_mutex);
1827#ifdef CONFIG_FCOE_MODULE
1828 /*
1829 * Make sure the module has been initialized, and is not about to be
1830 * removed. Module paramter sysfs files are writable before the
1831 * module_init function is called and after module_exit.
1832 */
1833 if (THIS_MODULE->state != MODULE_STATE_LIVE) {
1834 rc = -ENODEV;
1835 goto out_nodev;
1836 }
1837#endif
1838 rtnl_lock(); 1815 rtnl_lock();
1839 fcoe = fcoe_hostlist_lookup_port(netdev); 1816 fcoe = fcoe_hostlist_lookup_port(netdev);
1840 rtnl_unlock(); 1817 rtnl_unlock();
@@ -1844,7 +1821,6 @@ static int fcoe_enable(struct net_device *netdev)
1844 else if (!fcoe_link_ok(fcoe->ctlr.lp)) 1821 else if (!fcoe_link_ok(fcoe->ctlr.lp))
1845 fcoe_ctlr_link_up(&fcoe->ctlr); 1822 fcoe_ctlr_link_up(&fcoe->ctlr);
1846 1823
1847out_nodev:
1848 mutex_unlock(&fcoe_config_mutex); 1824 mutex_unlock(&fcoe_config_mutex);
1849 return rc; 1825 return rc;
1850} 1826}
@@ -1863,17 +1839,6 @@ static int fcoe_destroy(struct net_device *netdev)
1863 int rc = 0; 1839 int rc = 0;
1864 1840
1865 mutex_lock(&fcoe_config_mutex); 1841 mutex_lock(&fcoe_config_mutex);
1866#ifdef CONFIG_FCOE_MODULE
1867 /*
1868 * Make sure the module has been initialized, and is not about to be
1869 * removed. Module paramter sysfs files are writable before the
1870 * module_init function is called and after module_exit.
1871 */
1872 if (THIS_MODULE->state != MODULE_STATE_LIVE) {
1873 rc = -ENODEV;
1874 goto out_nodev;
1875 }
1876#endif
1877 rtnl_lock(); 1842 rtnl_lock();
1878 fcoe = fcoe_hostlist_lookup_port(netdev); 1843 fcoe = fcoe_hostlist_lookup_port(netdev);
1879 if (!fcoe) { 1844 if (!fcoe) {
@@ -1938,18 +1903,6 @@ static int fcoe_create(struct net_device *netdev, enum fip_state fip_mode)
1938 mutex_lock(&fcoe_config_mutex); 1903 mutex_lock(&fcoe_config_mutex);
1939 rtnl_lock(); 1904 rtnl_lock();
1940 1905
1941#ifdef CONFIG_FCOE_MODULE
1942 /*
1943 * Make sure the module has been initialized, and is not about to be
1944 * removed. Module paramter sysfs files are writable before the
1945 * module_init function is called and after module_exit.
1946 */
1947 if (THIS_MODULE->state != MODULE_STATE_LIVE) {
1948 rc = -ENODEV;
1949 goto out_nodev;
1950 }
1951#endif
1952
1953 /* look for existing lport */ 1906 /* look for existing lport */
1954 if (fcoe_hostlist_lookup(netdev)) { 1907 if (fcoe_hostlist_lookup(netdev)) {
1955 rc = -EEXIST; 1908 rc = -EEXIST;