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