X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fparisc%2Fpower.c;h=0bcab83b40804f751d173d4d2ee205ca715906f6;hb=26294aef29acca3e3c33b81e9da506c56c91f3b4;hp=ff75e9296df988031cb9a99cfe6fe52a50dd1e63;hpb=207e0a826fdee4bfe853681aef2175a739c11286;p=linux-2.6.git diff --git a/drivers/parisc/power.c b/drivers/parisc/power.c index ff75e9296..0bcab83b4 100644 --- a/drivers/parisc/power.c +++ b/drivers/parisc/power.c @@ -2,7 +2,7 @@ * linux/arch/parisc/kernel/power.c * HP PARISC soft power switch support driver * - * Copyright (c) 2001-2002 Helge Deller + * Copyright (c) 2001-2005 Helge Deller * All rights reserved. * * @@ -102,7 +102,7 @@ static DECLARE_WORK(poweroff_work, deferred_poweroff, NULL); static void poweroff(void) { - static int powering_off; + static int powering_off __read_mostly; if (powering_off) return; @@ -113,7 +113,7 @@ static void poweroff(void) /* local time-counter for shutdown */ -static int shutdown_timer; +static int shutdown_timer __read_mostly; /* check, give feedback and start shutdown after one second */ static void process_shutdown(void) @@ -139,7 +139,7 @@ static void process_shutdown(void) DECLARE_TASKLET_DISABLED(power_tasklet, NULL, 0); /* soft power switch enabled/disabled */ -int pwrsw_enabled = 1; +int pwrsw_enabled __read_mostly = 1; /* * On gecko style machines (e.g. 712/xx and 715/xx) @@ -149,7 +149,7 @@ int pwrsw_enabled = 1; */ static void gecko_tasklet_func(unsigned long unused) { - if (!pwrsw_enabled) + if (unlikely(!pwrsw_enabled)) return; if (__getDIAG(25) & 0x80000000) { @@ -173,7 +173,7 @@ static void polling_tasklet_func(unsigned long soft_power_reg) { unsigned long current_status; - if (!pwrsw_enabled) + if (unlikely(!pwrsw_enabled)) return; current_status = gsc_readl(soft_power_reg); @@ -251,7 +251,8 @@ static int __init power_init(void) } /* Register a call for panic conditions. */ - notifier_chain_register(&panic_notifier_list, &parisc_panic_block); + atomic_notifier_chain_register(&panic_notifier_list, + &parisc_panic_block); tasklet_enable(&power_tasklet); @@ -264,7 +265,8 @@ static void __exit power_exit(void) return; tasklet_disable(&power_tasklet); - notifier_chain_unregister(&panic_notifier_list, &parisc_panic_block); + atomic_notifier_chain_unregister(&panic_notifier_list, + &parisc_panic_block); power_tasklet.func = NULL; pdc_soft_power_button(0); }