linux-next: build failure after merge of the battery tree

Stephen Rothwell posted 1 patch 2 years, 3 months ago
drivers/power/supply/rt5033_charger.c | 1 +
1 file changed, 1 insertion(+)
linux-next: build failure after merge of the battery tree
Posted by Stephen Rothwell 2 years, 3 months ago
Hi all,

After merging the battery tree, today's linux-next build (x86_64
allmodconfig) failed like this:

drivers/power/supply/rt5033_charger.c: In function 'rt5033_charger_probe':
drivers/power/supply/rt5033_charger.c:694:19: error: implicit declaration of function 'of_parse_phandle' [-Werror=implicit-function-declaration]
  694 |         np_conn = of_parse_phandle(pdev->dev.of_node, "richtek,usb-connector", 0);
      |                   ^~~~~~~~~~~~~~~~
drivers/power/supply/rt5033_charger.c:694:17: error: assignment to 'struct device_node *' from 'int' makes pointer from integer without a cast [-Werror=int-conversion]
  694 |         np_conn = of_parse_phandle(pdev->dev.of_node, "richtek,usb-connector", 0);
      |                 ^
drivers/power/supply/rt5033_charger.c:695:19: error: implicit declaration of function 'of_get_parent'; did you mean 'kernfs_get_parent'? [-Werror=implicit-function-declaration]
  695 |         np_edev = of_get_parent(np_conn);
      |                   ^~~~~~~~~~~~~
      |                   kernfs_get_parent
drivers/power/supply/rt5033_charger.c:695:17: error: assignment to 'struct device_node *' from 'int' makes pointer from integer without a cast [-Werror=int-conversion]
  695 |         np_edev = of_get_parent(np_conn);
      |                 ^

Caused by commit

  2ce8284c3115 ("power: Explicitly include correct DT includes")

interacting with commit

  12cc585f36b8 ("power: supply: rt5033_charger: Add cable detection and USB OTG supply")

from the mfd tree.

I have applied the following merge fix patch.

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Mon, 21 Aug 2023 12:50:12 +1000
Subject: [PATCH] fixup for "power: Explicitly include correct DT includes"

interacting with commit

  12cc585f36b8 ("power: supply: rt5033_charger: Add cable detection and USB OTG supply")

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 drivers/power/supply/rt5033_charger.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/power/supply/rt5033_charger.c b/drivers/power/supply/rt5033_charger.c
index 4d1198d752b7..4ea769775fa5 100644
--- a/drivers/power/supply/rt5033_charger.c
+++ b/drivers/power/supply/rt5033_charger.c
@@ -11,6 +11,7 @@
 #include <linux/extcon.h>
 #include <linux/module.h>
 #include <linux/mutex.h>
+#include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/power_supply.h>
 #include <linux/regmap.h>
-- 
2.40.1

-- 
Cheers,
Stephen Rothwell
Re: linux-next: build failure after merge of the battery tree
Posted by Lee Jones 2 years, 3 months ago
On Mon, 21 Aug 2023, Stephen Rothwell wrote:

> Hi all,
> 
> After merging the battery tree, today's linux-next build (x86_64
> allmodconfig) failed like this:
> 
> drivers/power/supply/rt5033_charger.c: In function 'rt5033_charger_probe':
> drivers/power/supply/rt5033_charger.c:694:19: error: implicit declaration of function 'of_parse_phandle' [-Werror=implicit-function-declaration]

Is this because your merge-conflict patch:

  linux-next: manual merge of the battery tree with the mfd tree

... removed of_device.h?

