struct nvhost_channel_userctx *priv;
struct nvhost_device_data *pdata;
- if (inode)
- ch = container_of(inode->i_cdev, struct nvhost_channel, cdev);
+ if (inode) {
+ pdata = container_of(inode->i_cdev,
+ struct nvhost_device_data, cdev);
+ ch = pdata->channel;
+ }
+
ch = nvhost_getchannel(ch, false, true);
if (!ch)
return -ENOMEM;
/* gk20a creates the channel node by itself */
if (pdata->class != NV_GRAPHICS_GPU_CLASS_ID) {
- ch->node = nvhost_client_device_create(dev, &ch->cdev,
+ pdata->node = nvhost_client_device_create(dev, &pdata->cdev,
"", devno, &nvhost_channelops);
- if (ch->node == NULL)
+ if (pdata->node == NULL)
goto fail;
}
if (pdata->as_ops) {
++devno;
- ch->as_node = nvhost_client_device_create(dev, &ch->as_cdev,
+ ch->as_node = nvhost_client_device_create(dev,
+ &ch->as_cdev,
"as-", devno, &nvhost_asops);
if (ch->as_node == NULL)
goto fail;
BUG_ON(!ch);
- if (ch->node) {
- device_destroy(nvhost_master->nvhost_class, ch->cdev.dev);
- cdev_del(&ch->cdev);
+ if (pdata->node) {
+ device_destroy(nvhost_master->nvhost_class, pdata->cdev.dev);
+ cdev_del(&pdata->cdev);
}
if (ch->as_node) {