drivers: Modify drivers to use DEVICE_AND_API_INIT()
Modified drivers to use DEVICE_AND_API_INIT() instead of DEVICE_INIT() This will make sure driver_api,is populated at build time and is exposed to user space Signed-off-by: Varun Sharma <varun.sharma@intel.com>
This commit is contained in:
parent
052121ee7c
commit
77c643a5a3
19 changed files with 74 additions and 95 deletions
|
@ -549,8 +549,6 @@ static int gpio_pcal9535a_init(struct device *dev)
|
|||
}
|
||||
drv_data->i2c_master = i2c_master;
|
||||
|
||||
dev->driver_api = &gpio_pcal9535a_drv_api_funcs;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -571,10 +569,11 @@ static struct gpio_pcal9535a_drv_data gpio_pcal9535a_0_drvdata = {
|
|||
};
|
||||
|
||||
/* This has to init after I2C master */
|
||||
DEVICE_INIT(gpio_pcal9535a_0, CONFIG_GPIO_PCAL9535A_0_DEV_NAME,
|
||||
DEVICE_AND_API_INIT(gpio_pcal9535a_0, CONFIG_GPIO_PCAL9535A_0_DEV_NAME,
|
||||
gpio_pcal9535a_init,
|
||||
&gpio_pcal9535a_0_drvdata, &gpio_pcal9535a_0_cfg,
|
||||
POST_KERNEL, CONFIG_GPIO_PCAL9535A_INIT_PRIORITY);
|
||||
POST_KERNEL, CONFIG_GPIO_PCAL9535A_INIT_PRIORITY,
|
||||
&gpio_pcal9535a_drv_api_funcs);
|
||||
|
||||
#endif /* CONFIG_GPIO_PCAL9535A_0 */
|
||||
|
||||
|
@ -595,10 +594,11 @@ static struct gpio_pcal9535a_drv_data gpio_pcal9535a_1_drvdata = {
|
|||
};
|
||||
|
||||
/* This has to init after I2C master */
|
||||
DEVICE_INIT(gpio_pcal9535a_1, CONFIG_GPIO_PCAL9535A_1_DEV_NAME,
|
||||
DEVICE_AND_API_INIT(gpio_pcal9535a_1, CONFIG_GPIO_PCAL9535A_1_DEV_NAME,
|
||||
gpio_pcal9535a_init,
|
||||
&gpio_pcal9535a_1_drvdata, &gpio_pcal9535a_1_cfg,
|
||||
POST_KERNEL, CONFIG_GPIO_PCAL9535A_INIT_PRIORITY);
|
||||
POST_KERNEL, CONFIG_GPIO_PCAL9535A_INIT_PRIORITY,
|
||||
&gpio_pcal9535a_drv_api_funcs);
|
||||
|
||||
#endif /* CONFIG_GPIO_PCAL9535A_1 */
|
||||
|
||||
|
@ -619,10 +619,11 @@ static struct gpio_pcal9535a_drv_data gpio_pcal9535a_2_drvdata = {
|
|||
};
|
||||
|
||||
/* This has to init after I2C master */
|
||||
DEVICE_INIT(gpio_pcal9535a_2, CONFIG_GPIO_PCAL9535A_2_DEV_NAME,
|
||||
DEVICE_AND_API_INIT(gpio_pcal9535a_2, CONFIG_GPIO_PCAL9535A_2_DEV_NAME,
|
||||
gpio_pcal9535a_init,
|
||||
&gpio_pcal9535a_2_drvdata, &gpio_pcal9535a_2_cfg,
|
||||
POST_KERNEL, CONFIG_GPIO_PCAL9535A_INIT_PRIORITY);
|
||||
POST_KERNEL, CONFIG_GPIO_PCAL9535A_INIT_PRIORITY,
|
||||
&gpio_pcal9535a_drv_api_funcs);
|
||||
|
||||
#endif /* CONFIG_GPIO_PCAL9535A_2 */
|
||||
|
||||
|
@ -643,9 +644,10 @@ static struct gpio_pcal9535a_drv_data gpio_pcal9535a_3_drvdata = {
|
|||
};
|
||||
|
||||
/* This has to init after I2C master */
|
||||
DEVICE_INIT(gpio_pcal9535a_3, CONFIG_GPIO_PCAL9535A_3_DEV_NAME,
|
||||
DEVICE_AND_API_INIT(gpio_pcal9535a_3, CONFIG_GPIO_PCAL9535A_3_DEV_NAME,
|
||||
gpio_pcal9535a_init,
|
||||
&gpio_pcal9535a_3_drvdata, &gpio_pcal9535a_3_cfg,
|
||||
POST_KERNEL, CONFIG_GPIO_PCAL9535A_INIT_PRIORITY);
|
||||
POST_KERNEL, CONFIG_GPIO_PCAL9535A_INIT_PRIORITY,
|
||||
&gpio_pcal9535a_drv_api_funcs);
|
||||
|
||||
#endif /* CONFIG_GPIO_PCAL9535A_3 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue