Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1450372 > unrolled thread

[PATCH] powerpc: sgy_cts1000: Fix gpio_halt_cb()'s signature

Started byAndrey Smirnov <andrew.smirnov@gmail.com>
First post2016-07-26 06:50 +0200
Last post2016-07-26 06:50 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] powerpc: sgy_cts1000: Fix gpio_halt_cb()'s signature Andrey Smirnov <andrew.smirnov@gmail.com> - 2016-07-26 06:50 +0200

#1450372 — [PATCH] powerpc: sgy_cts1000: Fix gpio_halt_cb()'s signature

FromAndrey Smirnov <andrew.smirnov@gmail.com>
Date2016-07-26 06:50 +0200
Subject[PATCH] powerpc: sgy_cts1000: Fix gpio_halt_cb()'s signature
Message-ID<rZ2tA-5W4-15@gated-at.bofh.it>
Halt callback in struct machdep_calls is declared with __noreturn
attribute, so omitting that attribute in gpio_halt_cb()'s signatrue
results in compilation error.

Change the signature to address the problem as well as change the code
of the function to avoid ever returning from the function.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 arch/powerpc/platforms/85xx/sgy_cts1000.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/platforms/85xx/sgy_cts1000.c b/arch/powerpc/platforms/85xx/sgy_cts1000.c
index 79fd0df..21d6aaa 100644
--- a/arch/powerpc/platforms/85xx/sgy_cts1000.c
+++ b/arch/powerpc/platforms/85xx/sgy_cts1000.c
@@ -38,18 +38,18 @@ static void gpio_halt_wfn(struct work_struct *work)
 }
 static DECLARE_WORK(gpio_halt_wq, gpio_halt_wfn);
 
-static void gpio_halt_cb(void)
+static void __noreturn gpio_halt_cb(void)
 {
 	enum of_gpio_flags flags;
 	int trigger, gpio;
 
 	if (!halt_node)
-		return;
+		panic("No reset GPIO information was provided in DT\n");
 
 	gpio = of_get_gpio_flags(halt_node, 0, &flags);
 
 	if (!gpio_is_valid(gpio))
-		return;
+		panic("Provided GPIO is invalid\n");
 
 	trigger = (flags == OF_GPIO_ACTIVE_LOW);
 
@@ -57,6 +57,8 @@ static void gpio_halt_cb(void)
 
 	/* Probably wont return */
 	gpio_set_value(gpio, trigger);
+
+	panic("Halt failed\n");
 }
 
 /* This IRQ means someone pressed the power button and it is waiting for us
-- 
2.5.5

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web