linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] reset: socfpga, sunxi: declare _reset_init functions in header files
@ 2018-12-13 12:33 Philipp Zabel
  2018-12-13 12:33 ` [PATCH 1/2] reset: sunxi: declare sun6i_reset_init in a header file Philipp Zabel
  2018-12-13 12:33 ` [PATCH 2/2] reset: socfpga: declare socfpga_reset_init " Philipp Zabel
  0 siblings, 2 replies; 4+ messages in thread
From: Philipp Zabel @ 2018-12-13 12:33 UTC (permalink / raw)
  To: Dinh Nguyen, Maxime Ripard, Chen-Yu Tsai
  Cc: Stephen Rothwell, Olof Johansson, Arnd Bergmann, linux-kernel,
	linux-arm-kernel

Hi,

this moves the socpfga_reset_init function declaration into a header
file that is included by both mach-socfpga and reset-socfpga code,
as suggested by Stephen. The second patch does the same for
sun6i_reset_init.

Since the socfpga patch avoids a (trivial) merge conflict with the
arm-soc tree, I'd like to apply this to the reset/next branch before
sending a pull request.

regards
Philipp

Philipp Zabel (2):
  reset: sunxi: declare sun6i_reset_init in a header file
  reset: socfpga: declare socfpga_reset_init in a header file

 arch/arm/mach-socfpga/socfpga.c | 3 +--
 arch/arm/mach-sunxi/sunxi.c     | 2 +-
 drivers/reset/reset-socfpga.c   | 2 +-
 drivers/reset/reset-sunxi.c     | 1 +
 include/linux/reset/socfpga.h   | 7 +++++++
 include/linux/reset/sunxi.h     | 7 +++++++
 6 files changed, 18 insertions(+), 4 deletions(-)
 create mode 100644 include/linux/reset/socfpga.h
 create mode 100644 include/linux/reset/sunxi.h

-- 
2.19.1


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

* [PATCH 1/2] reset: sunxi: declare sun6i_reset_init in a header file
  2018-12-13 12:33 [PATCH 0/2] reset: socfpga, sunxi: declare _reset_init functions in header files Philipp Zabel
@ 2018-12-13 12:33 ` Philipp Zabel
  2018-12-13 12:33 ` [PATCH 2/2] reset: socfpga: declare socfpga_reset_init " Philipp Zabel
  1 sibling, 0 replies; 4+ messages in thread
From: Philipp Zabel @ 2018-12-13 12:33 UTC (permalink / raw)
  To: Dinh Nguyen, Maxime Ripard, Chen-Yu Tsai
  Cc: Stephen Rothwell, Olof Johansson, Arnd Bergmann, linux-kernel,
	linux-arm-kernel

Avoid declaring extern functions in c files. To make sure function
definition and usage don't get out of sync, declare sun6i_reset_init
in a common header.

Suggested-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
---
 arch/arm/mach-sunxi/sunxi.c | 2 +-
 drivers/reset/reset-sunxi.c | 1 +
 include/linux/reset/sunxi.h | 7 +++++++
 3 files changed, 9 insertions(+), 1 deletion(-)
 create mode 100644 include/linux/reset/sunxi.h

diff --git a/arch/arm/mach-sunxi/sunxi.c b/arch/arm/mach-sunxi/sunxi.c
index de4b0e932f22..88680e80c166 100644
--- a/arch/arm/mach-sunxi/sunxi.c
+++ b/arch/arm/mach-sunxi/sunxi.c
@@ -14,6 +14,7 @@
 #include <linux/clocksource.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
+#include <linux/reset/sunxi.h>
 
 #include <asm/mach/arch.h>
 #include <asm/secure_cntvoff.h>
@@ -37,7 +38,6 @@ static const char * const sun6i_board_dt_compat[] = {
 	NULL,
 };
 
