Browse Source

qcacmn: Use appropriate dev handle in OS wrappers

The device handles used in OS wrappers should be of
the desired type.

Change-Id: I6a72c578492662e7c3907c844d9307fc0dc98e53
CRs-Fixed: 2299595
Debasis Das 6 years ago
parent
commit
e6feafc106
3 changed files with 8 additions and 9 deletions
  1. 1 3
      qal/linux/src/qal_vbus_dev.c
  2. 3 2
      qdf/inc/qdf_dev.h
  3. 4 4
      qdf/linux/src/qdf_dev.c

+ 1 - 3
qal/linux/src/qal_vbus_dev.c

@@ -92,14 +92,12 @@ QDF_STATUS
 qal_vbus_get_dev_rstctl(struct qdf_pfm_hndl *pfhndl, const char *state,
 			struct qdf_vbus_rstctl **rstctl)
 {
-	struct platform_device *pfdev;
 	struct reset_control *rsctl;
 
 	if (!pfhndl || !state)
 		return QDF_STATUS_E_INVAL;
 
-	pfdev = (struct platform_device *)pfhndl;
-	rsctl = reset_control_get(&pfdev->dev, state);
+	rsctl = reset_control_get((struct device *)pfhndl, state);
 
 	if (!rsctl)
 		return QDF_STATUS_E_FAILURE;

+ 3 - 2
qdf/inc/qdf_dev.h

@@ -29,6 +29,7 @@
 
 struct qdf_cpu_mask;
 struct qdf_devm;
+struct qdf_dev;
 
 /**
  * qdf_dev_alloc_mem() - allocate memory
@@ -42,7 +43,7 @@ struct qdf_devm;
  * Return: QDF_STATUS_SUCCESS on success
  */
 QDF_STATUS
-qdf_dev_alloc_mem(qdf_device_t qdfdev, struct qdf_devm **mrptr,
+qdf_dev_alloc_mem(struct qdf_dev *qdfdev, struct qdf_devm **mrptr,
 		  uint32_t reqsize, uint32_t mask);
 
 /**
@@ -55,7 +56,7 @@ qdf_dev_alloc_mem(qdf_device_t qdfdev, struct qdf_devm **mrptr,
  * Return: QDF_STATUS_SUCCESS on success
  */
 QDF_STATUS
-qdf_dev_release_mem(qdf_device_t qdfdev, struct qdf_devm *mrptr);
+qdf_dev_release_mem(struct qdf_dev *qdfdev, struct qdf_devm *mrptr);
 
 /**
  * qdf_dev_modify_irq() - modify irq

+ 4 - 4
qdf/linux/src/qdf_dev.c

@@ -28,7 +28,7 @@
 #include <linux/irq.h>
 
 QDF_STATUS
-qdf_dev_alloc_mem(qdf_device_t qdfdev, struct qdf_devm **mrptr,
+qdf_dev_alloc_mem(struct qdf_dev *qdfdev, struct qdf_devm **mrptr,
 		  uint32_t reqsize, uint32_t mask)
 {
 	struct qdf_devm *mptr;
@@ -36,7 +36,7 @@ qdf_dev_alloc_mem(qdf_device_t qdfdev, struct qdf_devm **mrptr,
 	if (!qdfdev)
 		return QDF_STATUS_E_INVAL;
 
-	mptr = devm_kzalloc(qdfdev->dev, reqsize, mask);
+	mptr = devm_kzalloc((struct device *)qdfdev, reqsize, mask);
 
 	if (!mrptr)
 		return QDF_STATUS_E_NOMEM;
@@ -49,12 +49,12 @@ qdf_dev_alloc_mem(qdf_device_t qdfdev, struct qdf_devm **mrptr,
 qdf_export_symbol(qdf_dev_alloc_mem);
 
 QDF_STATUS
-qdf_dev_release_mem(qdf_device_t qdfdev, struct qdf_devm *mrptr)
+qdf_dev_release_mem(struct qdf_dev *qdfdev, struct qdf_devm *mrptr)
 {
 	if (!mrptr)
 		return QDF_STATUS_E_INVAL;
 
-	devm_kfree(qdfdev->dev, mrptr);
+	devm_kfree((struct device *)qdfdev, mrptr);
 
 	return QDF_STATUS_SUCCESS;
 }