]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
video: tegra: host: device init for channel map
authorShridhar Rasal <srasal@nvidia.com>
Tue, 22 Apr 2014 03:41:56 +0000 (09:11 +0530)
committerMandar Padmawar <mpadmawar@nvidia.com>
Fri, 23 May 2014 08:57:32 +0000 (01:57 -0700)
Initialize device on first channel map and ignore on subsequent
channel mapping for same device. Also check for device init failure
after init call.

Bug 1259844

Change-Id: I570967bc60af8e467443aa7bbfaf726bf20da45a
(cherry picked from commit 70bf6df9f62956e4b75ad5c3ad1279ec2a7b1167)

Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Change-Id: I43293f603bc8c1a296675e20490d1b8c33b3ee40
Reviewed-on: http://git-master/r/412523
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Arto Merilainen <amerilainen@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
drivers/video/tegra/host/nvhost_channel.c

index bf666bfabe762c5fe943fe82a0b6a05bf99296c5..a2fe01c8d62a819139b0a065c8efca94a3c4943e 100644 (file)
@@ -274,14 +274,14 @@ struct nvhost_channel *nvhost_channel_map(struct nvhost_device_data *pdata)
        else
                host->next_free_ch = index + 1;
 
-       if (pdata->init)
+       if (pdata->init && pdata->num_mapped_chs == 1) {
                err = pdata->init(ch->dev);
-
-       if (err) {
-               dev_err(&ch->dev->dev, "%s: device init failed\n", __func__);
-               mutex_unlock(&host->chlist_mutex);
-               nvhost_channel_unmap(ch);
-               return NULL;
+               if (err) {
+                       dev_err(&ch->dev->dev, "device init failed\n");
+                       mutex_unlock(&host->chlist_mutex);
+                       nvhost_channel_unmap(ch);
+                       return NULL;
+               }
        }
 
        /* Keep alive modules that needs to be when a channel is open */