Message ID | 20220915021320.80364-3-jay.xu@rock-chips.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | gpio: rockchip: support acpi | expand |
On Thu, Sep 15, 2022 at 4:13 AM Jianqun Xu <jay.xu@rock-chips.com> wrote: > Export get_pinctrl_dev_from_devname() as GPL and add to pinctrl head file. > > Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com> > --- > drivers/pinctrl/core.c | 1 + > include/linux/pinctrl/pinctrl.h | 1 + If you add it to <linux/pinctrl/pinctrl.h> you need to remove it from drivers/pinctrl/core.h. I suggest you just include the local header instead. #include "../pinctrl/pinctrl.h" Maybe not the most elegant but it keeps the interface private to pinctrl and GPIO and not broadcast to the entire kernel. If it looks very ugly, well then it is probably because this driver should move into drivers/pinctrl. Yours, Linus Walleij
Hi walleij -------------- jay.xu@rock-chips.com >On Thu, Sep 15, 2022 at 4:13 AM Jianqun Xu <jay.xu@rock-chips.com> wrote: > >> Export get_pinctrl_dev_from_devname() as GPL and add to pinctrl head file. >> >> Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com> >> --- >> drivers/pinctrl/core.c | 1 + >> include/linux/pinctrl/pinctrl.h | 1 + > >If you add it to <linux/pinctrl/pinctrl.h> you need to remove it from >drivers/pinctrl/core.h. > >I suggest you just include the local header instead. > >#include "../pinctrl/pinctrl.h" > >Maybe not the most elegant but it keeps the interface private to >pinctrl and GPIO and not broadcast to the entire kernel. > >If it looks very ugly, well then it is probably because this driver >should move into drivers/pinctrl. > I pushed a new patchset, drop pinctrl from gpio driver, then this patch is not need again. please help to give a review to that. Thanks. >Yours, >Linus Walleij
diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index 9e57f4c62e60..af5194c42dc4 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinctrl/core.c @@ -118,6 +118,7 @@ struct pinctrl_dev *get_pinctrl_dev_from_devname(const char *devname) return NULL; } +EXPORT_SYMBOL_GPL(get_pinctrl_dev_from_devname); struct pinctrl_dev *get_pinctrl_dev_from_of_node(struct device_node *np) { diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h index 487117ccb1bc..a9923ccda574 100644 --- a/include/linux/pinctrl/pinctrl.h +++ b/include/linux/pinctrl/pinctrl.h @@ -219,5 +219,6 @@ struct pinctrl_dev *of_pinctrl_get(struct device_node *np) extern const char *pinctrl_dev_get_name(struct pinctrl_dev *pctldev); extern const char *pinctrl_dev_get_devname(struct pinctrl_dev *pctldev); extern void *pinctrl_dev_get_drvdata(struct pinctrl_dev *pctldev); +extern struct pinctrl_dev *get_pinctrl_dev_from_devname(const char *devname); #endif /* __LINUX_PINCTRL_PINCTRL_H */
Export get_pinctrl_dev_from_devname() as GPL and add to pinctrl head file. Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com> --- drivers/pinctrl/core.c | 1 + include/linux/pinctrl/pinctrl.h | 1 + 2 files changed, 2 insertions(+)