Hi,
In each IssSensorFxns in sensor driver, there are duplicated code of retrieving IssSensor_CreateParams from void *pSensorHdl.
Let's take AR0820 as an example:
Following code block repeat 7 times in src/ar0820/iss_sensor_ar0820.c
IssSensors_Handle * pSenHandle = (IssSensors_Handle*)pSensorHdl; IssSensor_CreateParams * pCreatePrms; assert(NULL != pSenHandle); pCreatePrms = pSenHandle->createPrms; assert(NULL != pCreatePrms);
But since pSenHandle->createPrms points to static IssSensor_CreateParams ar0820CreatePrms which defined in the same .c file, why not just use ar0820CreatePrms directly?
And BTW, AR0820_Probe() / AR0820_Config()... is not a good name for migrating code, since they are declared static.
It's better to rename them to generic names, such as Sensor_Probe() / Senfor_Config(). Then when you writting a new sensor driver based AR0820, you don't need to rename them by sensor model.