-extern void __init sun6i_reset_init(void);
 static void __init sun6i_timer_init(void)
 {
 	of_clk_init(NULL);
diff --git a/drivers/reset/reset-sunxi.c b/drivers/reset/reset-sunxi.c
index db9a1a75523f..b06d724d8f21 100644
--- a/drivers/reset/reset-sunxi.c
+++ b/drivers/reset/reset-sunxi.c
@@ -18,6 +18,7 @@
 #include <linux/of_address.h>
 #include <linux/platform_device.h>
 #include <linux/reset-controller.h>
+#include <linux/reset/sunxi.h>
 #include <linux/slab.h>
 #include <linux/spinlock.h>
 #include <linux/types.h>
diff --git a/include/linux/reset/sunxi.h b/include/linux/reset/sunxi.h
new file mode 100644
index 000000000000..1ad7fffb413e
--- /dev/null
+++ b/include/linux/reset/sunxi.h
@@ -0,0 +1,7 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __LINUX_RESET_SUNXI_H__
+#define __LINUX_RESET_SUNXI_H__
+
+void __init sun6i_reset_init(void);
+
+#endif /* __LINUX_RESET_SUNXI_H__ */
-- 
2.19.1


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

* [PATCH 2/2] reset: socfpga: declare socfpga_reset_init in a header file
  2018-12-13 12:33 [PATCH 0/2] reset: socfpga, sunxi: declare _reset_init functions in header files Philipp Zabel
  2018-12-13 12:33 ` [PATCH 1/2] reset: sunxi: declare sun6i_reset_init in a header file Philipp Zabel
@ 2018-12-13 12:33 ` Philipp Zabel
  2018-12-13 17:17   ` Dinh Nguyen
  1 sibling, 1 reply; 4+ messages in thread
From: Philipp Zabel @ 2018-12-13 12:33 UTC (permalink / raw)
  To: Dinh Nguyen, Maxime Ripard, Chen-Yu Tsai
  Cc: Stephen Rothwell, Olof Johansson, Arnd Bergmann, linux-kernel,
	linux-arm-kernel

Avoid declaring extern functions in c files. To make sure function
definition and usage don't get out of sync, declare socfpga_reset_init
in a common header.

Suggested-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
---
 arch/arm/mach-socfpga/socfpga.c | 3 +--
 drivers/reset/reset-socfpga.c   | 2 +-
 include/linux/reset/socfpga.h   | 7 +++++++
 3 files changed, 9 insertions(+), 3 deletions(-)
 create mode 100644 include/linux/reset/socfpga.h

diff --git a/arch/arm/mach-socfpga/socfpga.c b/arch/arm/mach-socfpga/socfpga.c
index cc64576c102b..685272fa9eb6 100644
--- a/arch/arm/mach-socfpga/socfpga.c
+++ b/arch/arm/mach-socfpga/socfpga.c
@@ -19,6 +19,7 @@
 #include <linux/of_irq.h>
 #include <linux/of_platform.h>
 #include <linux/reboot.h>
+#include <linux/reset/socfpga.h>
 
 #include <asm/hardware/cache-l2x0.h>
 #include <asm/mach/arch.h>
@@ -32,8 +33,6 @@ void __iomem *rst_manager_base_addr;
 void __iomem *sdr_ctl_base_addr;
 unsigned long socfpga_cpu1start_addr;
 
-extern void __init socfpga_reset_init(void);
-
 void __init socfpga_sysmgr_init(void)
 {
 	struct device_node *np;
diff --git a/drivers/reset/reset-socfpga.c b/drivers/reset/reset-socfpga.c
index 318cfc51c441..96953992c2bb 100644
--- a/drivers/reset/reset-socfpga.c
+++ b/drivers/reset/reset-socfpga.c
@@ -11,6 +11,7 @@
 #include <linux/of_address.h>
 #include <linux/platform_device.h>
 #include <linux/reset-controller.h>
+#include <linux/reset/socfpga.h>
 #include <linux/slab.h>
 #include <linux/spinlock.h>
 #include <linux/types.h>
@@ -18,7 +19,6 @@
 #include "reset-simple.h"
 
 #define SOCFPGA_NR_BANKS	8
-void __init socfpga_reset_init(void);
 
 static int a10_reset_init(struct device_node *np)
 {
diff --git a/include/linux/reset/socfpga.h b/include/linux/reset/socfpga.h
new file mode 100644
index 000000000000..b11a2047c342
--- /dev/null
+++ b/include/linux/reset/socfpga.h
@@ -0,0 +1,7 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __LINUX_RESET_SOCFPGA_H__
+#define __LINUX_RESET_SOCFPGA_H__
+
+void __init socfpga_reset_init(void);
+
+#endif /* __LINUX_RESET_SOCFPGA_H__ */
-- 
2.19.1


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

* Re: [PATCH 2/2] reset: socfpga: declare socfpga_reset_init in a header file
  2018-12-13 12:33 ` [PATCH 2/2] reset: socfpga: declare socfpga_reset_init " Philipp Zabel
@ 2018-12-13 17:17   ` Dinh Nguyen
  0 siblings, 0 replies; 4+ messages in thread
From: Dinh Nguyen @ 2018-12-13 17:17 UTC (permalink / raw)
  To: Philipp Zabel, Maxime Ripard, Chen-Yu Tsai
  Cc: Stephen Rothwell, Olof Johansson, Arnd Bergmann, linux-kernel,
	linux-arm-kernel



On 12/13/18 6:33 AM, Philipp Zabel wrote:
> Avoid declaring extern functions in c files. To make sure function
> definition and usage don't get out of sync, declare socfpga_reset_init
> in a common header.
> 
> Suggested-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
> ---

Acked-by: Dinh Nguyen <dinguyen@kernel.org>

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

end of thread, other threads:[~2018-12-13 17:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-13 12:33 [PATCH 0/2] reset: socfpga, sunxi: declare _reset_init functions in header files Philipp Zabel
2018-12-13 12:33 ` [PATCH 1/2] reset: sunxi: declare sun6i_reset_init in a header file Philipp Zabel
2018-12-13 12:33 ` [PATCH 2/2] reset: socfpga: declare socfpga_reset_init " Philipp Zabel
2018-12-13 17:17   ` Dinh Nguyen

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).