>   694 |         np_conn = of_parse_phandle(pdev->dev.of_node, "richtek,usb-connector", 0);
>       |                   ^~~~~~~~~~~~~~~~
> drivers/power/supply/rt5033_charger.c:694:17: error: assignment to 'struct device_node *' from 'int' makes pointer from integer without a cast [-Werror=int-conversion]
>   694 |         np_conn = of_parse_phandle(pdev->dev.of_node, "richtek,usb-connector", 0);
>       |                 ^
> drivers/power/supply/rt5033_charger.c:695:19: error: implicit declaration of function 'of_get_parent'; did you mean 'kernfs_get_parent'? [-Werror=implicit-function-declaration]
>   695 |         np_edev = of_get_parent(np_conn);
>       |                   ^~~~~~~~~~~~~
>       |                   kernfs_get_parent
> drivers/power/supply/rt5033_charger.c:695:17: error: assignment to 'struct device_node *' from 'int' makes pointer from integer without a cast [-Werror=int-conversion]
>   695 |         np_edev = of_get_parent(np_conn);
>       |                 ^
> 
> Caused by commit
> 
>   2ce8284c3115 ("power: Explicitly include correct DT includes")
> 
> interacting with commit
> 
>   12cc585f36b8 ("power: supply: rt5033_charger: Add cable detection and USB OTG supply")
> 
> from the mfd tree.
> 
> I have applied the following merge fix patch.
> 
> From: Stephen Rothwell <sfr@canb.auug.org.au>
> Date: Mon, 21 Aug 2023 12:50:12 +1000
> Subject: [PATCH] fixup for "power: Explicitly include correct DT includes"
> 
> interacting with commit
> 
>   12cc585f36b8 ("power: supply: rt5033_charger: Add cable detection and USB OTG supply")
> 
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> ---
>  drivers/power/supply/rt5033_charger.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/power/supply/rt5033_charger.c b/drivers/power/supply/rt5033_charger.c
> index 4d1198d752b7..4ea769775fa5 100644
> --- a/drivers/power/supply/rt5033_charger.c
> +++ b/drivers/power/supply/rt5033_charger.c
> @@ -11,6 +11,7 @@
>  #include <linux/extcon.h>
>  #include <linux/module.h>
>  #include <linux/mutex.h>
> +#include <linux/of.h>
>  #include <linux/platform_device.h>
>  #include <linux/power_supply.h>
>  #include <linux/regmap.h>
> -- 
> 2.40.1
> 
> -- 
> Cheers,
> Stephen Rothwell



-- 
Lee Jones [李琼斯]
Re: linux-next: build failure after merge of the battery tree
Posted by Lee Jones 2 years, 3 months ago
On Mon, 21 Aug 2023, Lee Jones wrote:

> On Mon, 21 Aug 2023, Stephen Rothwell wrote:
> 
> > Hi all,
> > 
> > After merging the battery tree, today's linux-next build (x86_64
> > allmodconfig) failed like this:
> > 
> > drivers/power/supply/rt5033_charger.c: In function 'rt5033_charger_probe':
> > drivers/power/supply/rt5033_charger.c:694:19: error: implicit declaration of function 'of_parse_phandle' [-Werror=implicit-function-declaration]
> 
> Is this because your merge-conflict patch:
> 
>   linux-next: manual merge of the battery tree with the mfd tree
> 
>  ... removed of_device.h?

Oh, that was Rob's patch.  I see now, thanks.

