public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 1/1] clk: imx: scu: fix build break when compiled as modules
@ 2020-10-30 15:37 Dong Aisheng
  2020-11-02 21:33 ` Stephen Boyd
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Dong Aisheng @ 2020-10-30 15:37 UTC (permalink / raw)
  To: linux-clk
  Cc: Dong Aisheng, kernel test robot, sboyd, mturquette, linux-imx,
	kernel, fabio.estevam, shawnguo, linux-arm-kernel

After commit e0d0d4d86c76 ("clk: imx8qxp: Support building i.MX8QXP clock
driver as module"), clk-scu.c and clk-imx8qxp.c are complied in one module,
thus there can be only one module_init() in those two files.
Commit 77d8f3068c63 ("clk: imx: scu: add two cells binding support")
introduced another module_init() in clk_scu.c which caused the errors
below.

To fix the issue, we can remove the unnecessary builtin_platform_driver
from clk_scu.c and directly register the driver in imx_clk_scu_init().

  CC [M]  drivers/clk/imx/clk-scu.o
In file included from ../include/linux/of_device.h:6,
                 from ../include/linux/of_platform.h:12,
                 from ../drivers/clk/imx/clk-scu.c:11:
../drivers/clk/imx/clk-scu.c: In function ‘imx_clk_scu_init’:
../drivers/clk/imx/clk-scu.c:176:35: error: ‘imx_clk_scu_driver’ undeclared (first use in this function); did you mean ‘imx_clk_scu_init’?
  176 |  return platform_driver_register(&imx_clk_scu_driver);
      |                                   ^~~~~~~~~~~~~~~~~~
../include/linux/platform_device.h:218:29: note: in definition of macro ‘platform_driver_register’
  218 |  __platform_driver_register(drv, THIS_MODULE)
      |                             ^~~
../drivers/clk/imx/clk-scu.c:176:35: note: each undeclared identifier is reported only once for each function it appears in
  176 |  return platform_driver_register(&imx_clk_scu_driver);
      |                                   ^~~~~~~~~~~~~~~~~~
../include/linux/platform_device.h:218:29: note: in definition of macro ‘platform_driver_register’
  218 |  __platform_driver_register(drv, THIS_MODULE)
      |                             ^~~
../drivers/clk/imx/clk-scu.c:177:1: error: control reaches end of non-void function [-Werror=return-type]
  177 | }
      | ^
At top level:
../drivers/clk/imx/clk-scu.c:470:31: warning: ‘imx_clk_scu_driver’ defined but not used [-Wunused-variable]
  470 | static struct platform_driver imx_clk_scu_driver = {

Reported-by: kernel test robot <lkp@intel.com>
Fixes: 77d8f3068c63 ("clk: imx: scu: add two cells binding support")
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
---
 drivers/clk/imx/clk-scu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/imx/clk-scu.c b/drivers/clk/imx/clk-scu.c
index e5837e7caa50..d8d59c90bb18 100644
--- a/drivers/clk/imx/clk-scu.c
+++ b/drivers/clk/imx/clk-scu.c
@@ -20,6 +20,7 @@
 
 static struct imx_sc_ipc *ccm_ipc_handle;
 struct device_node *pd_np;
+static struct platform_driver imx_clk_scu_driver;
 
 struct imx_scu_clk_node {
 	const char *name;
@@ -173,7 +174,7 @@ int imx_clk_scu_init(struct device_node *np)
 		}
 	}
 
-	return 0;
+	return platform_driver_register(&imx_clk_scu_driver);
 }
 
 /*
@@ -474,7 +475,6 @@ static struct platform_driver imx_clk_scu_driver = {
 	},
 	.probe = imx_clk_scu_probe,
 };
-builtin_platform_driver(imx_clk_scu_driver);
 
 static int imx_clk_scu_attach_pd(struct device *dev, u32 rsrc_id)
 {
-- 
2.23.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] clk: imx: scu: fix build break when compiled as modules
  2020-10-30 15:37 [PATCH 1/1] clk: imx: scu: fix build break when compiled as modules Dong Aisheng
@ 2020-11-02 21:33 ` Stephen Boyd
  2020-11-02 21:33 ` Stephen Boyd
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Stephen Boyd @ 2020-11-02 21:33 UTC (permalink / raw)
  To: Dong Aisheng, linux-clk
  Cc: Dong Aisheng, kernel test robot, mturquette, linux-imx, kernel,
	fabio.estevam, shawnguo, linux-arm-kernel

Quoting Dong Aisheng (2020-10-30 08:37:33)
> After commit e0d0d4d86c76 ("clk: imx8qxp: Support building i.MX8QXP clock
> driver as module"), clk-scu.c and clk-imx8qxp.c are complied in one module,
> thus there can be only one module_init() in those two files.
> Commit 77d8f3068c63 ("clk: imx: scu: add two cells binding support")
> introduced another module_init() in clk_scu.c which caused the errors
> below.
> 
> To fix the issue, we can remove the unnecessary builtin_platform_driver
> from clk_scu.c and directly register the driver in imx_clk_scu_init().
> 
>   CC [M]  drivers/clk/imx/clk-scu.o
> In file included from ../include/linux/of_device.h:6,
>                  from ../include/linux/of_platform.h:12,
>                  from ../drivers/clk/imx/clk-scu.c:11:
> ../drivers/clk/imx/clk-scu.c: In function ‘imx_clk_scu_init’:
> ../drivers/clk/imx/clk-scu.c:176:35: error: ‘imx_clk_scu_driver’ undeclared (first use in this function); did you mean ‘imx_clk_scu_init’?
>   176 |  return platform_driver_register(&imx_clk_scu_driver);
>       |                                   ^~~~~~~~~~~~~~~~~~
> ../include/linux/platform_device.h:218:29: note: in definition of macro ‘platform_driver_register’
>   218 |  __platform_driver_register(drv, THIS_MODULE)
>       |                             ^~~
> ../drivers/clk/imx/clk-scu.c:176:35: note: each undeclared identifier is reported only once for each function it appears in
>   176 |  return platform_driver_register(&imx_clk_scu_driver);
>       |                                   ^~~~~~~~~~~~~~~~~~
> ../include/linux/platform_device.h:218:29: note: in definition of macro ‘platform_driver_register’
>   218 |  __platform_driver_register(drv, THIS_MODULE)
>       |                             ^~~
> ../drivers/clk/imx/clk-scu.c:177:1: error: control reaches end of non-void function [-Werror=return-type]
>   177 | }
>       | ^
> At top level:
> ../drivers/clk/imx/clk-scu.c:470:31: warning: ‘imx_clk_scu_driver’ defined but not used [-Wunused-variable]
>   470 | static struct platform_driver imx_clk_scu_driver = {
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Fixes: 77d8f3068c63 ("clk: imx: scu: add two cells binding support")
> Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
> ---

Acked-by: Stephen Boyd <sboyd@kernel.org>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] clk: imx: scu: fix build break when compiled as modules
  2020-10-30 15:37 [PATCH 1/1] clk: imx: scu: fix build break when compiled as modules Dong Aisheng
  2020-11-02 21:33 ` Stephen Boyd
