This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

davincifb bug in lsp2.10(mv5.0) ?

I found this in function davincifb_init of drivers/video/davincifb.c:

  /* Register the device with LDM */

  if (platform_device_register(&davincifb_device)) {

    dev_err(dev, "failed to register davincifb device\n");   

    return -ENODEV;

  }

  /* Register the driver with LDM */                         

  if (driver_register(&davincifb_driver)) {                  

    dev_err(dev, "failed to register davincifb driver\n");

    platform_device_unregister(&davincifb_device);

    return -ENODEV;

  }

I think it is a bug to call driver_register after platform_device_register because platform_device_register has called driver_register in its tail.

int platform_driver_register(struct platform_driver *drv)     

{                                                             

  drv->driver.bus = &platform_bus_type;                       

  if (drv->probe)                                             

    drv->driver.probe = platform_drv_probe;                   

  if (drv->remove)                                            

    drv->driver.remove = platform_drv_remove;                 

  if (drv->shutdown)                                          

    drv->driver.shutdown = platform_drv_shutdown;             

  if (drv->suspend)                                           

    drv->driver.suspend = platform_drv_suspend;               

  if (drv->resume)                                            

    drv->driver.resume = platform_drv_resume;                 

  return driver_register(&drv->driver);                       

}                                     

The origin code make the davincifb_probe called twice because of the twice registers.

In the second call, davincifb_probe will quit after configuring OSD0 and leave the OSD0 in a wrong configuration.

I suggest to remove the call of driver_register.