]> 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)
committerGerrit Code Review <gerrit2@nvidia.com>
Mon, 28 Apr 2014 05:51:02 +0000 (22:51 -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
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
drivers/video/tegra/host/nvhost_channel.c

index 33e93520301762907dcb10ee7bbfcfba443f1a2c..b4934ebe42c6685d3e76f732eed55c76555cf5ab 100644 (file)
@@ -271,14 +271,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 */