- diff --git a/ptxdist/local_src/power-button/power-button.c b/ptxdist/local_src/power-button/power-button.c
- index b3f97ec..6756482 100644
- --- a/ptxdist/local_src/power-button/power-button.c
- +++ b/ptxdist/local_src/power-button/power-button.c
- @@ -81,7 +81,7 @@ static struct task_struct* pb_thr;
- static int _exit=0;
- static const char * const * shutdown_argv[] =
- - { "/sbin/reboot", "--reboot", NULL };
- + { "/sbin/reboot", "--poweroff", NULL };
- @@ -94,7 +94,7 @@ static int pb_fkt (void* data)
- if (dev == NULL)
- {
- - printk(KERN_INFO "No device in kthread,\n");
- + (void)printk(KERN_INFO "pb_fkt(): No device in kthread,\n");
- return 0;
- }
- @@ -129,6 +129,7 @@ static int pb_fkt (void* data)
- // Leite Power-Off Sequenz ein.
- power_off = 1;
- + (void)printk (KERN_ERR "pb_fkt(): starting power-down sequence...\n");
- call_usermodehelper(shutdown_argv[0], shutdown_argv, NULL, UMH_NO_WAIT);
- }
- else
- @@ -141,6 +142,8 @@ static int pb_fkt (void* data)
- counter = 0;
- init_completion(&dev->pb_pressed);
- enable_irq(dev->IRQ);
- +
- + (void)printk (KERN_ERR "pb_fkt(): power-button lockup error\n");
- }
- }
- }
- @@ -151,14 +154,16 @@ static int pb_fkt (void* data)
- msleep(10000);
- // Immer noch am Leben. Schlecht.
- + (void)printk (KERN_ERR "pb_fkt(): power-off sequence started, but still alive. BAD.\n");
- power_off = 0;
- +
- // Muss nicht, nur zur Sicherheit: http://www.makelinux.net/ldd3/chp-5-sect-4
- init_completion(&dev->pb_pressed);
- enable_irq(dev->IRQ);
- }
- }
- - printk(KERN_INFO "kthread stopped.\n");
- + (void)printk(KERN_INFO "pb_fkt(): kthread stopped.\n");
- return 0;
- }
- @@ -304,7 +309,7 @@ static long pb_driver_ioctl(struct file *filp, unsigned int cmd, unsigned long a
- /*************************************************************************/
- /* Fehler innerhalb der Parameterliste */
- - printk(KERN_INFO"unknown PB_IOC 0x%x\n", cmd);
- + (void)printk(KERN_INFO "pb_driver_ioctl(): unknown PB_IOC 0x%x\n", cmd);
- return -EINVAL;
- } break;
- @@ -329,14 +334,14 @@ static int __init powerbutton_init(void)
- powerbutton_device.dev = MKDEV(264, 0);
- if ((ret = register_chrdev_region(powerbutton_device.dev, 1, "powerbutton")) < 0)
- {
- - printk(KERN_ERR "powerbutton_init(): register_chrdev_region(): ret=%d\n", ret);
- + (void)printk(KERN_ERR "powerbutton_init(): register_chrdev_region(): ret=%d\n", ret);
- goto out;
- }
- cdev_init(&powerbutton_device.cdev, &powerbutton_fops);
- if ((ret = cdev_add(&powerbutton_device.cdev, powerbutton_device.dev, 1)) < 0)
- {
- - printk(KERN_ERR "could not allocate powerbutton\n");
- + (void)printk(KERN_ERR "powerbutton_init(): could not allocate powerbutton\n");
- goto out_unalloc_region;
- }
- @@ -344,14 +349,14 @@ static int __init powerbutton_init(void)
- powerbutton_device.IRQ = gpio_to_irq(powerbutton_device.pb_pin);
- if ((ret = request_irq(powerbutton_device.IRQ, pb_isr, IRQF_SHARED, "powerbutton", &powerbutton_device )) < 0)
- {
- - printk(KERN_ERR "cannot register IRQ %d\n", PB_IRQNR);
- + (void)printk(KERN_ERR "powerbutton_init(): cannot register IRQ %d\n", PB_IRQNR);
- goto out_irq;
- }
- //set_irq_type(powerbutton_device.IRQ, IRQ_TYPE_EDGE_RISING);
- if ((ret = gpio_request(powerbutton_device.pb_pin, "powerbutton")) < 0)
- {
- - printk(KERN_ERR "cannor request gpio %d\n", PB_PIN);
- + (void)printk(KERN_ERR "powerbutton_init(): cannot request gpio %d\n", PB_PIN);
- goto out_gpio_pb;
- }
- gpio_direction_input(powerbutton_device.pb_pin);
- @@ -360,7 +365,7 @@ static int __init powerbutton_init(void)
- //GPIO Shutdown
- if ((ret = gpio_request(powerbutton_device.shutdown_pin, "shutdown")) < 0)
- {
- - printk(KERN_ERR "cannto request gpio %d\n", SHUTDOWN_PIN);
- + (void)printk(KERN_ERR "powerbutton_init(): cannot request gpio %d\n", SHUTDOWN_PIN);
- goto out_gpio_shutdown;
- }
- gpio_direction_output(powerbutton_device.shutdown_pin, 1);
- @@ -370,7 +375,7 @@ static int __init powerbutton_init(void)
- powerbutton_device.virt_adr = ioremap( powerbutton_device.PHY_ADR, powerbutton_device.PHY_LEN );
- if( NULL == powerbutton_device.virt_adr ){
- - printk (KERN_WARNING "powerbutton_init: err: %d()\n", PTR_ERR(powerbutton_device.virt_adr));
- + (void)printk (KERN_WARNING "powerbutton_init(): err: %d()\n", PTR_ERR(powerbutton_device.virt_adr));
- goto out_memory;
- }
- else {
- @@ -381,7 +386,7 @@ static int __init powerbutton_init(void)
- pb_thr = kthread_run (pb_fkt, &powerbutton_device, "pb-thread");
- if (IS_ERR(pb_thr))
- {
- - printk (KERN_WARNING "powerbutton_init: err: %d()\n", PTR_ERR(pb_thr));
- + (void)printk (KERN_WARNING "powerbutton_init(): err: %d()\n", PTR_ERR(pb_thr));
- goto out_kthread;
- }
- @@ -425,6 +430,6 @@ static void __exit powerbutton_exit(void)
- module_init(powerbutton_init);
- module_exit(powerbutton_exit);
- -MODULE_DESCRIPTION("device driver for power button");
- +MODULE_DESCRIPTION("device driver for Quantron power button");
- MODULE_LICENSE("Dual BSD/GPL");
Quantron power button misc patch 20190205
Posted by Anonymous on Tue 5th Feb 2019 11:38
raw | new post
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.