Skip to content

Instantly share code, notes, and snippets.

@brennen
Created June 5, 2015 21:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brennen/53a908a096d6ec973b47 to your computer and use it in GitHub Desktop.
Save brennen/53a908a096d6ec973b47 to your computer and use it in GitHub Desktop.
brennen@exuberance 15:01:57 /home/brennen/code/adafruit-raspberrypi-linux (rpi-3.18.y-powerswitch) ★ git diff rpi-3.18.y.. drivers/power/rpi_power_switch.c
diff --git a/drivers/power/rpi_power_switch.c b/drivers/power/rpi_power_switch.c
index 049af00..baee336 100644
--- a/drivers/power/rpi_power_switch.c
+++ b/drivers/power/rpi_power_switch.c
@@ -24,9 +24,7 @@
#include <linux/workqueue.h>
-/* the BCM2709 redefines this for us right!
#define BCM2708_PERI_BASE 0x20000000
-*/
#define GPIO_BASE (BCM2708_PERI_BASE + 0x200000)
#define GPPUD (gpio_reg+0x94)
@@ -125,7 +123,6 @@ static int raw_gpio_set(int gpio, int val) {
* This function will actually Call /sbin/shutdown when the switch gets hit.
*/
static void initiate_shutdown(struct work_struct *work) {
- int ret;
char *cmd = "/sbin/shutdown";
char *argv[] = {
cmd,
@@ -153,7 +150,7 @@ static void initiate_shutdown(struct work_struct *work) {
//printk(KERN_ALERT "DEBUG: Passed %s %d \n",__FUNCTION__,__LINE__);
- ret = call_usermodehelper(cmd, argv, envp, UMH_WAIT_PROC);
+ int ret = call_usermodehelper(cmd, argv, envp, UMH_WAIT_PROC);
//printk(KERN_ALERT "returned %d\n", ret);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment