devices/ccat/gpio.c
branchstable-1.5
changeset 2638 5995331a55fe
parent 2636 0613017547fe
equal deleted inserted replaced
2637:1d9be5716dee 2638:5995331a55fe
   142 	ret = gpiochip_add(&gpio->chip);
   142 	ret = gpiochip_add(&gpio->chip);
   143 	if (ret) {
   143 	if (ret) {
   144 		kfree(gpio);
   144 		kfree(gpio);
   145 		return ret;
   145 		return ret;
   146 	}
   146 	}
   147 	pr_info("registered %s as gpio chip with #%d GPIOs.\n",
   147 	pr_info("registered %s as gpiochip%d with #%d GPIOs.\n",
   148 		gpio->chip.label, gpio->chip.ngpio);
   148 		gpio->chip.label, gpio->chip.base, gpio->chip.ngpio);
   149 	func->private_data = gpio;
   149 	func->private_data = gpio;
   150 	return 0;
   150 	return 0;
   151 }
   151 }
   152 
   152 
   153 static void ccat_gpio_remove(struct ccat_function *func)
   153 static void ccat_gpio_remove(struct ccat_function *func)
   155 	struct ccat_gpio *const gpio = func->private_data;
   155 	struct ccat_gpio *const gpio = func->private_data;
   156 
   156 
   157 	gpiochip_remove(&gpio->chip);
   157 	gpiochip_remove(&gpio->chip);
   158 };
   158 };
   159 
   159 
   160 struct ccat_driver gpio_driver = {
   160 const struct ccat_driver gpio_driver = {
   161 	.type = CCATINFO_GPIO,
   161 	.type = CCATINFO_GPIO,
   162 	.probe = ccat_gpio_probe,
   162 	.probe = ccat_gpio_probe,
   163 	.remove = ccat_gpio_remove,
   163 	.remove = ccat_gpio_remove,
   164 };
   164 };