aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ssb
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2012-01-24 13:35:24 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2012-01-24 19:00:35 -0500
commitf3ff9247088a0af0c192a28908dab76ff3d8871f (patch)
tree4ff2c822bcf82213d14b2195d4f00fe470876b1d /drivers/ssb
parent9f30ea950edfaefa51221dd26a065b3442599778 (diff)
Remove useless get_driver()/put_driver() calls
As part of the removal of get_driver()/put_driver(), this patch (as1512) gets rid of various useless and unnecessary calls in several drivers. In some cases it may be desirable to pin the driver by calling try_module_get(), but that can be done later. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> CC: "David S. Miller" <davem@davemloft.net> CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> CC: Michael Buesch <m@bues.ch> CC: Joerg Roedel <joerg.roedel@amd.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/ssb')
-rw-r--r--drivers/ssb/main.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/drivers/ssb/main.c b/drivers/ssb/main.c
index bb6317fb925c..ff109ae94767 100644
--- a/drivers/ssb/main.c
+++ b/drivers/ssb/main.c
@@ -140,19 +140,6 @@ static void ssb_device_put(struct ssb_device *dev)
140 put_device(dev->dev); 140 put_device(dev->dev);
141} 141}
142 142
143static inline struct ssb_driver *ssb_driver_get(struct ssb_driver *drv)
144{
145 if (drv)
146 get_driver(&drv->drv);
147 return drv;
148}
149
150static inline void ssb_driver_put(struct ssb_driver *drv)
151{
152 if (drv)
153 put_driver(&drv->drv);
154}
155
156static int ssb_device_resume(struct device *dev) 143static int ssb_device_resume(struct device *dev)
157{ 144{
158 struct ssb_device *ssb_dev = dev_to_ssb_dev(dev); 145 struct ssb_device *ssb_dev = dev_to_ssb_dev(dev);
@@ -250,11 +237,9 @@ int ssb_devices_freeze(struct ssb_bus *bus, struct ssb_freeze_context *ctx)
250 ssb_device_put(sdev); 237 ssb_device_put(sdev);
251 continue; 238 continue;
252 } 239 }
253 sdrv = ssb_driver_get(drv_to_ssb_drv(sdev->dev->driver)); 240 sdrv = drv_to_ssb_drv(sdev->dev->driver);
254 if (!sdrv || SSB_WARN_ON(!sdrv->remove)) { 241 if (SSB_WARN_ON(!sdrv->remove))
255 ssb_device_put(sdev);
256 continue; 242 continue;
257 }
258 sdrv->remove(sdev); 243 sdrv->remove(sdev);
259 ctx->device_frozen[i] = 1; 244 ctx->device_frozen[i] = 1;
260 } 245 }
@@ -293,7 +278,6 @@ int ssb_devices_thaw(struct ssb_freeze_context *ctx)
293 dev_name(sdev->dev)); 278 dev_name(sdev->dev));
294 result = err; 279 result = err;
295 } 280 }
296 ssb_driver_put(sdrv);
297 ssb_device_put(sdev); 281 ssb_device_put(sdev);
298 } 282 }
299 283