Commit e8b536a4 authored by Javier Martinez Canillas's avatar Javier Martinez Canillas Committed by Greg Kroah-Hartman

s5p-mfc: Add release callback for memory region devs

commit 6311f126 upstream.

When s5p_mfc_remove() calls put_device() for the reserved memory region
devs, the driver core warns that the dev doesn't have a release callback:

WARNING: CPU: 0 PID: 591 at drivers/base/core.c:251 device_release+0x8c/0x90
Device 's5p-mfc-l' does not have a release() function, it is broken and must be fixed.

Also, the declared DMA memory using dma_declare_coherent_memory() isn't
relased so add a dev .release that calls dma_release_declared_memory().

Fixes: 6e83e6e2 ("[media] s5p-mfc: Fix kernel warning on memory init")
Signed-off-by: default avatarJavier Martinez Canillas <javier@osg.samsung.com>
Tested-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 822a4660
...@@ -1004,6 +1004,11 @@ static int match_child(struct device *dev, void *data) ...@@ -1004,6 +1004,11 @@ static int match_child(struct device *dev, void *data)
return !strcmp(dev_name(dev), (char *)data); return !strcmp(dev_name(dev), (char *)data);
} }
static void s5p_mfc_memdev_release(struct device *dev)
{
dma_release_declared_memory(dev);
}
static void *mfc_get_drv_data(struct platform_device *pdev); static void *mfc_get_drv_data(struct platform_device *pdev);
static int s5p_mfc_alloc_memdevs(struct s5p_mfc_dev *dev) static int s5p_mfc_alloc_memdevs(struct s5p_mfc_dev *dev)
...@@ -1018,6 +1023,7 @@ static int s5p_mfc_alloc_memdevs(struct s5p_mfc_dev *dev) ...@@ -1018,6 +1023,7 @@ static int s5p_mfc_alloc_memdevs(struct s5p_mfc_dev *dev)
} }
dev_set_name(dev->mem_dev_l, "%s", "s5p-mfc-l"); dev_set_name(dev->mem_dev_l, "%s", "s5p-mfc-l");
dev->mem_dev_l->release = s5p_mfc_memdev_release;
device_initialize(dev->mem_dev_l); device_initialize(dev->mem_dev_l);
of_property_read_u32_array(dev->plat_dev->dev.of_node, of_property_read_u32_array(dev->plat_dev->dev.of_node,
"samsung,mfc-l", mem_info, 2); "samsung,mfc-l", mem_info, 2);
...@@ -1037,6 +1043,7 @@ static int s5p_mfc_alloc_memdevs(struct s5p_mfc_dev *dev) ...@@ -1037,6 +1043,7 @@ static int s5p_mfc_alloc_memdevs(struct s5p_mfc_dev *dev)
} }
dev_set_name(dev->mem_dev_r, "%s", "s5p-mfc-r"); dev_set_name(dev->mem_dev_r, "%s", "s5p-mfc-r");
dev->mem_dev_r->release = s5p_mfc_memdev_release;
device_initialize(dev->mem_dev_r); device_initialize(dev->mem_dev_r);
of_property_read_u32_array(dev->plat_dev->dev.of_node, of_property_read_u32_array(dev->plat_dev->dev.of_node,
"samsung,mfc-r", mem_info, 2); "samsung,mfc-r", mem_info, 2);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment