mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-16 01:04:08 +08:00
pinctrl: Re-order pinmux.[ch] to match each-other
Modify the two files so that the order of function prototypes in the header matches the order of implementations in the .c file. Signed-off-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
b2b3e66e40
commit
03665e0f24
@ -40,6 +40,34 @@ struct pinmux_group {
|
||||
unsigned group_selector;
|
||||
};
|
||||
|
||||
int pinmux_check_ops(struct pinctrl_dev *pctldev)
|
||||
{
|
||||
const struct pinmux_ops *ops = pctldev->desc->pmxops;
|
||||
unsigned selector = 0;
|
||||
|
||||
/* Check that we implement required operations */
|
||||
if (!ops->list_functions ||
|
||||
!ops->get_function_name ||
|
||||
!ops->get_function_groups ||
|
||||
!ops->enable ||
|
||||
!ops->disable)
|
||||
return -EINVAL;
|
||||
|
||||
/* Check that all functions registered have names */
|
||||
while (ops->list_functions(pctldev, selector) >= 0) {
|
||||
const char *fname = ops->get_function_name(pctldev,
|
||||
selector);
|
||||
if (!fname) {
|
||||
pr_err("pinmux ops has no name for function%u\n",
|
||||
selector);
|
||||
return -EINVAL;
|
||||
}
|
||||
selector++;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* pin_request() - request a single pin to be muxed in, typically for GPIO
|
||||
* @pin: the pin number in the global pin space
|
||||
@ -561,34 +589,6 @@ void pinmux_disable(struct pinctrl *p)
|
||||
}
|
||||
}
|
||||
|
||||
int pinmux_check_ops(struct pinctrl_dev *pctldev)
|
||||
{
|
||||
const struct pinmux_ops *ops = pctldev->desc->pmxops;
|
||||
unsigned selector = 0;
|
||||
|
||||
/* Check that we implement required operations */
|
||||
if (!ops->list_functions ||
|
||||
!ops->get_function_name ||
|
||||
!ops->get_function_groups ||
|
||||
!ops->enable ||
|
||||
!ops->disable)
|
||||
return -EINVAL;
|
||||
|
||||
/* Check that all functions registered have names */
|
||||
while (ops->list_functions(pctldev, selector) >= 0) {
|
||||
const char *fname = ops->get_function_name(pctldev,
|
||||
selector);
|
||||
if (!fname) {
|
||||
pr_err("pinmux ops has no name for function%u\n",
|
||||
selector);
|
||||
return -EINVAL;
|
||||
}
|
||||
selector++;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
|
||||
/* Called from pincontrol core */
|
||||
|
@ -13,8 +13,6 @@
|
||||
#ifdef CONFIG_PINMUX
|
||||
|
||||
int pinmux_check_ops(struct pinctrl_dev *pctldev);
|
||||
void pinmux_init_device_debugfs(struct dentry *devroot,
|
||||
struct pinctrl_dev *pctldev);
|
||||
int pinmux_request_gpio(struct pinctrl_dev *pctldev,
|
||||
struct pinctrl_gpio_range *range,
|
||||
unsigned pin, unsigned gpio);
|
||||
@ -36,6 +34,8 @@ int pinmux_apply_muxmap(struct pinctrl_dev *pctldev,
|
||||
void pinmux_put(struct pinctrl *p);
|
||||
int pinmux_enable(struct pinctrl *p);
|
||||
void pinmux_disable(struct pinctrl *p);
|
||||
void pinmux_init_device_debugfs(struct dentry *devroot,
|
||||
struct pinctrl_dev *pctldev);
|
||||
void pinmux_dbg_show(struct seq_file *s, struct pinctrl *p);
|
||||
|
||||
#else
|
||||
@ -45,11 +45,6 @@ static inline int pinmux_check_ops(struct pinctrl_dev *pctldev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void pinmux_init_device_debugfs(struct dentry *devroot,
|
||||
struct pinctrl_dev *pctldev)
|
||||
{
|
||||
}
|
||||
|
||||
static inline int pinmux_request_gpio(struct pinctrl_dev *pctldev,
|
||||
struct pinctrl_gpio_range *range,
|
||||
unsigned pin, unsigned gpio)
|
||||
@ -95,7 +90,12 @@ static inline void pinmux_disable(struct pinctrl *p)
|
||||
{
|
||||
}
|
||||
|
||||
void pinmux_dbg_show(struct seq_file *s, struct pinctrl *p)
|
||||
static inline void pinmux_init_device_debugfs(struct dentry *devroot,
|
||||
struct pinctrl_dev *pctldev)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void pinmux_dbg_show(struct seq_file *s, struct pinctrl *p)
|
||||
{
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user