[PATCH] gpu: drm: tilcdc: make of_device_ids const.
Arvind Yadav
arvind.yadav.cs at gmail.com
Mon Jun 19 07:14:05 UTC 2017
of_device_ids are not supposed to change at runtime. All functions
working with of_device_ids provided by <linux/of.h> work with const
of_device_ids. So mark the non-const structs as const.
File size before:
text data bss dec hex filename
4805 1408 0 6213 1845 drivers/gpu/drm/tilcdc/tilcdc_drv.o
File size after constify tilcdc_of_match.
text data bss dec hex filename
5445 800 0 6245 1865 drivers/gpu/drm/tilcdc/tilcdc_drv.o
Signed-off-by: Arvind Yadav <arvind.yadav.cs at gmail.com>
---
drivers/gpu/drm/tilcdc/tilcdc_drv.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
index d7ae5be..3672666 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
@@ -61,8 +61,6 @@ void tilcdc_module_cleanup(struct tilcdc_module *mod)
list_del(&mod->list);
}
-static struct of_device_id tilcdc_of_match[];
-
static struct drm_framebuffer *tilcdc_fb_create(struct drm_device *dev,
struct drm_file *file_priv, const struct drm_mode_fb_cmd2 *mode_cmd)
{
@@ -661,7 +659,7 @@ static int tilcdc_pdev_remove(struct platform_device *pdev)
return 0;
}
-static struct of_device_id tilcdc_of_match[] = {
+static const struct of_device_id tilcdc_of_match[] = {
{ .compatible = "ti,am33xx-tilcdc", },
{ .compatible = "ti,da850-tilcdc", },
{ },
--
1.9.1
More information about the dri-devel
mailing list