* [PATCH 0/2] pinctrl: Implicit inclusion fallout fixes @ 2018-02-05 12:47 Thierry Reding 2018-02-05 12:47 ` [PATCH 1/2] drm/rockchip: lvds: Explicitly include pinctrl headers Thierry Reding ` (2 more replies) 0 siblings, 3 replies; 9+ messages in thread From: Thierry Reding @ 2018-02-05 12:47 UTC (permalink / raw) To: Linus Torvalds; +Cc: Linus Walleij, linux-gpio, linux-next, linux-kernel From: Thierry Reding <treding@nvidia.com> Hi Linus, these are two patches to fix build errors I've run into that are fallout from your removal of the pinctrl/devinfo.h include from device.h. I sure can imagine that there are more like this, but these seem to be the common ones, judging by my own build tests and the kernel-build-reports mailing list. I'm sending these to you directly because I think it makes sense for you to apply these on top of 23c35f48f5fb ("pinctrl: remove include file from <linux/device.h>") rather than have these go in through their respective maintainer trees, so that the build gets fixed as quickly as possible. Thierry Thierry Reding (2): drm/rockchip: lvds: Explicitly include pinctrl headers mmc: meson-gx-mmc: Explicitly include pinctr/consumer.h drivers/gpu/drm/rockchip/rockchip_lvds.c | 2 ++ drivers/mmc/host/meson-gx-mmc.c | 1 + 2 files changed, 3 insertions(+) -- 2.15.1 ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/2] drm/rockchip: lvds: Explicitly include pinctrl headers 2018-02-05 12:47 [PATCH 0/2] pinctrl: Implicit inclusion fallout fixes Thierry Reding @ 2018-02-05 12:47 ` Thierry Reding 2018-02-05 12:47 ` [PATCH 2/2] mmc: meson-gx-mmc: Explicitly include pinctr/consumer.h Thierry Reding 2018-02-05 12:54 ` [PATCH] net: mediatek: Explicitly include pinctrl headers Thierry Reding 2 siblings, 0 replies; 9+ messages in thread From: Thierry Reding @ 2018-02-05 12:47 UTC (permalink / raw) To: Linus Torvalds; +Cc: Linus Walleij, linux-gpio, linux-next, linux-kernel From: Thierry Reding <treding@nvidia.com> The Rockchip LVDS driver fails to build after commit 23c35f48f5fb ("pinctrl: remove include file from <linux/device.h>") because it relies on the pinctrl/consumer.h and pinctrl/devinfo.h being pulled in by the device.h header implicitly. Include these headers explicitly to avoid the build failure. Cc: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Thierry Reding <treding@nvidia.com> --- drivers/gpu/drm/rockchip/rockchip_lvds.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/rockchip/rockchip_lvds.c b/drivers/gpu/drm/rockchip/rockchip_lvds.c index 84911bdc27d1..cd1e1d1edc1d 100644 --- a/drivers/gpu/drm/rockchip/rockchip_lvds.c +++ b/drivers/gpu/drm/rockchip/rockchip_lvds.c @@ -25,6 +25,8 @@ #include <linux/clk.h> #include <linux/mfd/syscon.h> #include <linux/of_graph.h> +#include <linux/pinctrl/consumer.h> +#include <linux/pinctrl/devinfo.h> #include <linux/pm_runtime.h> #include <linux/regmap.h> #include <linux/reset.h> -- 2.15.1 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/2] mmc: meson-gx-mmc: Explicitly include pinctr/consumer.h 2018-02-05 12:47 [PATCH 0/2] pinctrl: Implicit inclusion fallout fixes Thierry Reding 2018-02-05 12:47 ` [PATCH 1/2] drm/rockchip: lvds: Explicitly include pinctrl headers Thierry Reding @ 2018-02-05 12:47 ` Thierry Reding 2018-02-05 12:54 ` [PATCH] net: mediatek: Explicitly include pinctrl headers Thierry Reding 2 siblings, 0 replies; 9+ messages in thread From: Thierry Reding @ 2018-02-05 12:47 UTC (permalink / raw) To: Linus Torvalds; +Cc: Linus Walleij, linux-gpio, linux-next, linux-kernel From: Thierry Reding <treding@nvidia.com> The Meson GX MMC driver fails to build after commit 23c35f48f5fb ("pinctrl: remove include file from <linux/device.h>") because it relies on the pinctrl/consumer.h being pulled in by the device.h header implicitly. Include the header explicitly to avoid the build failure. Cc: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Thierry Reding <treding@nvidia.com> --- drivers/mmc/host/meson-gx-mmc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c index 32a6a228cd12..22438ebfe4e6 100644 --- a/drivers/mmc/host/meson-gx-mmc.c +++ b/drivers/mmc/host/meson-gx-mmc.c @@ -37,6 +37,7 @@ #include <linux/regulator/consumer.h> #include <linux/interrupt.h> #include <linux/bitfield.h> +#include <linux/pinctrl/consumer.h> #define DRIVER_NAME "meson-gx-mmc" -- 2.15.1 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH] net: mediatek: Explicitly include pinctrl headers 2018-02-05 12:47 [PATCH 0/2] pinctrl: Implicit inclusion fallout fixes Thierry Reding 2018-02-05 12:47 ` [PATCH 1/2] drm/rockchip: lvds: Explicitly include pinctrl headers Thierry Reding 2018-02-05 12:47 ` [PATCH 2/2] mmc: meson-gx-mmc: Explicitly include pinctr/consumer.h Thierry Reding @ 2018-02-05 12:54 ` Thierry Reding 2018-02-05 17:42 ` Linus Torvalds 2 siblings, 1 reply; 9+ messages in thread From: Thierry Reding @ 2018-02-05 12:54 UTC (permalink / raw) To: Linus Torvalds; +Cc: Linus Walleij, linux-gpio, linux-next, linux-kernel From: Thierry Reding <treding@nvidia.com> The Mediatek ethernet driver fails to build after commit 23c35f48f5fb ("pinctrl: remove include file from <linux/device.h>") because it relies on the pinctrl/consumer.h and pinctrl/devinfo.h being pulled in by the device.h header implicitly. Include these headers explicitly to avoid the build failure. Cc: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Thierry Reding <treding@nvidia.com> --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c index 29826dd15204..9e74c165f3ca 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c @@ -23,6 +23,8 @@ #include <linux/reset.h> #include <linux/tcp.h> #include <linux/interrupt.h> +#include <linux/pinctrl/consumer.h> +#include <linux/pinctrl/devinfo.h> #include "mtk_eth_soc.h" -- 2.15.1 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] net: mediatek: Explicitly include pinctrl headers 2018-02-05 12:54 ` [PATCH] net: mediatek: Explicitly include pinctrl headers Thierry Reding @ 2018-02-05 17:42 ` Linus Torvalds 2018-02-05 17:59 ` Thierry Reding 0 siblings, 1 reply; 9+ messages in thread From: Linus Torvalds @ 2018-02-05 17:42 UTC (permalink / raw) To: Thierry Reding Cc: Linus Walleij, linux-gpio, linux-next, Linux Kernel Mailing List On Mon, Feb 5, 2018 at 4:54 AM, Thierry Reding <thierry.reding@gmail.com> wrote: > > Include these headers explicitly to avoid the build failure. I don't think you need to include *both*. <linux/device.h> used to include just <linux/pinctrl/devinfo.h>. I'll edit your patches to include just that. <linux/pinctrl/consumer.h> will come in automatically through it. Linus ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] net: mediatek: Explicitly include pinctrl headers 2018-02-05 17:42 ` Linus Torvalds @ 2018-02-05 17:59 ` Thierry Reding 2018-02-05 19:02 ` Linus Walleij 0 siblings, 1 reply; 9+ messages in thread From: Thierry Reding @ 2018-02-05 17:59 UTC (permalink / raw) To: Linus Torvalds Cc: Linus Walleij, linux-gpio, linux-next, Linux Kernel Mailing List [-- Attachment #1: Type: text/plain, Size: 1721 bytes --] On Mon, Feb 05, 2018 at 09:42:21AM -0800, Linus Torvalds wrote: > On Mon, Feb 5, 2018 at 4:54 AM, Thierry Reding <thierry.reding@gmail.com> wrote: > > > > Include these headers explicitly to avoid the build failure. > > I don't think you need to include *both*. > > <linux/device.h> used to include just <linux/pinctrl/devinfo.h>. > > I'll edit your patches to include just that. > <linux/pinctrl/consumer.h> will come in automatically through it. I was trying to avoid any implicit inclusion, but looking at pinctrl/devinfo.h it has a comment right above the pinctrl/consumer.h include that makes it clear that pinctrl/devinfo.h is the consumer of pinctrl for the core, so I guess the implicit include is fine here. I do question, though, if drivers have any business including this pinctrl/devinfo.h in the first place. For the Mediatek ethernet it seems like selecting the default state is redundant (the core should already have taken care of that, and the driver never selects a different state anywhere). The same is true of drm/rockchip, which also only seems to select a state which the pinctrl core should've selected by default already. See arch/arm/boot/dts/rk3288.dtsi which sets up the "lcdc" state as the only state for the LVDS output. Anyway, I think going with the pinctrl/devinfo.h include only is fine for now. If it turns out that the Mediatek ethernet and Rockchip LVDS drivers can just omit the bits fiddling with struct dev_pin_info, we can swap out the pinctrl/devinfo.h include for pinctrl/consumer.h at that time. LinusW: what are your thoughts on the struct dev_pin_info usage by these drivers? Does their code seem redundant to you, too? Thierry [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] net: mediatek: Explicitly include pinctrl headers 2018-02-05 17:59 ` Thierry Reding @ 2018-02-05 19:02 ` Linus Walleij 2018-02-05 19:08 ` Thierry Reding 0 siblings, 1 reply; 9+ messages in thread From: Linus Walleij @ 2018-02-05 19:02 UTC (permalink / raw) To: Thierry Reding Cc: Linus Torvalds, linux-gpio, linux-next, Linux Kernel Mailing List On Mon, Feb 5, 2018 at 6:59 PM, Thierry Reding <thierry.reding@gmail.com> wrote: > Anyway, I think going with the pinctrl/devinfo.h include only is fine > for now. If it turns out that the Mediatek ethernet and Rockchip LVDS > drivers can just omit the bits fiddling with struct dev_pin_info, we can > swap out the pinctrl/devinfo.h include for pinctrl/consumer.h at that > time. > > LinusW: what are your thoughts on the struct dev_pin_info usage by these > drivers? Does their code seem redundant to you, too? I don't think they should use struct dev_pin_info at all, that thing is for the device core only. I like to think that <linux/pinctrl/consumer.h> is for drivers that explicitly grab and control pin control states so this driver should only include <linux/pinctrl/consumer.h>. Torvalds: can you do it like that instead? Either way will make the compile work again, we can also tidy it up later. (i.e. I will grep for includes of pinctrl/dev_info.h and replace it with consumer.h) at some point. It wasn't pretty that these drivers were relying on implicit #includes in the first place so either is anyway prettier than what it used to look like. In a way I kind of like this sideffect even if it broke some compiles. Yours, Linus Walleij ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] net: mediatek: Explicitly include pinctrl headers 2018-02-05 19:02 ` Linus Walleij @ 2018-02-05 19:08 ` Thierry Reding 2018-02-05 23:03 ` Linus Walleij 0 siblings, 1 reply; 9+ messages in thread From: Thierry Reding @ 2018-02-05 19:08 UTC (permalink / raw) To: Linus Walleij Cc: Linus Torvalds, linux-gpio, linux-next, Linux Kernel Mailing List [-- Attachment #1: Type: text/plain, Size: 1438 bytes --] On Mon, Feb 05, 2018 at 08:02:40PM +0100, Linus Walleij wrote: > On Mon, Feb 5, 2018 at 6:59 PM, Thierry Reding <thierry.reding@gmail.com> wrote: > > > Anyway, I think going with the pinctrl/devinfo.h include only is fine > > for now. If it turns out that the Mediatek ethernet and Rockchip LVDS > > drivers can just omit the bits fiddling with struct dev_pin_info, we can > > swap out the pinctrl/devinfo.h include for pinctrl/consumer.h at that > > time. > > > > LinusW: what are your thoughts on the struct dev_pin_info usage by these > > drivers? Does their code seem redundant to you, too? > > I don't think they should use struct dev_pin_info at all, > that thing is for the device core only. > > I like to think that <linux/pinctrl/consumer.h> is for drivers that > explicitly grab and control pin control states so this driver should > only include <linux/pinctrl/consumer.h>. > > Torvalds: can you do it like that instead? Either way will > make the compile work again, we can also tidy it up later. > (i.e. I will grep for includes of pinctrl/dev_info.h and replace > it with consumer.h) at some point. That won't work, unfortunately, because these drivers actually try to dereference pointers to struct dev_pin_info and hence need that include for the structure's definition. Those are the only two drivers I can see that access this structure directly (other than the device core). Thierry [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] net: mediatek: Explicitly include pinctrl headers 2018-02-05 19:08 ` Thierry Reding @ 2018-02-05 23:03 ` Linus Walleij 0 siblings, 0 replies; 9+ messages in thread From: Linus Walleij @ 2018-02-05 23:03 UTC (permalink / raw) To: Thierry Reding Cc: Linus Torvalds, linux-gpio, linux-next, Linux Kernel Mailing List On Mon, Feb 5, 2018 at 8:08 PM, Thierry Reding <thierry.reding@gmail.com> wrote: > On Mon, Feb 05, 2018 at 08:02:40PM +0100, Linus Walleij wrote: >> On Mon, Feb 5, 2018 at 6:59 PM, Thierry Reding <thierry.reding@gmail.com> wrote: >> >> > Anyway, I think going with the pinctrl/devinfo.h include only is fine >> > for now. If it turns out that the Mediatek ethernet and Rockchip LVDS >> > drivers can just omit the bits fiddling with struct dev_pin_info, we can >> > swap out the pinctrl/devinfo.h include for pinctrl/consumer.h at that >> > time. >> > >> > LinusW: what are your thoughts on the struct dev_pin_info usage by these >> > drivers? Does their code seem redundant to you, too? >> >> I don't think they should use struct dev_pin_info at all, >> that thing is for the device core only. >> >> I like to think that <linux/pinctrl/consumer.h> is for drivers that >> explicitly grab and control pin control states so this driver should >> only include <linux/pinctrl/consumer.h>. >> >> Torvalds: can you do it like that instead? Either way will >> make the compile work again, we can also tidy it up later. >> (i.e. I will grep for includes of pinctrl/dev_info.h and replace >> it with consumer.h) at some point. > > That won't work, unfortunately, because these drivers actually try to > dereference pointers to struct dev_pin_info and hence need that include > for the structure's definition. Those are the only two drivers I can see > that access this structure directly (other than the device core). Grrr OK I thought I was aiming for encapsulation here but then what can I do, sigh. Yours, Linus Walleij ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2018-02-05 23:03 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2018-02-05 12:47 [PATCH 0/2] pinctrl: Implicit inclusion fallout fixes Thierry Reding 2018-02-05 12:47 ` [PATCH 1/2] drm/rockchip: lvds: Explicitly include pinctrl headers Thierry Reding 2018-02-05 12:47 ` [PATCH 2/2] mmc: meson-gx-mmc: Explicitly include pinctr/consumer.h Thierry Reding 2018-02-05 12:54 ` [PATCH] net: mediatek: Explicitly include pinctrl headers Thierry Reding 2018-02-05 17:42 ` Linus Torvalds 2018-02-05 17:59 ` Thierry Reding 2018-02-05 19:02 ` Linus Walleij 2018-02-05 19:08 ` Thierry Reding 2018-02-05 23:03 ` Linus Walleij
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).