Loading drivers/gpu/msm/adreno.c +5 −5 Original line number Diff line number Diff line Loading @@ -1199,7 +1199,7 @@ adreno_identify_gpu(struct adreno_device *adreno_dev) { const struct adreno_reg_offsets *reg_offsets; struct kgsl_device_platform_data *pdata = kgsl_device_get_drvdata(&adreno_dev->dev); dev_get_platdata(&(adreno_dev->dev.pdev->dev)); struct adreno_gpudev *gpudev; int i; Loading Loading @@ -1547,17 +1547,17 @@ int adreno_probe(struct platform_device *pdev) } device = &adreno_dev->dev; device->parentdev = &pdev->dev; device->pdev = pdev; status = adreno_of_get_pdata(pdev); if (status) { device->parentdev = NULL; device->pdev = NULL; return status; } status = kgsl_device_platform_probe(device); if (status) { device->parentdev = NULL; device->pdev = NULL; return status; } Loading Loading @@ -1590,7 +1590,7 @@ out: if (status) { adreno_ringbuffer_close(&adreno_dev->ringbuffer); kgsl_device_platform_remove(device); device->parentdev = NULL; device->pdev = NULL; } return status; Loading drivers/gpu/msm/adreno_coresight.c +3 −3 Original line number Diff line number Diff line Loading @@ -281,7 +281,7 @@ static const struct coresight_ops adreno_coresight_ops = { void adreno_coresight_remove(struct kgsl_device *device) { struct kgsl_device_platform_data *pdata = device->parentdev->platform_data; dev_get_platdata(&device->pdev->dev); coresight_unregister(pdata->csdev); pdata->csdev = NULL; Loading @@ -293,7 +293,7 @@ int adreno_coresight_init(struct kgsl_device *device) struct adreno_device *adreno_dev = ADRENO_DEVICE(device); struct adreno_gpudev *gpudev = ADRENO_GPU_DEVICE(adreno_dev); struct kgsl_device_platform_data *pdata = device->parentdev->platform_data; dev_get_platdata(&device->pdev->dev); struct coresight_desc desc; if (pdata == NULL) Loading @@ -314,7 +314,7 @@ int adreno_coresight_init(struct kgsl_device *device) desc.subtype.source_subtype = CORESIGHT_DEV_SUBTYPE_SOURCE_BUS; desc.ops = &adreno_coresight_ops; desc.pdata = pdata->coresight_pdata; desc.dev = device->parentdev; desc.dev = &device->pdev->dev; desc.owner = THIS_MODULE; desc.groups = gpudev->coresight->groups; Loading drivers/gpu/msm/kgsl.c +10 −12 Original line number Diff line number Diff line Loading @@ -935,7 +935,7 @@ static int kgsl_release(struct inode *inodep, struct file *filep) kgsl_process_private_put(private); pm_runtime_put(device->parentdev); pm_runtime_put(&device->pdev->dev); return result; } Loading Loading @@ -990,7 +990,7 @@ static int kgsl_open(struct inode *inodep, struct file *filep) return -EBUSY; } result = pm_runtime_get_sync(device->parentdev); result = pm_runtime_get_sync(&device->pdev->dev); if (result < 0) { KGSL_DRV_ERR(device, "Runtime PM: Unable to wake up the device, rc = %d\n", Loading Loading @@ -1044,7 +1044,7 @@ err_freedevpriv: filep->private_data = NULL; kfree(dev_priv); err_pmruntime: pm_runtime_put(device->parentdev); pm_runtime_put(&device->pdev->dev); return result; } Loading Loading @@ -4113,7 +4113,7 @@ static int _register_device(struct kgsl_device *device) /* Create the device */ dev = MKDEV(MAJOR(kgsl_driver.major), minor); device->dev = device_create(kgsl_driver.class, device->parentdev, &device->pdev->dev, dev, device, device->name); Loading @@ -4126,7 +4126,7 @@ static int _register_device(struct kgsl_device *device) return ret; } dev_set_drvdata(device->parentdev, device); dev_set_drvdata(&device->pdev->dev, device); return 0; } Loading @@ -4135,8 +4135,6 @@ int kgsl_device_platform_probe(struct kgsl_device *device) int result; int status = -EINVAL; struct resource *res; struct platform_device *pdev = container_of(device->parentdev, struct platform_device, dev); status = _register_device(device); if (status) Loading @@ -4150,7 +4148,7 @@ int kgsl_device_platform_probe(struct kgsl_device *device) goto error; /* Get starting physical address of device registers */ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, res = platform_get_resource_byname(device->pdev, IORESOURCE_MEM, device->iomemname); if (res == NULL) { KGSL_DRV_ERR(device, "platform_get_resource_byname failed\n"); Loading @@ -4173,7 +4171,7 @@ int kgsl_device_platform_probe(struct kgsl_device *device) * and shader memory length */ if (device->shadermemname != NULL) { res = platform_get_resource_byname(pdev, IORESOURCE_MEM, res = platform_get_resource_byname(device->pdev, IORESOURCE_MEM, device->shadermemname); if (res == NULL) { Loading Loading @@ -4211,7 +4209,7 @@ int kgsl_device_platform_probe(struct kgsl_device *device) } /*acquire interrupt */ device->pwrctrl.interrupt_num = platform_get_irq_byname(pdev, device->pwrctrl.irq_name); platform_get_irq_byname(device->pdev, device->pwrctrl.irq_name); if (device->pwrctrl.interrupt_num <= 0) { KGSL_DRV_ERR(device, "platform_get_irq_byname failed: %d\n", Loading @@ -4237,7 +4235,7 @@ int kgsl_device_platform_probe(struct kgsl_device *device) rwlock_init(&device->context_lock); result = kgsl_drm_init(pdev); result = kgsl_drm_init(device->pdev); if (result) goto error_pwrctrl_close; Loading @@ -4254,7 +4252,7 @@ int kgsl_device_platform_probe(struct kgsl_device *device) } /* Check to see if our device can perform DMA correctly */ status = dma_set_coherent_mask(&pdev->dev, KGSL_DMA_BIT_MASK); status = dma_set_coherent_mask(&device->pdev->dev, KGSL_DMA_BIT_MASK); if (status) goto error_close_mmu; Loading drivers/gpu/msm/kgsl_device.h +2 −14 Original line number Diff line number Diff line Loading @@ -331,7 +331,7 @@ struct kgsl_device { wait_queue_head_t wait_queue; wait_queue_head_t active_cnt_wq; struct workqueue_struct *work_queue; struct device *parentdev; struct platform_device *pdev; struct dentry *d_debugfs; struct idr context_idr; rwlock_t context_lock; Loading Loading @@ -621,15 +621,6 @@ int kgsl_add_event(struct kgsl_device *device, struct kgsl_event_group *group, unsigned int timestamp, kgsl_event_func func, void *priv); void kgsl_process_events(struct work_struct *work); static inline struct kgsl_device_platform_data * kgsl_device_get_drvdata(struct kgsl_device *dev) { struct platform_device *pdev = container_of(dev->parentdev, struct platform_device, dev); return pdev->dev.platform_data; } void kgsl_context_destroy(struct kref *kref); int kgsl_context_init(struct kgsl_device_private *, struct kgsl_context Loading Loading @@ -795,10 +786,7 @@ static inline void kgsl_cmdbatch_put(struct kgsl_cmdbatch *cmdbatch) static inline int kgsl_property_read_u32(struct kgsl_device *device, const char *prop, unsigned int *ptr) { struct platform_device *pdev = container_of(device->parentdev, struct platform_device, dev); return of_property_read_u32(pdev->dev.of_node, prop, ptr); return of_property_read_u32(device->pdev->dev.of_node, prop, ptr); } /** Loading drivers/gpu/msm/kgsl_iommu.c +12 −17 Original line number Diff line number Diff line Loading @@ -1132,26 +1132,24 @@ static unsigned int kgsl_iommu_sync_unlock(struct kgsl_mmu *mmu, */ static int kgsl_get_iommu_ctxt(struct kgsl_mmu *mmu) { struct platform_device *pdev = container_of(mmu->device->parentdev, struct platform_device, dev); struct kgsl_device_platform_data *pdata_dev = pdev->dev.platform_data; struct kgsl_device_platform_data *pdata = dev_get_platdata(&mmu->device->pdev->dev); struct kgsl_iommu *iommu = mmu->device->mmu.priv; int i, ret = 0; /* Go through the IOMMU data and get all the context devices */ if (KGSL_IOMMU_MAX_UNITS < pdata_dev->iommu_count) { if (KGSL_IOMMU_MAX_UNITS < pdata->iommu_count) { KGSL_CORE_ERR("Too many IOMMU units defined\n"); ret = -EINVAL; goto done; } for (i = 0; i < pdata_dev->iommu_count; i++) { ret = _get_iommu_ctxs(mmu, &pdata_dev->iommu_data[i], i); for (i = 0; i < pdata->iommu_count; i++) { ret = _get_iommu_ctxs(mmu, &pdata->iommu_data[i], i); if (ret) break; } iommu->unit_count = pdata_dev->iommu_count; iommu->unit_count = pdata->iommu_count; done: return ret; } Loading @@ -1165,16 +1163,14 @@ done: */ static int kgsl_set_register_map(struct kgsl_mmu *mmu) { struct platform_device *pdev = container_of(mmu->device->parentdev, struct platform_device, dev); struct kgsl_device_platform_data *pdata_dev = pdev->dev.platform_data; struct kgsl_device_platform_data *pdata = dev_get_platdata(&mmu->device->pdev->dev); struct kgsl_iommu *iommu = mmu->device->mmu.priv; struct kgsl_iommu_unit *iommu_unit; int i = 0, ret = 0; for (; i < pdata_dev->iommu_count; i++) { struct kgsl_device_iommu_data data = pdata_dev->iommu_data[i]; for (; i < pdata->iommu_count; i++) { struct kgsl_device_iommu_data data = pdata->iommu_data[i]; iommu_unit = &iommu->iommu_units[i]; /* set up the IOMMU register map for the given IOMMU unit */ if (!data.physstart || !data.physend) { Loading Loading @@ -1212,7 +1208,7 @@ static int kgsl_set_register_map(struct kgsl_mmu *mmu) iommu_unit->ahb_base = data.physstart - mmu->device->reg_phys; } iommu->unit_count = pdata_dev->iommu_count; iommu->unit_count = pdata->iommu_count; return ret; err: /* Unmap any mapped IOMMU regions */ Loading Loading @@ -1327,8 +1323,7 @@ static int kgsl_iommu_init(struct kgsl_mmu *mmu) */ int status = 0; struct kgsl_iommu *iommu; struct platform_device *pdev = container_of(mmu->device->parentdev, struct platform_device, dev); struct platform_device *pdev = mmu->device->pdev; atomic_set(&mmu->fault, 0); iommu = kzalloc(sizeof(struct kgsl_iommu), GFP_KERNEL); Loading Loading
drivers/gpu/msm/adreno.c +5 −5 Original line number Diff line number Diff line Loading @@ -1199,7 +1199,7 @@ adreno_identify_gpu(struct adreno_device *adreno_dev) { const struct adreno_reg_offsets *reg_offsets; struct kgsl_device_platform_data *pdata = kgsl_device_get_drvdata(&adreno_dev->dev); dev_get_platdata(&(adreno_dev->dev.pdev->dev)); struct adreno_gpudev *gpudev; int i; Loading Loading @@ -1547,17 +1547,17 @@ int adreno_probe(struct platform_device *pdev) } device = &adreno_dev->dev; device->parentdev = &pdev->dev; device->pdev = pdev; status = adreno_of_get_pdata(pdev); if (status) { device->parentdev = NULL; device->pdev = NULL; return status; } status = kgsl_device_platform_probe(device); if (status) { device->parentdev = NULL; device->pdev = NULL; return status; } Loading Loading @@ -1590,7 +1590,7 @@ out: if (status) { adreno_ringbuffer_close(&adreno_dev->ringbuffer); kgsl_device_platform_remove(device); device->parentdev = NULL; device->pdev = NULL; } return status; Loading
drivers/gpu/msm/adreno_coresight.c +3 −3 Original line number Diff line number Diff line Loading @@ -281,7 +281,7 @@ static const struct coresight_ops adreno_coresight_ops = { void adreno_coresight_remove(struct kgsl_device *device) { struct kgsl_device_platform_data *pdata = device->parentdev->platform_data; dev_get_platdata(&device->pdev->dev); coresight_unregister(pdata->csdev); pdata->csdev = NULL; Loading @@ -293,7 +293,7 @@ int adreno_coresight_init(struct kgsl_device *device) struct adreno_device *adreno_dev = ADRENO_DEVICE(device); struct adreno_gpudev *gpudev = ADRENO_GPU_DEVICE(adreno_dev); struct kgsl_device_platform_data *pdata = device->parentdev->platform_data; dev_get_platdata(&device->pdev->dev); struct coresight_desc desc; if (pdata == NULL) Loading @@ -314,7 +314,7 @@ int adreno_coresight_init(struct kgsl_device *device) desc.subtype.source_subtype = CORESIGHT_DEV_SUBTYPE_SOURCE_BUS; desc.ops = &adreno_coresight_ops; desc.pdata = pdata->coresight_pdata; desc.dev = device->parentdev; desc.dev = &device->pdev->dev; desc.owner = THIS_MODULE; desc.groups = gpudev->coresight->groups; Loading
drivers/gpu/msm/kgsl.c +10 −12 Original line number Diff line number Diff line Loading @@ -935,7 +935,7 @@ static int kgsl_release(struct inode *inodep, struct file *filep) kgsl_process_private_put(private); pm_runtime_put(device->parentdev); pm_runtime_put(&device->pdev->dev); return result; } Loading Loading @@ -990,7 +990,7 @@ static int kgsl_open(struct inode *inodep, struct file *filep) return -EBUSY; } result = pm_runtime_get_sync(device->parentdev); result = pm_runtime_get_sync(&device->pdev->dev); if (result < 0) { KGSL_DRV_ERR(device, "Runtime PM: Unable to wake up the device, rc = %d\n", Loading Loading @@ -1044,7 +1044,7 @@ err_freedevpriv: filep->private_data = NULL; kfree(dev_priv); err_pmruntime: pm_runtime_put(device->parentdev); pm_runtime_put(&device->pdev->dev); return result; } Loading Loading @@ -4113,7 +4113,7 @@ static int _register_device(struct kgsl_device *device) /* Create the device */ dev = MKDEV(MAJOR(kgsl_driver.major), minor); device->dev = device_create(kgsl_driver.class, device->parentdev, &device->pdev->dev, dev, device, device->name); Loading @@ -4126,7 +4126,7 @@ static int _register_device(struct kgsl_device *device) return ret; } dev_set_drvdata(device->parentdev, device); dev_set_drvdata(&device->pdev->dev, device); return 0; } Loading @@ -4135,8 +4135,6 @@ int kgsl_device_platform_probe(struct kgsl_device *device) int result; int status = -EINVAL; struct resource *res; struct platform_device *pdev = container_of(device->parentdev, struct platform_device, dev); status = _register_device(device); if (status) Loading @@ -4150,7 +4148,7 @@ int kgsl_device_platform_probe(struct kgsl_device *device) goto error; /* Get starting physical address of device registers */ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, res = platform_get_resource_byname(device->pdev, IORESOURCE_MEM, device->iomemname); if (res == NULL) { KGSL_DRV_ERR(device, "platform_get_resource_byname failed\n"); Loading @@ -4173,7 +4171,7 @@ int kgsl_device_platform_probe(struct kgsl_device *device) * and shader memory length */ if (device->shadermemname != NULL) { res = platform_get_resource_byname(pdev, IORESOURCE_MEM, res = platform_get_resource_byname(device->pdev, IORESOURCE_MEM, device->shadermemname); if (res == NULL) { Loading Loading @@ -4211,7 +4209,7 @@ int kgsl_device_platform_probe(struct kgsl_device *device) } /*acquire interrupt */ device->pwrctrl.interrupt_num = platform_get_irq_byname(pdev, device->pwrctrl.irq_name); platform_get_irq_byname(device->pdev, device->pwrctrl.irq_name); if (device->pwrctrl.interrupt_num <= 0) { KGSL_DRV_ERR(device, "platform_get_irq_byname failed: %d\n", Loading @@ -4237,7 +4235,7 @@ int kgsl_device_platform_probe(struct kgsl_device *device) rwlock_init(&device->context_lock); result = kgsl_drm_init(pdev); result = kgsl_drm_init(device->pdev); if (result) goto error_pwrctrl_close; Loading @@ -4254,7 +4252,7 @@ int kgsl_device_platform_probe(struct kgsl_device *device) } /* Check to see if our device can perform DMA correctly */ status = dma_set_coherent_mask(&pdev->dev, KGSL_DMA_BIT_MASK); status = dma_set_coherent_mask(&device->pdev->dev, KGSL_DMA_BIT_MASK); if (status) goto error_close_mmu; Loading
drivers/gpu/msm/kgsl_device.h +2 −14 Original line number Diff line number Diff line Loading @@ -331,7 +331,7 @@ struct kgsl_device { wait_queue_head_t wait_queue; wait_queue_head_t active_cnt_wq; struct workqueue_struct *work_queue; struct device *parentdev; struct platform_device *pdev; struct dentry *d_debugfs; struct idr context_idr; rwlock_t context_lock; Loading Loading @@ -621,15 +621,6 @@ int kgsl_add_event(struct kgsl_device *device, struct kgsl_event_group *group, unsigned int timestamp, kgsl_event_func func, void *priv); void kgsl_process_events(struct work_struct *work); static inline struct kgsl_device_platform_data * kgsl_device_get_drvdata(struct kgsl_device *dev) { struct platform_device *pdev = container_of(dev->parentdev, struct platform_device, dev); return pdev->dev.platform_data; } void kgsl_context_destroy(struct kref *kref); int kgsl_context_init(struct kgsl_device_private *, struct kgsl_context Loading Loading @@ -795,10 +786,7 @@ static inline void kgsl_cmdbatch_put(struct kgsl_cmdbatch *cmdbatch) static inline int kgsl_property_read_u32(struct kgsl_device *device, const char *prop, unsigned int *ptr) { struct platform_device *pdev = container_of(device->parentdev, struct platform_device, dev); return of_property_read_u32(pdev->dev.of_node, prop, ptr); return of_property_read_u32(device->pdev->dev.of_node, prop, ptr); } /** Loading
drivers/gpu/msm/kgsl_iommu.c +12 −17 Original line number Diff line number Diff line Loading @@ -1132,26 +1132,24 @@ static unsigned int kgsl_iommu_sync_unlock(struct kgsl_mmu *mmu, */ static int kgsl_get_iommu_ctxt(struct kgsl_mmu *mmu) { struct platform_device *pdev = container_of(mmu->device->parentdev, struct platform_device, dev); struct kgsl_device_platform_data *pdata_dev = pdev->dev.platform_data; struct kgsl_device_platform_data *pdata = dev_get_platdata(&mmu->device->pdev->dev); struct kgsl_iommu *iommu = mmu->device->mmu.priv; int i, ret = 0; /* Go through the IOMMU data and get all the context devices */ if (KGSL_IOMMU_MAX_UNITS < pdata_dev->iommu_count) { if (KGSL_IOMMU_MAX_UNITS < pdata->iommu_count) { KGSL_CORE_ERR("Too many IOMMU units defined\n"); ret = -EINVAL; goto done; } for (i = 0; i < pdata_dev->iommu_count; i++) { ret = _get_iommu_ctxs(mmu, &pdata_dev->iommu_data[i], i); for (i = 0; i < pdata->iommu_count; i++) { ret = _get_iommu_ctxs(mmu, &pdata->iommu_data[i], i); if (ret) break; } iommu->unit_count = pdata_dev->iommu_count; iommu->unit_count = pdata->iommu_count; done: return ret; } Loading @@ -1165,16 +1163,14 @@ done: */ static int kgsl_set_register_map(struct kgsl_mmu *mmu) { struct platform_device *pdev = container_of(mmu->device->parentdev, struct platform_device, dev); struct kgsl_device_platform_data *pdata_dev = pdev->dev.platform_data; struct kgsl_device_platform_data *pdata = dev_get_platdata(&mmu->device->pdev->dev); struct kgsl_iommu *iommu = mmu->device->mmu.priv; struct kgsl_iommu_unit *iommu_unit; int i = 0, ret = 0; for (; i < pdata_dev->iommu_count; i++) { struct kgsl_device_iommu_data data = pdata_dev->iommu_data[i]; for (; i < pdata->iommu_count; i++) { struct kgsl_device_iommu_data data = pdata->iommu_data[i]; iommu_unit = &iommu->iommu_units[i]; /* set up the IOMMU register map for the given IOMMU unit */ if (!data.physstart || !data.physend) { Loading Loading @@ -1212,7 +1208,7 @@ static int kgsl_set_register_map(struct kgsl_mmu *mmu) iommu_unit->ahb_base = data.physstart - mmu->device->reg_phys; } iommu->unit_count = pdata_dev->iommu_count; iommu->unit_count = pdata->iommu_count; return ret; err: /* Unmap any mapped IOMMU regions */ Loading Loading @@ -1327,8 +1323,7 @@ static int kgsl_iommu_init(struct kgsl_mmu *mmu) */ int status = 0; struct kgsl_iommu *iommu; struct platform_device *pdev = container_of(mmu->device->parentdev, struct platform_device, dev); struct platform_device *pdev = mmu->device->pdev; atomic_set(&mmu->fault, 0); iommu = kzalloc(sizeof(struct kgsl_iommu), GFP_KERNEL); Loading