Skip to content

Commit 625f3ee

Browse files
ndreysScott Wood
authored andcommitted
powerpc/sgy_cts1000: Fix gpio_halt_cb()'s signature
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 <[email protected]> Signed-off-by: Scott Wood <[email protected]>
1 parent 49bf927 commit 625f3ee

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

arch/powerpc/platforms/85xx/sgy_cts1000.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,25 +38,27 @@ static void gpio_halt_wfn(struct work_struct *work)
3838
}
3939
static DECLARE_WORK(gpio_halt_wq, gpio_halt_wfn);
4040

41-
static void gpio_halt_cb(void)
41+
static void __noreturn gpio_halt_cb(void)
4242
{
4343
enum of_gpio_flags flags;
4444
int trigger, gpio;
4545

4646
if (!halt_node)
47-
return;
47+
panic("No reset GPIO information was provided in DT\n");
4848

4949
gpio = of_get_gpio_flags(halt_node, 0, &flags);
5050

5151
if (!gpio_is_valid(gpio))
52-
return;
52+
panic("Provided GPIO is invalid\n");
5353

5454
trigger = (flags == OF_GPIO_ACTIVE_LOW);
5555

5656
printk(KERN_INFO "gpio-halt: triggering GPIO.\n");
5757

5858
/* Probably wont return */
5959
gpio_set_value(gpio, trigger);
60+
61+
panic("Halt failed\n");
6062
}
6163

6264
/* This IRQ means someone pressed the power button and it is waiting for us

0 commit comments

Comments
 (0)