Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gpio: sysfs: rename gpiochip registration functions

Rename the gpio-chip export/unexport functions to the more descriptive
names gpiochip_sysfs_register and gpiochip_sysfs_unregister.

Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Johan Hovold and committed by
Linus Walleij
426577bd 6a4b6b0a

+15 -13
+9 -7
drivers/gpio/gpiolib-sysfs.c
··· 765 765 } 766 766 EXPORT_SYMBOL_GPL(gpiod_unexport); 767 767 768 - int gpiochip_export(struct gpio_chip *chip) 768 + int gpiochip_sysfs_register(struct gpio_chip *chip) 769 769 { 770 770 struct device *dev; 771 771 772 - /* Many systems register gpio chips for SOC support very early, 772 + /* 773 + * Many systems add gpio chips for SOC support very early, 773 774 * before driver model support is available. In those cases we 774 - * export this later, in gpiolib_sysfs_init() ... here we just 775 + * register later, in gpiolib_sysfs_init() ... here we just 775 776 * verify that _some_ field of gpio_class got initialized. 776 777 */ 777 778 if (!gpio_class.p) ··· 792 791 return 0; 793 792 } 794 793 795 - void gpiochip_unexport(struct gpio_chip *chip) 794 + void gpiochip_sysfs_unregister(struct gpio_chip *chip) 796 795 { 797 796 struct gpio_desc *desc; 798 797 unsigned int i; ··· 837 836 continue; 838 837 839 838 /* 840 - * TODO we yield gpio_lock here because gpiochip_export() 841 - * acquires a mutex. This is unsafe and needs to be fixed. 839 + * TODO we yield gpio_lock here because 840 + * gpiochip_sysfs_register() acquires a mutex. This is unsafe 841 + * and needs to be fixed. 842 842 * 843 843 * Also it would be nice to use gpiochip_find() here so we 844 844 * can keep gpio_chips local to gpiolib.c, but the yield of 845 845 * gpio_lock prevents us from doing this. 846 846 */ 847 847 spin_unlock_irqrestore(&gpio_lock, flags); 848 - status = gpiochip_export(chip); 848 + status = gpiochip_sysfs_register(chip); 849 849 spin_lock_irqsave(&gpio_lock, flags); 850 850 } 851 851 spin_unlock_irqrestore(&gpio_lock, flags);
+2 -2
drivers/gpio/gpiolib.c
··· 285 285 of_gpiochip_add(chip); 286 286 acpi_gpiochip_add(chip); 287 287 288 - status = gpiochip_export(chip); 288 + status = gpiochip_sysfs_register(chip); 289 289 if (status) 290 290 goto err_remove_chip; 291 291 ··· 330 330 unsigned id; 331 331 bool requested = false; 332 332 333 - gpiochip_unexport(chip); 333 + gpiochip_sysfs_unregister(chip); 334 334 335 335 gpiochip_irqchip_remove(chip); 336 336
+4 -4
drivers/gpio/gpiolib.h
··· 151 151 152 152 #ifdef CONFIG_GPIO_SYSFS 153 153 154 - int gpiochip_export(struct gpio_chip *chip); 155 - void gpiochip_unexport(struct gpio_chip *chip); 154 + int gpiochip_sysfs_register(struct gpio_chip *chip); 155 + void gpiochip_sysfs_unregister(struct gpio_chip *chip); 156 156 157 157 #else 158 158 159 - static inline int gpiochip_export(struct gpio_chip *chip) 159 + static inline int gpiochip_sysfs_register(struct gpio_chip *chip) 160 160 { 161 161 return 0; 162 162 } 163 163 164 - static inline void gpiochip_unexport(struct gpio_chip *chip) 164 + static inline void gpiochip_sysfs_unregister(struct gpio_chip *chip) 165 165 { 166 166 } 167 167