Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9e014344 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: kgsl: Replace device->parentdev with device->pdev"

parents f5b1e9be 7cec10a1
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -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;

@@ -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;
	}

@@ -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;
+3 −3
Original line number Diff line number Diff line
@@ -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;
@@ -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)
@@ -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;

+10 −12
Original line number Diff line number Diff line
@@ -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;
}

@@ -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",
@@ -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;
}

@@ -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);

@@ -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;
}

@@ -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)
@@ -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");
@@ -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) {
@@ -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",
@@ -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;

@@ -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;

+2 −14
Original line number Diff line number Diff line
@@ -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;
@@ -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
@@ -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);
}

/**
+12 −17
Original line number Diff line number Diff line
@@ -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;
}
@@ -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) {
@@ -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 */
@@ -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