drivers/gpio/gpio_pcal9535a.c
/**
 * @brief Initialization function of PCAL9535A
 *
 * @param dev Device struct
 * @return 0 if successful, failed otherwise.
 */
@brief Initialization function of PCAL9535A
@param dev Device struct
@return 0 if successful, failed otherwise.
@brief Initialization function of PCAL9535A @param dev Device struct @return 0 if successful failed otherwise .
static int gpio_pcal9535a_init(struct device *dev)
{
	const struct gpio_pcal9535a_config * const config =
		dev->config->config_info;
	struct gpio_pcal9535a_drv_data * const drv_data =
		(struct gpio_pcal9535a_drv_data * const)dev->driver_data;
	struct device *i2c_master;
	i2c_master = device_get_binding((char *)config->i2c_master_dev_name);
	if (!i2c_master) {
		return -EINVAL;
	}
	drv_data->i2c_master = i2c_master;
	dev->driver_api = &gpio_pcal9535a_drv_api_funcs;
	return 0;
}
static int gpio_pcal9535a_init ( struct device * dev ) { const struct gpio_pcal9535a_config * const config = dev -> config -> config_info ; struct gpio_pcal9535a_drv_data * const drv_data = ( struct gpio_pcal9535a_drv_data * const ) dev -> driver_data ; struct device * i2c_master ; i2c_master = device_get_binding ( ( char * ) config -> i2c_master_dev_name ) ; if ( ! i2c_master ) { return - EINVAL ; } drv_data -> i2c_master = i2c_master ; dev -> driver_api = & gpio_pcal9535a_drv_api_funcs ; return 0 ; }
@brief Initialization function of PCAL9535A
 @param dev Device struct
 @return 0 if successful, failed otherwise.
@brief Initialization function of PCAL9535A @param dev Device struct @return 0 if successful failed otherwise .
/* Find out the device struct of the I2C master */