diff options
author | Mayuresh Kulkarni <mkulkarni@nvidia.com> | 2012-05-14 14:38:22 +0530 |
---|---|---|
committer | Rohan Somvanshi <rsomvanshi@nvidia.com> | 2012-05-17 06:13:18 -0700 |
commit | a3b39fa6020e7c53236a50bbda1ca0a2ab78b2c2 (patch) | |
tree | 26fcb40c85645ef6ad1004ee65a3e28da8061288 /drivers/video/tegra/host/bus_client.c | |
parent | e6ce6a3069e2a83c0343d6de8656aee95c6b49f3 (diff) |
video: tegra: host: remove nvhost_channel from nvhost_master
- nvhost_master holds a reference to all the channels for
a chip architecture
- however, nvhost_master is a private data of host1x hardware
device. so it should contain only members needed by host1x
hardware device
- add chip specific apis to allocate and free channels
- this will also help to remove the static binding between
nvhost_device and a channel per SoC in future
Bug 871237
Change-Id: I2148db57b995b4cb60954ebb6e670f588552eca4
Signed-off-by: Mayuresh Kulkarni <mkulkarni@nvidia.com>
Reviewed-on: http://git-master/r/91687
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/video/tegra/host/bus_client.c')
-rw-r--r-- | drivers/video/tegra/host/bus_client.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/video/tegra/host/bus_client.c b/drivers/video/tegra/host/bus_client.c index 660e7956edba..9a32e5333d08 100644 --- a/drivers/video/tegra/host/bus_client.c +++ b/drivers/video/tegra/host/bus_client.c @@ -532,7 +532,11 @@ int nvhost_client_device_init(struct nvhost_device *dev) { int err; struct nvhost_master *nvhost_master = nvhost_get_host(dev); - struct nvhost_channel *ch = &nvhost_master->channels[dev->index]; + struct nvhost_channel *ch; + + ch = nvhost_alloc_channel(dev->index); + if (ch == NULL) + return -ENODEV; /* store the pointer to this device for channel */ ch->dev = dev; @@ -555,6 +559,7 @@ int nvhost_client_device_init(struct nvhost_device *dev) fail: /* Add clean-up */ + nvhost_free_channel(ch); return err; } |