> >   694 |         np_conn = of_parse_phandle(pdev->dev.of_node, "richtek,usb-connector", 0);
> >       |                   ^~~~~~~~~~~~~~~~
> > drivers/power/supply/rt5033_charger.c:694:17: error: assignment to 'struct device_node *' from 'int' makes pointer from integer without a cast [-Werror=int-conversion]
> >   694 |         np_conn = of_parse_phandle(pdev->dev.of_node, "richtek,usb-connector", 0);
> >       |                 ^
> > drivers/power/supply/rt5033_charger.c:695:19: error: implicit declaration of function 'of_get_parent'; did you mean 'kernfs_get_parent'? [-Werror=implicit-function-declaration]
> >   695 |         np_edev = of_get_parent(np_conn);
> >       |                   ^~~~~~~~~~~~~
> >       |                   kernfs_get_parent
> > drivers/power/supply/rt5033_charger.c:695:17: error: assignment to 'struct device_node *' from 'int' makes pointer from integer without a cast [-Werror=int-conversion]
> >   695 |         np_edev = of_get_parent(np_conn);
> >       |                 ^
> > 
> > Caused by commit
> > 
> >   2ce8284c3115 ("power: Explicitly include correct DT includes")
> > 
> > interacting with commit
> > 
> >   12cc585f36b8 ("power: supply: rt5033_charger: Add cable detection and USB OTG supply")
> > 
> > from the mfd tree.
> > 
> > I have applied the following merge fix patch.
> > 
> > From: Stephen Rothwell <sfr@canb.auug.org.au>
> > Date: Mon, 21 Aug 2023 12:50:12 +1000
> > Subject: [PATCH] fixup for "power: Explicitly include correct DT includes"
> > 
> > interacting with commit
> > 
> >   12cc585f36b8 ("power: supply: rt5033_charger: Add cable detection and USB OTG supply")
> > 
> > Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> > ---
> >  drivers/power/supply/rt5033_charger.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/drivers/power/supply/rt5033_charger.c b/drivers/power/supply/rt5033_charger.c
> > index 4d1198d752b7..4ea769775fa5 100644
> > --- a/drivers/power/supply/rt5033_charger.c
> > +++ b/drivers/power/supply/rt5033_charger.c
> > @@ -11,6 +11,7 @@
> >  #include <linux/extcon.h>
> >  #include <linux/module.h>
> >  #include <linux/mutex.h>
> > +#include <linux/of.h>
> >  #include <linux/platform_device.h>
> >  #include <linux/power_supply.h>
> >  #include <linux/regmap.h>
> > -- 
> > 2.40.1
> > 
> > -- 
> > Cheers,
> > Stephen Rothwell
> 
> 
> 
> -- 
> Lee Jones [李琼斯]

-- 
Lee Jones [李琼斯]
Re: linux-next: build failure after merge of the battery tree
Posted by Rob Herring 2 years, 3 months ago
On Mon, Aug 21, 2023 at 2:13 AM Lee Jones <lee@kernel.org> wrote:
>
> On Mon, 21 Aug 2023, Lee Jones wrote:
>
> > On Mon, 21 Aug 2023, Stephen Rothwell wrote:
> >
> > > Hi all,
> > >
> > > After merging the battery tree, today's linux-next build (x86_64
> > > allmodconfig) failed like this:
> > >
> > > drivers/power/supply/rt5033_charger.c: In function 'rt5033_charger_probe':
> > > drivers/power/supply/rt5033_charger.c:694:19: error: implicit declaration of function 'of_parse_phandle' [-Werror=implicit-function-declaration]
> >
> > Is this because your merge-conflict patch:
> >
> >   linux-next: manual merge of the battery tree with the mfd tree
> >
> >  ... removed of_device.h?
>
> Oh, that was Rob's patch.  I see now, thanks.

Presumably the functions below got added and failed to add of.h and
instead relied on of_device.h's implicit include of of.h which is
going to get removed. So Stephen's fix is the correct one.

Rob
Re: linux-next: build failure after merge of the battery tree
Posted by Lee Jones 2 years, 3 months ago
On Mon, 21 Aug 2023, Rob Herring wrote:

> On Mon, Aug 21, 2023 at 2:13 AM Lee Jones <lee@kernel.org> wrote:
> >
> > On Mon, 21 Aug 2023, Lee Jones wrote:
> >
> > > On Mon, 21 Aug 2023, Stephen Rothwell wrote:
> > >
> > > > Hi all,
> > > >
> > > > After merging the battery tree, today's linux-next build (x86_64
> > > > allmodconfig) failed like this:
> > > >
> > > > drivers/power/supply/rt5033_charger.c: In function 'rt5033_charger_probe':
> > > > drivers/power/supply/rt5033_charger.c:694:19: error: implicit declaration of function 'of_parse_phandle' [-Werror=implicit-function-declaration]
> > >
> > > Is this because your merge-conflict patch:
> > >
> > >   linux-next: manual merge of the battery tree with the mfd tree
> > >
> > >  ... removed of_device.h?
> >
> > Oh, that was Rob's patch.  I see now, thanks.
> 
> Presumably the functions below got added and failed to add of.h and
> instead relied on of_device.h's implicit include of of.h which is
> going to get removed. So Stephen's fix is the correct one.

Super.

Stephen, would you mind submitting it in a format we can apply?

-- 
Lee Jones [李琼斯]