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

sh: pfc: support pinmux deregistration.

Presently the pinmux code is a one-way thing, but there's nothing
preventing an unregistration if no one has grabbed any of the pins.
This will permit us to save a bit of memory on systems that require pin
demux for certain peripherals in the case where registration of those
peripherals fails, or they are otherwise not attached to the system.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>

+11 -1
+10 -1
drivers/sh/pfc.c
··· 7 7 * License. See the file "COPYING" in the main directory of this archive 8 8 * for more details. 9 9 */ 10 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 11 + 10 12 #include <linux/errno.h> 11 13 #include <linux/kernel.h> 12 14 #include <linux/list.h> ··· 583 581 { 584 582 struct gpio_chip *chip = &pip->chip; 585 583 586 - pr_info("sh pinmux: %s handling gpio %d -> %d\n", 584 + pr_info("%s handling gpio %d -> %d\n", 587 585 pip->name, pip->first_gpio, pip->last_gpio); 588 586 589 587 setup_data_regs(pip); ··· 603 601 chip->ngpio = (pip->last_gpio - pip->first_gpio) + 1; 604 602 605 603 return gpiochip_add(chip); 604 + } 605 + 606 + int unregister_pinmux(struct pinmux_info *pip) 607 + { 608 + pr_info("%s deregistering\n", pip->name); 609 + 610 + return gpiochip_remove(&pip->chip); 606 611 }
+1
include/linux/sh_pfc.h
··· 92 92 }; 93 93 94 94 int register_pinmux(struct pinmux_info *pip); 95 + int unregister_pinmux(struct pinmux_info *pip); 95 96 96 97 #endif /* __SH_PFC_H */