gpio/pcal_9535a: move driver_api assignment later
This moves the assignment of driver_api to just before the init function returns. This is in preparation to make device_get_binding() return NULL if driver initialization fails. Change-Id: Ibf08cb107885da7c1037c6e7d207530e1a4708f8 Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
parent
aa98192cad
commit
b8e887a112
1 changed files with 2 additions and 2 deletions
|
@ -567,8 +567,6 @@ int gpio_pcal9535a_init(struct device *dev)
|
|||
(struct gpio_pcal9535a_drv_data * const)dev->driver_data;
|
||||
struct device *i2c_master;
|
||||
|
||||
dev->driver_api = &gpio_pcal9535a_drv_api_funcs;
|
||||
|
||||
/* Find out the device struct of the I2C master */
|
||||
i2c_master = device_get_binding((char *)config->i2c_master_dev_name);
|
||||
if (!i2c_master) {
|
||||
|
@ -578,6 +576,8 @@ int gpio_pcal9535a_init(struct device *dev)
|
|||
|
||||
nano_timer_init(&drv_data->timer, (void *) 0);
|
||||
|
||||
dev->driver_api = &gpio_pcal9535a_drv_api_funcs;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue