aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2014-12-18 09:06:56 -0500
committerThierry Reding <treding@nvidia.com>2015-01-23 06:07:01 -0500
commit38d98de4332fcdaa72fc83443c1e3268e4b2214b (patch)
treebb473fa1e2005bdc790daee18ef9dad5053ea39c
parent536e1715226c94037df12f7c6280cbe0f6009f92 (diff)
gpu: host1x: Call host1x_device_add() under lock
Instead of locking within host1x_device_add(), call it under the lock to make the locking more consistent. Signed-off-by: Thierry Reding <treding@nvidia.com>
-rw-r--r--drivers/gpu/host1x/bus.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/gpu/host1x/bus.c b/drivers/gpu/host1x/bus.c
index e4182e68e29c..769116dba797 100644
--- a/drivers/gpu/host1x/bus.c
+++ b/drivers/gpu/host1x/bus.c
@@ -323,9 +323,7 @@ static int host1x_device_add(struct host1x *host1x,
323 return err; 323 return err;
324 } 324 }
325 325
326 mutex_lock(&host1x->devices_lock);
327 list_add_tail(&device->list, &host1x->devices); 326 list_add_tail(&device->list, &host1x->devices);
328 mutex_unlock(&host1x->devices_lock);
329 327
330 mutex_lock(&clients_lock); 328 mutex_lock(&clients_lock);
331 329
@@ -414,11 +412,11 @@ static void host1x_attach_driver(struct host1x *host1x,
414 } 412 }
415 } 413 }
416 414
417 mutex_unlock(&host1x->devices_lock);
418
419 err = host1x_device_add(host1x, driver); 415 err = host1x_device_add(host1x, driver);
420 if (err < 0) 416 if (err < 0)
421 dev_err(host1x->dev, "failed to allocate device: %d\n", err); 417 dev_err(host1x->dev, "failed to allocate device: %d\n", err);
418
419 mutex_unlock(&host1x->devices_lock);
422} 420}
423 421
424static void host1x_detach_driver(struct host1x *host1x, 422static void host1x_detach_driver(struct host1x *host1x,