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>
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 */