@ 2020-11-02 21:33 ` Stephen Boyd
  2020-11-02 21:35 ` Stephen Boyd
  2020-11-02 23:36 ` Shawn Guo
  3 siblings, 0 replies; 5+ messages in thread
From: Stephen Boyd @ 2020-11-02 21:33 UTC (permalink / raw)
  To: Dong Aisheng, linux-clk
  Cc: Dong Aisheng, kernel test robot, mturquette, linux-imx, kernel,
	fabio.estevam, shawnguo, linux-arm-kernel

Quoting Dong Aisheng (2020-10-30 08:37:33)
> After commit e0d0d4d86c76 ("clk: imx8qxp: Support building i.MX8QXP clock
> driver as module"), clk-scu.c and clk-imx8qxp.c are complied in one module,
> thus there can be only one module_init() in those two files.
> Commit 77d8f3068c63 ("clk: imx: scu: add two cells binding support")
> introduced another module_init() in clk_scu.c which caused the errors
> below.
> 
> To fix the issue, we can remove the unnecessary builtin_platform_driver
> from clk_scu.c and directly register the driver in imx_clk_scu_init().
> 
>   CC [M]  drivers/clk/imx/clk-scu.o
> In file included from ../include/linux/of_device.h:6,
>                  from ../include/linux/of_platform.h:12,
>                  from ../drivers/clk/imx/clk-scu.c:11:
> ../drivers/clk/imx/clk-scu.c: In function ‘imx_clk_scu_init’:
> ../drivers/clk/imx/clk-scu.c:176:35: error: ‘imx_clk_scu_driver’ undeclared (first use in this function); did you mean ‘imx_clk_scu_init’?
>   176 |  return platform_driver_register(&imx_clk_scu_driver);
>       |                                   ^~~~~~~~~~~~~~~~~~
> ../include/linux/platform_device.h:218:29: note: in definition of macro ‘platform_driver_register’
>   218 |  __platform_driver_register(drv, THIS_MODULE)
>       |                             ^~~
> ../drivers/clk/imx/clk-scu.c:176:35: note: each undeclared identifier is reported only once for each function it appears in
>   176 |  return platform_driver_register(&imx_clk_scu_driver);
>       |                                   ^~~~~~~~~~~~~~~~~~
> ../include/linux/platform_device.h:218:29: note: in definition of macro ‘platform_driver_register’
>   218 |  __platform_driver_register(drv, THIS_MODULE)
>       |                             ^~~
> ../drivers/clk/imx/clk-scu.c:177:1: error: control reaches end of non-void function [-Werror=return-type]
>   177 | }
>       | ^
> At top level:
> ../drivers/clk/imx/clk-scu.c:470:31: warning: ‘imx_clk_scu_driver’ defined but not used [-Wunused-variable]
>   470 | static struct platform_driver imx_clk_scu_driver = {
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Fixes: 77d8f3068c63 ("clk: imx: scu: add two cells binding support")
> Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
> ---

Oh wait, I see this is upstream now.

Applied to clk-fixes

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] clk: imx: scu: fix build break when compiled as modules
  2020-10-30 15:37 [PATCH 1/1] clk: imx: scu: fix build break when compiled as modules Dong Aisheng
  2020-11-02 21:33 ` Stephen Boyd
  2020-11-02 21:33 ` Stephen Boyd
@ 2020-11-02 21:35 ` Stephen Boyd
  2020-11-02 23:36 ` Shawn Guo
  3 siblings, 0 replies; 5+ messages in thread
From: Stephen Boyd @ 2020-11-02 21:35 UTC (permalink / raw)
  To: Dong Aisheng, linux-clk
  Cc: Dong Aisheng, kernel test robot, mturquette, linux-imx, kernel,
	fabio.estevam, shawnguo, linux-arm-kernel

Quoting Dong Aisheng (2020-10-30 08:37:33)
> After commit e0d0d4d86c76 ("clk: imx8qxp: Support building i.MX8QXP clock
> driver as module"), clk-scu.c and clk-imx8qxp.c are complied in one module,
> thus there can be only one module_init() in those two files.
> Commit 77d8f3068c63 ("clk: imx: scu: add two cells binding support")
> introduced another module_init() in clk_scu.c which caused the errors
> below.
> 
> To fix the issue, we can remove the unnecessary builtin_platform_driver
> from clk_scu.c and directly register the driver in imx_clk_scu_init().
> 
>   CC [M]  drivers/clk/imx/clk-scu.o
> In file included from ../include/linux/of_device.h:6,
>                  from ../include/linux/of_platform.h:12,
>                  from ../drivers/clk/imx/clk-scu.c:11:
> ../drivers/clk/imx/clk-scu.c: In function ‘imx_clk_scu_init’:
> ../drivers/clk/imx/clk-scu.c:176:35: error: ‘imx_clk_scu_driver’ undeclared (first use in this function); did you mean ‘imx_clk_scu_init’?
>   176 |  return platform_driver_register(&imx_clk_scu_driver);
>       |                                   ^~~~~~~~~~~~~~~~~~
> ../include/linux/platform_device.h:218:29: note: in definition of macro ‘platform_driver_register’
>   218 |  __platform_driver_register(drv, THIS_MODULE)
>       |                             ^~~
> ../drivers/clk/imx/clk-scu.c:176:35: note: each undeclared identifier is reported only once for each function it appears in
>   176 |  return platform_driver_register(&imx_clk_scu_driver);
>       |                                   ^~~~~~~~~~~~~~~~~~
> ../include/linux/platform_device.h:218:29: note: in definition of macro ‘platform_driver_register’
>   218 |  __platform_driver_register(drv, THIS_MODULE)
>       |                             ^~~
> ../drivers/clk/imx/clk-scu.c:177:1: error: control reaches end of non-void function [-Werror=return-type]
>   177 | }
>       | ^
> At top level:
> ../drivers/clk/imx/clk-scu.c:470:31: warning: ‘imx_clk_scu_driver’ defined but not used [-Wunused-variable]
>   470 | static struct platform_driver imx_clk_scu_driver = {
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Fixes: 77d8f3068c63 ("clk: imx: scu: add two cells binding support")

And doesn't apply because this commit is only in linux-next. Alright
leaving this to Shawn.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] clk: imx: scu: fix build break when compiled as modules
  2020-10-30 15:37 [PATCH 1/1] clk: imx: scu: fix build break when compiled as modules Dong Aisheng
                   ` (2 preceding siblings ...)
  2020-11-02 21:35 ` Stephen Boyd
@ 2020-11-02 23:36 ` Shawn Guo
  3 siblings, 0 replies; 5+ messages in thread
