aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2007-04-09 11:52:31 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-04-27 13:57:31 -0400
commit87aebe078e450795d336d20304d01095251ff9fa (patch)
treebe325bd51bb7f9fdd75b0970b71dc6826b93a131
parenta2a0f74dc1e7d588b0ba6a1d177f42bef18117d0 (diff)
PHY: remove rwsem use from phy core
The subsystem rwsem is not used by the driver core at all, so the use of it in the phy code doesn't make any sense. They might possibly want to use a local lock, but I am unsure about that. Cc: netdev <netdev@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/net/phy/fixed.c6
-rw-r--r--drivers/net/phy/phy_device.c9
2 files changed, 1 insertions, 14 deletions
diff --git a/drivers/net/phy/fixed.c b/drivers/net/phy/fixed.c
index 66da91bb1388..68c99b4c5255 100644
--- a/drivers/net/phy/fixed.c
+++ b/drivers/net/phy/fixed.c
@@ -276,21 +276,15 @@ static int fixed_mdio_register_device(int number, int speed, int duplex)
276 artificially, we are binding the driver here by hand; 276 artificially, we are binding the driver here by hand;
277 it will be the same for all the fixed phys anyway. 277 it will be the same for all the fixed phys anyway.
278 */ 278 */
279 down_write(&phydev->dev.bus->subsys.rwsem);
280
281 phydev->dev.driver = &fixed_mdio_driver.driver; 279 phydev->dev.driver = &fixed_mdio_driver.driver;
282 280
283 err = phydev->dev.driver->probe(&phydev->dev); 281 err = phydev->dev.driver->probe(&phydev->dev);
284 if(err < 0) { 282 if(err < 0) {
285 printk(KERN_ERR "Phy %s: problems with fixed driver\n",phydev->dev.bus_id); 283 printk(KERN_ERR "Phy %s: problems with fixed driver\n",phydev->dev.bus_id);
286 up_write(&phydev->dev.bus->subsys.rwsem);
287 goto probe_fail; 284 goto probe_fail;
288 } 285 }
289 286
290 err = device_bind_driver(&phydev->dev); 287 err = device_bind_driver(&phydev->dev);
291
292 up_write(&phydev->dev.bus->subsys.rwsem);
293
294 if (err) 288 if (err)
295 goto probe_fail; 289 goto probe_fail;
296 290
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 7d5b6d1838c8..8f01952c4850 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -208,16 +208,12 @@ struct phy_device *phy_attach(struct net_device *dev,
208 * exist, and we should use the genphy driver. */ 208 * exist, and we should use the genphy driver. */
209 if (NULL == d->driver) { 209 if (NULL == d->driver) {
210 int err; 210 int err;
211 down_write(&d->bus->subsys.rwsem);
212 d->driver = &genphy_driver.driver; 211 d->driver = &genphy_driver.driver;
213 212
214 err = d->driver->probe(d); 213 err = d->driver->probe(d);
215
216 if (err >= 0) 214 if (err >= 0)
217 err = device_bind_driver(d); 215 err = device_bind_driver(d);
218 216
219 up_write(&d->bus->subsys.rwsem);
220
221 if (err) 217 if (err)
222 return ERR_PTR(err); 218 return ERR_PTR(err);
223 } 219 }
@@ -258,11 +254,8 @@ void phy_detach(struct phy_device *phydev)
258 * was using the generic driver), we unbind the device 254 * was using the generic driver), we unbind the device
259 * from the generic driver so that there's a chance a 255 * from the generic driver so that there's a chance a
260 * real driver could be loaded */ 256 * real driver could be loaded */
261 if (phydev->dev.driver == &genphy_driver.driver) { 257 if (phydev->dev.driver == &genphy_driver.driver)
262 down_write(&phydev->dev.bus->subsys.rwsem);
263 device_release_driver(&phydev->dev); 258 device_release_driver(&phydev->dev);
264 up_write(&phydev->dev.bus->subsys.rwsem);
265 }
266} 259}
267EXPORT_SYMBOL(phy_detach); 260EXPORT_SYMBOL(phy_detach);
268 261