camera: rockchip: camsys driver v0.0x21.8
authordalong.zhang <dalon.zhang@rock-chips.com>
Mon, 5 Dec 2016 10:10:09 +0000 (18:10 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Tue, 6 Dec 2016 12:09:32 +0000 (20:09 +0800)
Change-Id: Ib0fed5df3edfe4dae042999e71c50d67a490f88e
Signed-off-by: dalong.zhang <dalon.zhang@rock-chips.com>
drivers/media/video/rk_camsys/camsys_drv.c
drivers/media/video/rk_camsys/camsys_internal.h
drivers/media/video/rk_camsys/ext_flashled_drv/leds-rt8547.c [changed mode: 0755->0644]
drivers/media/video/rk_camsys/ext_flashled_drv/rk_ext_fshled_ctl.c [changed mode: 0755->0644]

index 679217b00cec6fe55290160966578fecc52d8895..e0df6bf7b04fd934e2c4a3552786ea76237bd5ab 100755 (executable)
@@ -1647,6 +1647,7 @@ static int  camsys_platform_remove(struct platform_device *pdev)
 
 static const struct of_device_id cif_of_match[] = {
        { .compatible = "rockchip,isp" },
+       { /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, cif_of_match);
 
index d766990b150508708d904c9aada9d87d08897907..4b73fddad5ca0cf67286eb6f171f9dbd85864a49 100644 (file)
                1) support drm iommu.
 *v0.0x21.7:
 *       1) remove memset function wrong called code.
+*v0.0x21.8:
+*       1) flash module exist risk, fix up it.
 */
-#define CAMSYS_DRIVER_VERSION                   KERNEL_VERSION(0, 0x21, 7)
+#define CAMSYS_DRIVER_VERSION                   KERNEL_VERSION(0, 0x21, 8)
 
 #define CAMSYS_PLATFORM_DRV_NAME                "RockChip-CamSys"
 #define CAMSYS_PLATFORM_MARVIN_NAME             "Platform_MarvinDev"
old mode 100755 (executable)
new mode 100644 (file)
index 84d1618..770db3c
@@ -36,6 +36,7 @@ struct rt8547_chip {
        spinlock_t io_lock;
        unsigned char suspend:1;
        int in_use_mode;
+       struct platform_device rt_fled_pdev;
 #ifdef CONFIG_DEBUG_FS
        struct flashlight_device *fled_dev;
        unsigned char reg_addr;
@@ -776,10 +777,9 @@ static void rt8547_reg_init(struct rt8547_chip *chip)
                         rt8547_reg_initval[RT8547_FLED_REG3 - 1]);
 }
 
-static struct platform_device rt_fled_pdev = {
-       .name = "rt-flash-led",
-       .id = -1,
-};
+static void rt8547_release(struct device *dev)
+{
+}
 
 static int rt8547_led_probe(struct platform_device *pdev)
 {
@@ -818,8 +818,11 @@ static int rt8547_led_probe(struct platform_device *pdev)
 
        chip->base.hal = &rt8547_fled_hal;
        chip->base.init_props = &rt8547_fled_props;
-       rt_fled_pdev.dev.parent = &pdev->dev;
-       ret = platform_device_register(&rt_fled_pdev);
+       chip->rt_fled_pdev.dev.parent = &pdev->dev;
+       chip->rt_fled_pdev.dev.release = rt8547_release;
+       chip->rt_fled_pdev.name = "rt-flash-led";
+       chip->rt_fled_pdev.id = -1;
+       ret = platform_device_register(&chip->rt_fled_pdev);
        if (ret < 0) {
                dev_err(&pdev->dev, "register rtfled fail\n");
                goto err_io;
@@ -844,7 +847,7 @@ static int rt8547_led_remove(struct platform_device *pdev)
 #ifdef CONFIG_DEBUG_FS
        rt8547_remove_debugfs();
 #endif /* #ifdef CONFIG_DEBUG_FS */
-       platform_device_unregister(&rt_fled_pdev);
+       platform_device_unregister(&chip->rt_fled_pdev);
        rt8547_io_deinit(chip->pdata);
        return 0;
 }
old mode 100755 (executable)
new mode 100644 (file)
index 1f1cb06..c7fef6e
@@ -42,6 +42,11 @@ int camsys_deinit_ext_fsh_module()
     INIT_LIST_HEAD(&g_ext_fsh_devs.dev_list);
     return 0;
 }
+
+static void camsys_ext_fsh_release(struct device *dev)
+{
+}
+
 void* camsys_register_ext_fsh_dev(camsys_flash_info_t *fsh_info)
 {
     ext_fsh_info_t* new_dev = NULL;
@@ -53,7 +58,7 @@ void* camsys_register_ext_fsh_dev(camsys_flash_info_t *fsh_info)
             goto fail0;
         }
         
-        new_rt_dev = kzalloc(sizeof(ext_fsh_info_t),GFP_KERNEL);
+               new_rt_dev = kzalloc(sizeof(*new_rt_dev), GFP_KERNEL);
         if(!new_rt_dev){
             camsys_err("register new ext flash dev erro !");
             goto fail1;
@@ -61,6 +66,7 @@ void* camsys_register_ext_fsh_dev(camsys_flash_info_t *fsh_info)
 
         new_dev->pdev.id = -1;
         new_dev->pdev.name = fsh_info->fl_drv_name;
+               new_dev->pdev.dev.release = camsys_ext_fsh_release;
         new_dev->pdev.dev.platform_data = (void*)new_rt_dev;
         new_dev->dev_model = "rt-flash-led";
 
@@ -107,6 +113,7 @@ int camsys_deregister_ext_fsh_dev(void* dev)
                /* free after unregister device ?*/
                kfree(cur_fsh_info->pdev.dev.platform_data);
                kfree(cur_fsh_info);
+                               return 0;
             }
         }
     }