From: Shawn Guo @ 2020-11-02 23:36 UTC (permalink / raw)
  To: Dong Aisheng
  Cc: kernel test robot, sboyd, mturquette, linux-imx, kernel,
	fabio.estevam, linux-clk, linux-arm-kernel

On Fri, Oct 30, 2020 at 11:37:33PM +0800, Dong Aisheng wrote:
> After commit e0d0d4d86c76 ("clk: imx8qxp: Support building i.MX8QXP clock
> driver as module"), clk-scu.c and clk-imx8qxp.c are complied in one module,
> thus there can be only one module_init() in those two files.
> Commit 77d8f3068c63 ("clk: imx: scu: add two cells binding support")
> introduced another module_init() in clk_scu.c which caused the errors
> below.
> 
> To fix the issue, we can remove the unnecessary builtin_platform_driver
> from clk_scu.c and directly register the driver in imx_clk_scu_init().
> 
>   CC [M]  drivers/clk/imx/clk-scu.o
> In file included from ../include/linux/of_device.h:6,
>                  from ../include/linux/of_platform.h:12,
>                  from ../drivers/clk/imx/clk-scu.c:11:
> ../drivers/clk/imx/clk-scu.c: In function ‘imx_clk_scu_init’:
> ../drivers/clk/imx/clk-scu.c:176:35: error: ‘imx_clk_scu_driver’ undeclared (first use in this function); did you mean ‘imx_clk_scu_init’?
>   176 |  return platform_driver_register(&imx_clk_scu_driver);
>       |                                   ^~~~~~~~~~~~~~~~~~
> ../include/linux/platform_device.h:218:29: note: in definition of macro ‘platform_driver_register’
>   218 |  __platform_driver_register(drv, THIS_MODULE)
>       |                             ^~~
> ../drivers/clk/imx/clk-scu.c:176:35: note: each undeclared identifier is reported only once for each function it appears in
>   176 |  return platform_driver_register(&imx_clk_scu_driver);
>       |                                   ^~~~~~~~~~~~~~~~~~
> ../include/linux/platform_device.h:218:29: note: in definition of macro ‘platform_driver_register’
>   218 |  __platform_driver_register(drv, THIS_MODULE)
>       |                             ^~~
> ../drivers/clk/imx/clk-scu.c:177:1: error: control reaches end of non-void function [-Werror=return-type]
>   177 | }
>       | ^
> At top level:
> ../drivers/clk/imx/clk-scu.c:470:31: warning: ‘imx_clk_scu_driver’ defined but not used [-Wunused-variable]
>   470 | static struct platform_driver imx_clk_scu_driver = {
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Fixes: 77d8f3068c63 ("clk: imx: scu: add two cells binding support")
> Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>

Applied, thanks.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-11-02 23:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-30 15:37 [PATCH 1/1] clk: imx: scu: fix build break when compiled as modules Dong Aisheng
2020-11-02 21:33 ` Stephen Boyd
2020-11-02 21:33 ` Stephen Boyd
2020-11-02 21:35 ` Stephen Boyd
2020-11-02 23:36 ` Shawn Guo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox