#include "../ion_priv.h"
-static struct ion_device *idev;
+struct ion_device *rockchip_ion_dev;
static struct ion_heap **heaps;
struct ion_heap_desc {
int err;
int i;
struct ion_platform_data *pdata = pdev->dev.platform_data;
+ struct ion_device *idev;
if (!pdata) {
pdata = rk_ion_of(pdev->dev.of_node);
return PTR_ERR(idev);
}
+ rockchip_ion_dev = idev;
+
/* create the heaps as specified in the board file */
for (i = 0; i < pdata->nr; i++) {
struct ion_platform_heap *heap_data = &pdata->heaps[i];
struct ion_client *rockchip_ion_client_create(const char *name)
{
- if (!idev) {
+ if (!rockchip_ion_dev) {
pr_err("rockchip ion idev is NULL\n");
return NULL;
}
- return ion_client_create(idev, name);
+ return ion_client_create(rockchip_ion_dev, name);
}
EXPORT_SYMBOL_GPL(rockchip_ion_client_create);
#define ION_IOC_GET_PHYS _IOWR(ION_IOC_ROCKCHIP_MAGIC, 0, \
struct ion_phys_data)
+extern struct ion_device *rockchip_ion_dev;
+
struct ion_client *rockchip_ion_client_create(const char *name);
#endif