···5555 struct list_head *node = NULL;5656 struct acpi_prt_entry *entry = NULL;57575858- ACPI_FUNCTION_TRACE("acpi_pci_irq_find_prt_entry");59586059 if (!acpi_prt.count)6161- return_PTR(NULL);6060+ return NULL;62616362 /*6463 * Parse through all PRT entries looking for a match on the specified···7273 && (device == entry->id.device)7374 && (pin == entry->pin)) {7475 spin_unlock(&acpi_prt_lock);7575- return_PTR(entry);7676+ return entry;7677 }7778 }78797980 spin_unlock(&acpi_prt_lock);8080- return_PTR(NULL);8181+ return NULL;8182}82838384static int···8687{8788 struct acpi_prt_entry *entry = NULL;88898989- ACPI_FUNCTION_TRACE("acpi_pci_irq_add_entry");90909191 if (!prt)9292- return_VALUE(-EINVAL);9292+ return -EINVAL;93939494 entry = kmalloc(sizeof(struct acpi_prt_entry), GFP_KERNEL);9595 if (!entry)9696- return_VALUE(-ENOMEM);9696+ return -ENOMEM;9797 memset(entry, 0, sizeof(struct acpi_prt_entry));98989999 entry->id.segment = segment;···139141 acpi_prt.count++;140142 spin_unlock(&acpi_prt_lock);141143142142- return_VALUE(0);144144+ return 0;143145}144146145147static void···161163 struct acpi_pci_routing_table *entry = NULL;162164 static int first_time = 1;163165164164- ACPI_FUNCTION_TRACE("acpi_pci_irq_add_prt");165166166167 pathname = (char *)kmalloc(ACPI_PATHNAME_MAX, GFP_KERNEL);167168 if (!pathname)168168- return_VALUE(-ENOMEM);169169+ return -ENOMEM;169170 memset(pathname, 0, ACPI_PATHNAME_MAX);170171171172 if (first_time) {···196199 if (status != AE_BUFFER_OVERFLOW) {197200 ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PRT [%s]",198201 acpi_format_exception(status)));199199- return_VALUE(-ENODEV);202202+ return -ENODEV;200203 }201204202205 prt = kmalloc(buffer.length, GFP_KERNEL);203206 if (!prt) {204204- return_VALUE(-ENOMEM);207207+ return -ENOMEM;205208 }206209 memset(prt, 0, buffer.length);207210 buffer.pointer = prt;···211214 ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PRT [%s]",212215 acpi_format_exception(status)));213216 kfree(buffer.pointer);214214- return_VALUE(-ENODEV);217217+ return -ENODEV;215218 }216219217220 entry = prt;···224227225228 kfree(prt);226229227227- return_VALUE(0);230230+ return 0;228231}229232230233void acpi_pci_irq_del_prt(int segment, int bus)···259262{260263 int irq;261264262262- ACPI_FUNCTION_TRACE("acpi_pci_allocate_irq");263265264266 if (entry->link.handle) {265267 irq = acpi_pci_link_allocate_irq(entry->link.handle,···267271 if (irq < 0) {268272 printk(KERN_WARNING PREFIX269273 "Invalid IRQ link routing entry\n");270270- return_VALUE(-1);274274+ return -1;271275 }272276 } else {273277 irq = entry->link.index;···276280 }277281278282 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found IRQ %d\n", irq));279279- return_VALUE(irq);283283+ return irq;280284}281285282286static int···285289{286290 int irq;287291288288- ACPI_FUNCTION_TRACE("acpi_pci_free_irq");289292 if (entry->link.handle) {290293 irq = acpi_pci_link_free_irq(entry->link.handle);291294 } else {292295 irq = entry->link.index;293296 }294294- return_VALUE(irq);297297+ return irq;295298}296299297300/*···310315 int bus_nr = bus->number;311316 int ret;312317313313- ACPI_FUNCTION_TRACE("acpi_pci_irq_lookup");314318315319 ACPI_DEBUG_PRINT((ACPI_DB_INFO,316320 "Searching for PRT entry for %02x:%02x:%02x[%c]\n",···318324 entry = acpi_pci_irq_find_prt_entry(segment, bus_nr, device, pin);319325 if (!entry) {320326 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "PRT entry not found\n"));321321- return_VALUE(-1);327327+ return -1;322328 }323329324330 ret = func(entry, triggering, polarity, link);325325- return_VALUE(ret);331331+ return ret;326332}327333328334/*···340346 int irq = -1;341347 u8 bridge_pin = 0;342348343343- ACPI_FUNCTION_TRACE("acpi_pci_irq_derive");344349345350 if (!dev)346346- return_VALUE(-EINVAL);351351+ return -EINVAL;347352348353 /* 349354 * Attempt to derive an IRQ for this device from a parent bridge's···359366 ACPI_DEBUG_PRINT((ACPI_DB_INFO,360367 "No interrupt pin configured for device %s\n",361368 pci_name(bridge)));362362- return_VALUE(-1);369369+ return -1;363370 }364371 /* Pin is from 0 to 3 */365372 bridge_pin--;···374381 if (irq < 0) {375382 printk(KERN_WARNING PREFIX "Unable to derive IRQ for device %s\n",376383 pci_name(dev));377377- return_VALUE(-1);384384+ return -1;378385 }379386380387 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Derive IRQ %d for device %s from %s\n",381388 irq, pci_name(dev), pci_name(bridge)));382389383383- return_VALUE(irq);390390+ return irq;384391}385392386393/*···398405 char *link = NULL;399406 int rc;400407401401- ACPI_FUNCTION_TRACE("acpi_pci_irq_enable");402408403409 if (!dev)404404- return_VALUE(-EINVAL);410410+ return -EINVAL;405411406412 pin = dev->pin;407413 if (!pin) {408414 ACPI_DEBUG_PRINT((ACPI_DB_INFO,409415 "No interrupt pin configured for device %s\n",410416 pci_name(dev)));411411- return_VALUE(0);417417+ return 0;412418 }413419 pin--;414420415421 if (!dev->bus) {416422 printk(KERN_ERR PREFIX "Invalid (NULL) 'bus' field\n");417417- return_VALUE(-ENODEV);423423+ return -ENODEV;418424 }419425420426 /* ···445453 printk(" - using IRQ %d\n", dev->irq);446454 acpi_register_gsi(dev->irq, ACPI_LEVEL_SENSITIVE,447455 ACPI_ACTIVE_LOW);448448- return_VALUE(0);456456+ return 0;449457 } else {450458 printk("\n");451451- return_VALUE(0);459459+ return 0;452460 }453461 }454462···456464 if (rc < 0) {457465 printk(KERN_WARNING PREFIX "PCI Interrupt %s[%c]: failed "458466 "to register GSI\n", pci_name(dev), ('A' + pin));459459- return_VALUE(rc);467467+ return rc;460468 }461469 dev->irq = rc;462470···470478 (triggering == ACPI_LEVEL_SENSITIVE) ? "level" : "edge",471479 (polarity == ACPI_ACTIVE_LOW) ? "low" : "high", dev->irq);472480473473- return_VALUE(0);481481+ return 0;474482}475483476484EXPORT_SYMBOL(acpi_pci_irq_enable);···487495 int triggering = ACPI_LEVEL_SENSITIVE;488496 int polarity = ACPI_ACTIVE_LOW;489497490490- ACPI_FUNCTION_TRACE("acpi_pci_irq_disable");491498492499 if (!dev || !dev->bus)493493- return_VOID;500500+ return;494501495502 pin = dev->pin;496503 if (!pin)497497- return_VOID;504504+ return;498505 pin--;499506500507 /*···511520 &triggering, &polarity, NULL,512521 acpi_pci_free_irq);513522 if (gsi < 0)514514- return_VOID;523523+ return;515524516525 /*517526 * TBD: It might be worth clearing dev->irq by magic constant···523532524533 acpi_unregister_gsi(gsi);525534526526- return_VOID;535535+ return;527536}
+45-60
drivers/acpi/pci_link.c
···107107 struct acpi_pci_link *link = (struct acpi_pci_link *)context;108108 u32 i = 0;109109110110- ACPI_FUNCTION_TRACE("acpi_pci_link_check_possible");111110112111 switch (resource->type) {113112 case ACPI_RESOURCE_TYPE_START_DEPENDENT:114114- return_ACPI_STATUS(AE_OK);113113+ return AE_OK;115114 case ACPI_RESOURCE_TYPE_IRQ:116115 {117116 struct acpi_resource_irq *p = &resource->data.irq;118117 if (!p || !p->interrupt_count) {119118 printk(KERN_WARNING PREFIX "Blank IRQ resource\n");120120- return_ACPI_STATUS(AE_OK);119119+ return AE_OK;121120 }122121 for (i = 0;123122 (i < p->interrupt_count···141142 if (!p || !p->interrupt_count) {142143 printk(KERN_WARNING PREFIX143144 "Blank EXT IRQ resource\n");144144- return_ACPI_STATUS(AE_OK);145145+ return AE_OK;145146 }146147 for (i = 0;147148 (i < p->interrupt_count···161162 }162163 default:163164 printk(KERN_ERR PREFIX "Resource is not an IRQ entry\n");164164- return_ACPI_STATUS(AE_OK);165165+ return AE_OK;165166 }166167167167- return_ACPI_STATUS(AE_CTRL_TERMINATE);168168+ return AE_CTRL_TERMINATE;168169}169170170171static int acpi_pci_link_get_possible(struct acpi_pci_link *link)171172{172173 acpi_status status;173174174174- ACPI_FUNCTION_TRACE("acpi_pci_link_get_possible");175175176176 if (!link)177177- return_VALUE(-EINVAL);177177+ return -EINVAL;178178179179 status = acpi_walk_resources(link->handle, METHOD_NAME__PRS,180180 acpi_pci_link_check_possible, link);181181 if (ACPI_FAILURE(status)) {182182 ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PRS"));183183- return_VALUE(-ENODEV);183183+ return -ENODEV;184184 }185185186186 ACPI_DEBUG_PRINT((ACPI_DB_INFO,187187 "Found %d possible IRQs\n",188188 link->irq.possible_count));189189190190- return_VALUE(0);190190+ return 0;191191}192192193193static acpi_status···194196{195197 int *irq = (int *)context;196198197197- ACPI_FUNCTION_TRACE("acpi_pci_link_check_current");198199199200 switch (resource->type) {200201 case ACPI_RESOURCE_TYPE_IRQ:···206209 */207210 ACPI_DEBUG_PRINT((ACPI_DB_INFO,208211 "Blank IRQ resource\n"));209209- return_ACPI_STATUS(AE_OK);212212+ return AE_OK;210213 }211214 *irq = p->interrupts[0];212215 break;···222225 */223226 printk(KERN_WARNING PREFIX224227 "Blank EXT IRQ resource\n");225225- return_ACPI_STATUS(AE_OK);228228+ return AE_OK;226229 }227230 *irq = p->interrupts[0];228231 break;···231234 default:232235 printk(KERN_ERR PREFIX "Resource %d isn't an IRQ\n", resource->type);233236 case ACPI_RESOURCE_TYPE_END_TAG:234234- return_ACPI_STATUS(AE_OK);237237+ return AE_OK;235238 }236236- return_ACPI_STATUS(AE_CTRL_TERMINATE);239239+ return AE_CTRL_TERMINATE;237240}238241239242/*···249252 acpi_status status = AE_OK;250253 int irq = 0;251254252252- ACPI_FUNCTION_TRACE("acpi_pci_link_get_current");253255254256 if (!link || !link->handle)255255- return_VALUE(-EINVAL);257257+ return -EINVAL;256258257259 link->irq.active = 0;258260···266270267271 if (!link->device->status.enabled) {268272 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Link disabled\n"));269269- return_VALUE(0);273273+ return 0;270274 }271275 }272276···292296 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Link at IRQ %d \n", link->irq.active));293297294298 end:295295- return_VALUE(result);299299+ return result;296300}297301298302static int acpi_pci_link_set(struct acpi_pci_link *link, int irq)···305309 } *resource;306310 struct acpi_buffer buffer = { 0, NULL };307311308308- ACPI_FUNCTION_TRACE("acpi_pci_link_set");309312310313 if (!link || !irq)311311- return_VALUE(-EINVAL);314314+ return -EINVAL;312315313316 resource = kmalloc(sizeof(*resource) + 1, GFP_ATOMIC);314317 if (!resource)315315- return_VALUE(-ENOMEM);318318+ return -ENOMEM;316319317320 memset(resource, 0, sizeof(*resource) + 1);318321 buffer.length = sizeof(*resource) + 1;···408413409414 end:410415 kfree(resource);411411- return_VALUE(result);416416+ return result;412417}413418414419/* --------------------------------------------------------------------------···482487 struct acpi_pci_link *link = NULL;483488 int i = 0;484489485485- ACPI_FUNCTION_TRACE("acpi_irq_penalty_init");486490487491 /*488492 * Update penalties to facilitate IRQ balancing.···518524 /* Add a penalty for the SCI */519525 acpi_irq_penalty[acpi_fadt.sci_int] += PIRQ_PENALTY_PCI_USING;520526521521- return_VALUE(0);527527+ return 0;522528}523529524530static int acpi_irq_balance; /* 0: static, 1: balance */···528534 int irq;529535 int i;530536531531- ACPI_FUNCTION_TRACE("acpi_pci_link_allocate");532537533538 if (link->irq.initialized) {534539 if (link->refcnt == 0)535540 /* This means the link is disabled but initialized */536541 acpi_pci_link_set(link, link->irq.active);537537- return_VALUE(0);542542+ return 0;538543 }539544540545 /*···580587 "Try pci=noacpi or acpi=off\n",581588 acpi_device_name(link->device),582589 acpi_device_bid(link->device));583583- return_VALUE(-ENODEV);590590+ return -ENODEV;584591 } else {585592 acpi_irq_penalty[link->irq.active] += PIRQ_PENALTY_PCI_USING;586593 printk(PREFIX "%s [%s] enabled at IRQ %d\n",···590597591598 link->irq.initialized = 1;592599593593- return_VALUE(0);600600+ return 0;594601}595602596603/*···608615 struct acpi_device *device = NULL;609616 struct acpi_pci_link *link = NULL;610617611611- ACPI_FUNCTION_TRACE("acpi_pci_link_allocate_irq");612618613619 result = acpi_bus_get_device(handle, &device);614620 if (result) {615621 printk(KERN_ERR PREFIX "Invalid link device\n");616616- return_VALUE(-1);622622+ return -1;617623 }618624619625 link = (struct acpi_pci_link *)acpi_driver_data(device);620626 if (!link) {621627 printk(KERN_ERR PREFIX "Invalid link context\n");622622- return_VALUE(-1);628628+ return -1;623629 }624630625631 /* TBD: Support multiple index (IRQ) entries per Link Device */626632 if (index) {627633 printk(KERN_ERR PREFIX "Invalid index %d\n", index);628628- return_VALUE(-1);634634+ return -1;629635 }630636631637 mutex_lock(&acpi_link_lock);632638 if (acpi_pci_link_allocate(link)) {633639 mutex_unlock(&acpi_link_lock);634634- return_VALUE(-1);640640+ return -1;635641 }636642637643 if (!link->irq.active) {638644 mutex_unlock(&acpi_link_lock);639645 printk(KERN_ERR PREFIX "Link active IRQ is 0!\n");640640- return_VALUE(-1);646646+ return -1;641647 }642648 link->refcnt++;643649 mutex_unlock(&acpi_link_lock);···650658 ACPI_DEBUG_PRINT((ACPI_DB_INFO,651659 "Link %s is referenced\n",652660 acpi_device_bid(link->device)));653653- return_VALUE(link->irq.active);661661+ return (link->irq.active);654662}655663656664/*···663671 struct acpi_pci_link *link = NULL;664672 acpi_status result;665673666666- ACPI_FUNCTION_TRACE("acpi_pci_link_free_irq");667674668675 result = acpi_bus_get_device(handle, &device);669676 if (result) {670677 printk(KERN_ERR PREFIX "Invalid link device\n");671671- return_VALUE(-1);678678+ return -1;672679 }673680674681 link = (struct acpi_pci_link *)acpi_driver_data(device);675682 if (!link) {676683 printk(KERN_ERR PREFIX "Invalid link context\n");677677- return_VALUE(-1);684684+ return -1;678685 }679686680687 mutex_lock(&acpi_link_lock);681688 if (!link->irq.initialized) {682689 mutex_unlock(&acpi_link_lock);683690 printk(KERN_ERR PREFIX "Link isn't initialized\n");684684- return_VALUE(-1);691691+ return -1;685692 }686693#ifdef FUTURE_USE687694 /*···702711 acpi_ut_evaluate_object(link->handle, "_DIS", 0, NULL);703712 }704713 mutex_unlock(&acpi_link_lock);705705- return_VALUE(link->irq.active);714714+ return (link->irq.active);706715}707716708717/* --------------------------------------------------------------------------···716725 int i = 0;717726 int found = 0;718727719719- ACPI_FUNCTION_TRACE("acpi_pci_link_add");720728721729 if (!device)722722- return_VALUE(-EINVAL);730730+ return -EINVAL;723731724732 link = kmalloc(sizeof(struct acpi_pci_link), GFP_KERNEL);725733 if (!link)726726- return_VALUE(-ENOMEM);734734+ return -ENOMEM;727735 memset(link, 0, sizeof(struct acpi_pci_link));728736729737 link->device = device;···771781 if (result)772782 kfree(link);773783774774- return_VALUE(result);784784+ return result;775785}776786777787static int acpi_pci_link_resume(struct acpi_pci_link *link)778788{779779- ACPI_FUNCTION_TRACE("acpi_pci_link_resume");780789781790 if (link->refcnt && link->irq.active && link->irq.initialized)782782- return_VALUE(acpi_pci_link_set(link, link->irq.active));791791+ return (acpi_pci_link_set(link, link->irq.active));783792 else784784- return_VALUE(0);793793+ return 0;785794}786795787796/*···793804 struct list_head *node = NULL;794805 struct acpi_pci_link *link = NULL;795806796796- ACPI_FUNCTION_TRACE("irqrouter_resume");797807798808 /* Make sure SCI is enabled again (Apple firmware bug?) */799809 acpi_set_register(ACPI_BITREG_SCI_ENABLE, 1, ACPI_MTX_DO_NOT_LOCK);···807819 acpi_pci_link_resume(link);808820 }809821 acpi_in_resume = 0;810810- return_VALUE(0);822822+ return 0;811823}812824813825static int acpi_pci_link_remove(struct acpi_device *device, int type)814826{815827 struct acpi_pci_link *link = NULL;816828817817- ACPI_FUNCTION_TRACE("acpi_pci_link_remove");818829819830 if (!device || !acpi_driver_data(device))820820- return_VALUE(-EINVAL);831831+ return -EINVAL;821832822833 link = (struct acpi_pci_link *)acpi_driver_data(device);823834···826839827840 kfree(link);828841829829- return_VALUE(0);842842+ return 0;830843}831844832845/*···932945{933946 int error;934947935935- ACPI_FUNCTION_TRACE("irqrouter_init_sysfs");936948937949 if (acpi_disabled || acpi_noirq)938938- return_VALUE(0);950950+ return 0;939951940952 error = sysdev_class_register(&irqrouter_sysdev_class);941953 if (!error)942954 error = sysdev_register(&device_irqrouter);943955944944- return_VALUE(error);956956+ return error;945957}946958947959device_initcall(irqrouter_init_sysfs);948960949961static int __init acpi_pci_link_init(void)950962{951951- ACPI_FUNCTION_TRACE("acpi_pci_link_init");952963953964 if (acpi_noirq)954954- return_VALUE(0);965965+ return 0;955966956967 acpi_link.count = 0;957968 INIT_LIST_HEAD(&acpi_link.entries);958969959970 if (acpi_bus_register_driver(&acpi_pci_link_driver) < 0)960960- return_VALUE(-ENODEV);971971+ return -ENODEV;961972962962- return_VALUE(0);973973+ return 0;963974}964975965976subsys_initcall(acpi_pci_link_init);
+10-14
drivers/acpi/pci_root.c
···160160 unsigned long value = 0;161161 acpi_handle handle = NULL;162162163163- ACPI_FUNCTION_TRACE("acpi_pci_root_add");164163165164 if (!device)166166- return_VALUE(-EINVAL);165165+ return -EINVAL;167166168167 root = kmalloc(sizeof(struct acpi_pci_root), GFP_KERNEL);169168 if (!root)170170- return_VALUE(-ENOMEM);169169+ return -ENOMEM;171170 memset(root, 0, sizeof(struct acpi_pci_root));172171 INIT_LIST_HEAD(&root->node);173172···306307 kfree(root);307308 }308309309309- return_VALUE(result);310310+ return result;310311}311312312313static int acpi_pci_root_start(struct acpi_device *device)313314{314315 struct acpi_pci_root *root;315316316316- ACPI_FUNCTION_TRACE("acpi_pci_root_start");317317318318 list_for_each_entry(root, &acpi_pci_roots, node) {319319 if (root->handle == device->handle) {320320 pci_bus_add_devices(root->bus);321321- return_VALUE(0);321321+ return 0;322322 }323323 }324324- return_VALUE(-ENODEV);324324+ return -ENODEV;325325}326326327327static int acpi_pci_root_remove(struct acpi_device *device, int type)328328{329329 struct acpi_pci_root *root = NULL;330330331331- ACPI_FUNCTION_TRACE("acpi_pci_root_remove");332331333332 if (!device || !acpi_driver_data(device))334334- return_VALUE(-EINVAL);333333+ return -EINVAL;335334336335 root = (struct acpi_pci_root *)acpi_driver_data(device);337336338337 kfree(root);339338340340- return_VALUE(0);339339+ return 0;341340}342341343342static int __init acpi_pci_root_init(void)344343{345345- ACPI_FUNCTION_TRACE("acpi_pci_root_init");346344347345 if (acpi_pci_disabled)348348- return_VALUE(0);346346+ return 0;349347350348 /* DEBUG:351349 acpi_dbg_layer = ACPI_PCI_COMPONENT;···350354 */351355352356 if (acpi_bus_register_driver(&acpi_pci_root_driver) < 0)353353- return_VALUE(-ENODEV);357357+ return -ENODEV;354358355355- return_VALUE(0);359359+ return 0;356360}357361358362subsys_initcall(acpi_pci_root_init);
+55-70
drivers/acpi/power.c
···9898 int result = 0;9999 struct acpi_device *device = NULL;100100101101- ACPI_FUNCTION_TRACE("acpi_power_get_context");102101103102 if (!resource)104104- return_VALUE(-ENODEV);103103+ return -ENODEV;105104106105 result = acpi_bus_get_device(handle, &device);107106 if (result) {108107 printk(KERN_WARNING PREFIX "Getting context [%p]\n", handle);109109- return_VALUE(result);108108+ return result;110109 }111110112111 *resource = (struct acpi_power_resource *)acpi_driver_data(device);113112 if (!resource)114114- return_VALUE(-ENODEV);113113+ return -ENODEV;115114116116- return_VALUE(0);115115+ return 0;117116}118117119118static int acpi_power_get_state(struct acpi_power_resource *resource)···120121 acpi_status status = AE_OK;121122 unsigned long sta = 0;122123123123- ACPI_FUNCTION_TRACE("acpi_power_get_state");124124125125 if (!resource)126126- return_VALUE(-EINVAL);126126+ return -EINVAL;127127128128 status = acpi_evaluate_integer(resource->handle, "_STA", NULL, &sta);129129 if (ACPI_FAILURE(status))130130- return_VALUE(-ENODEV);130130+ return -ENODEV;131131132132 if (sta & 0x01)133133 resource->state = ACPI_POWER_RESOURCE_STATE_ON;···136138 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] is %s\n",137139 resource->name, resource->state ? "on" : "off"));138140139139- return_VALUE(0);141141+ return 0;140142}141143142144static int acpi_power_get_list_state(struct acpi_handle_list *list, int *state)···145147 struct acpi_power_resource *resource = NULL;146148 u32 i = 0;147149148148- ACPI_FUNCTION_TRACE("acpi_power_get_list_state");149150150151 if (!list || !state)151151- return_VALUE(-EINVAL);152152+ return -EINVAL;152153153154 /* The state of the list is 'on' IFF all resources are 'on'. */154155155156 for (i = 0; i < list->count; i++) {156157 result = acpi_power_get_context(list->handles[i], &resource);157158 if (result)158158- return_VALUE(result);159159+ return result;159160 result = acpi_power_get_state(resource);160161 if (result)161161- return_VALUE(result);162162+ return result;162163163164 *state = resource->state;164165···168171 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource list is %s\n",169172 *state ? "on" : "off"));170173171171- return_VALUE(result);174174+ return result;172175}173176174177static int acpi_power_on(acpi_handle handle)···178181 struct acpi_device *device = NULL;179182 struct acpi_power_resource *resource = NULL;180183181181- ACPI_FUNCTION_TRACE("acpi_power_on");182184183185 result = acpi_power_get_context(handle, &resource);184186 if (result)185185- return_VALUE(result);187187+ return result;186188187189 resource->references++;188190···189193 || (resource->state == ACPI_POWER_RESOURCE_STATE_ON)) {190194 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] already on\n",191195 resource->name));192192- return_VALUE(0);196196+ return 0;193197 }194198195199 status = acpi_evaluate_object(resource->handle, "_ON", NULL, NULL);196200 if (ACPI_FAILURE(status))197197- return_VALUE(-ENODEV);201201+ return -ENODEV;198202199203 result = acpi_power_get_state(resource);200204 if (result)201201- return_VALUE(result);205205+ return result;202206 if (resource->state != ACPI_POWER_RESOURCE_STATE_ON)203203- return_VALUE(-ENOEXEC);207207+ return -ENOEXEC;204208205209 /* Update the power resource's _device_ power state */206210 result = acpi_bus_get_device(resource->handle, &device);207211 if (result)208208- return_VALUE(result);212212+ return result;209213 device->power.state = ACPI_STATE_D0;210214211215 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] turned on\n",212216 resource->name));213217214214- return_VALUE(0);218218+ return 0;215219}216220217221static int acpi_power_off_device(acpi_handle handle)···221225 struct acpi_device *device = NULL;222226 struct acpi_power_resource *resource = NULL;223227224224- ACPI_FUNCTION_TRACE("acpi_power_off_device");225228226229 result = acpi_power_get_context(handle, &resource);227230 if (result)228228- return_VALUE(result);231231+ return result;229232230233 if (resource->references)231234 resource->references--;···233238 ACPI_DEBUG_PRINT((ACPI_DB_INFO,234239 "Resource [%s] is still in use, dereferencing\n",235240 device->pnp.bus_id));236236- return_VALUE(0);241241+ return 0;237242 }238243239244 if (resource->state == ACPI_POWER_RESOURCE_STATE_OFF) {240245 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] already off\n",241246 device->pnp.bus_id));242242- return_VALUE(0);247247+ return 0;243248 }244249245250 status = acpi_evaluate_object(resource->handle, "_OFF", NULL, NULL);246251 if (ACPI_FAILURE(status))247247- return_VALUE(-ENODEV);252252+ return -ENODEV;248253249254 result = acpi_power_get_state(resource);250255 if (result)251251- return_VALUE(result);256256+ return result;252257 if (resource->state != ACPI_POWER_RESOURCE_STATE_OFF)253253- return_VALUE(-ENOEXEC);258258+ return -ENOEXEC;254259255260 /* Update the power resource's _device_ power state */256261 result = acpi_bus_get_device(resource->handle, &device);257262 if (result)258258- return_VALUE(result);263263+ return result;259264 device->power.state = ACPI_STATE_D3;260265261266 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] turned off\n",262267 resource->name));263268264264- return_VALUE(0);269269+ return 0;265270}266271267272/*···277282 int i;278283 int ret = 0;279284280280- ACPI_FUNCTION_TRACE("acpi_enable_wakeup_device_power");281285 if (!dev || !dev->wakeup.flags.valid)282282- return_VALUE(-1);286286+ return -1;283287284288 arg.integer.value = 1;285289 /* Open power resource */···287293 if (ret) {288294 printk(KERN_ERR PREFIX "Transition power state\n");289295 dev->wakeup.flags.valid = 0;290290- return_VALUE(-1);296296+ return -1;291297 }292298 }293299···299305 ret = -1;300306 }301307302302- return_VALUE(ret);308308+ return ret;303309}304310305311/*···315321 int i;316322 int ret = 0;317323318318- ACPI_FUNCTION_TRACE("acpi_disable_wakeup_device_power");319324320325 if (!dev || !dev->wakeup.flags.valid)321321- return_VALUE(-1);326326+ return -1;322327323328 arg.integer.value = 0;324329 /* Execute PSW */···325332 if (ACPI_FAILURE(status) && (status != AE_NOT_FOUND)) {326333 printk(KERN_ERR PREFIX "Evaluate _PSW\n");327334 dev->wakeup.flags.valid = 0;328328- return_VALUE(-1);335335+ return -1;329336 }330337331338 /* Close power resource */···334341 if (ret) {335342 printk(KERN_ERR PREFIX "Transition power state\n");336343 dev->wakeup.flags.valid = 0;337337- return_VALUE(-1);344344+ return -1;338345 }339346 }340347341341- return_VALUE(ret);348348+ return ret;342349}343350344351/* --------------------------------------------------------------------------···352359 int list_state = 0;353360 int i = 0;354361355355- ACPI_FUNCTION_TRACE("acpi_power_get_inferred_state");356362357363 if (!device)358358- return_VALUE(-EINVAL);364364+ return -EINVAL;359365360366 device->power.state = ACPI_STATE_UNKNOWN;361367···369377370378 result = acpi_power_get_list_state(list, &list_state);371379 if (result)372372- return_VALUE(result);380380+ return result;373381374382 if (list_state == ACPI_POWER_RESOURCE_STATE_ON) {375383 device->power.state = i;376376- return_VALUE(0);384384+ return 0;377385 }378386 }379387380388 device->power.state = ACPI_STATE_D3;381389382382- return_VALUE(0);390390+ return 0;383391}384392385393int acpi_power_transition(struct acpi_device *device, int state)···389397 struct acpi_handle_list *tl = NULL; /* Target Resources */390398 int i = 0;391399392392- ACPI_FUNCTION_TRACE("acpi_power_transition");393400394401 if (!device || (state < ACPI_STATE_D0) || (state > ACPI_STATE_D3))395395- return_VALUE(-EINVAL);402402+ return -EINVAL;396403397404 if ((device->power.state < ACPI_STATE_D0)398405 || (device->power.state > ACPI_STATE_D3))399399- return_VALUE(-ENODEV);406406+ return -ENODEV;400407401408 cl = &device->power.states[device->power.state].resources;402409 tl = &device->power.states[state].resources;···435444 printk(KERN_WARNING PREFIX "Transitioning device [%s] to D%d\n",436445 device->pnp.bus_id, state);437446438438- return_VALUE(result);447447+ return result;439448}440449441450/* --------------------------------------------------------------------------···448457{449458 struct acpi_power_resource *resource = NULL;450459451451- ACPI_FUNCTION_TRACE("acpi_power_seq_show");452460453461 resource = (struct acpi_power_resource *)seq->private;454462···474484 resource->order, resource->references);475485476486 end:477477- return_VALUE(0);487487+ return 0;478488}479489480490static int acpi_power_open_fs(struct inode *inode, struct file *file)···486496{487497 struct proc_dir_entry *entry = NULL;488498489489- ACPI_FUNCTION_TRACE("acpi_power_add_fs");490499491500 if (!device)492492- return_VALUE(-EINVAL);501501+ return -EINVAL;493502494503 if (!acpi_device_dir(device)) {495504 acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device),496505 acpi_power_dir);497506 if (!acpi_device_dir(device))498498- return_VALUE(-ENODEV);507507+ return -ENODEV;499508 }500509501510 /* 'status' [R] */502511 entry = create_proc_entry(ACPI_POWER_FILE_STATUS,503512 S_IRUGO, acpi_device_dir(device));504513 if (!entry)505505- return_VALUE(-EIO);514514+ return -EIO;506515 else {507516 entry->proc_fops = &acpi_power_fops;508517 entry->data = acpi_driver_data(device);509518 }510519511511- return_VALUE(0);520520+ return 0;512521}513522514523static int acpi_power_remove_fs(struct acpi_device *device)515524{516516- ACPI_FUNCTION_TRACE("acpi_power_remove_fs");517525518526 if (acpi_device_dir(device)) {519527 remove_proc_entry(ACPI_POWER_FILE_STATUS,···520532 acpi_device_dir(device) = NULL;521533 }522534523523- return_VALUE(0);535535+ return 0;524536}525537526538/* --------------------------------------------------------------------------···535547 union acpi_object acpi_object;536548 struct acpi_buffer buffer = { sizeof(acpi_object), &acpi_object };537549538538- ACPI_FUNCTION_TRACE("acpi_power_add");539550540551 if (!device)541541- return_VALUE(-EINVAL);552552+ return -EINVAL;542553543554 resource = kmalloc(sizeof(struct acpi_power_resource), GFP_KERNEL);544555 if (!resource)545545- return_VALUE(-ENOMEM);556556+ return -ENOMEM;546557 memset(resource, 0, sizeof(struct acpi_power_resource));547558548559 resource->handle = device->handle;···586599 if (result)587600 kfree(resource);588601589589- return_VALUE(result);602602+ return result;590603}591604592605static int acpi_power_remove(struct acpi_device *device, int type)593606{594607 struct acpi_power_resource *resource = NULL;595608596596- ACPI_FUNCTION_TRACE("acpi_power_remove");597609598610 if (!device || !acpi_driver_data(device))599599- return_VALUE(-EINVAL);611611+ return -EINVAL;600612601613 resource = (struct acpi_power_resource *)acpi_driver_data(device);602614···603617604618 kfree(resource);605619606606- return_VALUE(0);620620+ return 0;607621}608622609623static int __init acpi_power_init(void)610624{611625 int result = 0;612626613613- ACPI_FUNCTION_TRACE("acpi_power_init");614627615628 if (acpi_disabled)616616- return_VALUE(0);629629+ return 0;617630618631 INIT_LIST_HEAD(&acpi_power_resource_list);619632620633 acpi_power_dir = proc_mkdir(ACPI_POWER_CLASS, acpi_root_dir);621634 if (!acpi_power_dir)622622- return_VALUE(-ENODEV);635635+ return -ENODEV;623636624637 result = acpi_bus_register_driver(&acpi_power_driver);625638 if (result < 0) {626639 remove_proc_entry(ACPI_POWER_CLASS, acpi_root_dir);627627- return_VALUE(-ENODEV);640640+ return -ENODEV;628641 }629642630630- return_VALUE(0);643643+ return 0;631644}632645633646subsys_initcall(acpi_power_init);
+47-64
drivers/acpi/processor_core.c
···122122 u8 value1 = 0;123123 u8 value2 = 0;124124125125- ACPI_FUNCTION_TRACE("acpi_processor_errata_piix4");126125127126 if (!dev)128128- return_VALUE(-EINVAL);127127+ return -EINVAL;129128130129 /*131130 * Note that 'dev' references the PIIX4 ACPI Controller.···217218 ACPI_DEBUG_PRINT((ACPI_DB_INFO,218219 "Type-F DMA livelock erratum (C3 disabled)\n"));219220220220- return_VALUE(0);221221+ return 0;221222}222223223224static int acpi_processor_errata(struct acpi_processor *pr)···225226 int result = 0;226227 struct pci_dev *dev = NULL;227228228228- ACPI_FUNCTION_TRACE("acpi_processor_errata");229229230230 if (!pr)231231- return_VALUE(-EINVAL);231231+ return -EINVAL;232232233233 /*234234 * PIIX4···240242 pci_dev_put(dev);241243 }242244243243- return_VALUE(result);245245+ return result;244246}245247246248/* --------------------------------------------------------------------------···256258 struct acpi_object_list *pdc_in = pr->pdc;257259 acpi_status status = AE_OK;258260259259- ACPI_FUNCTION_TRACE("acpi_processor_set_pdc");260261261262 if (!pdc_in)262262- return_VALUE(status);263263+ return status;263264264265 status = acpi_evaluate_object(pr->handle, "_PDC", pdc_in, NULL);265266···266269 ACPI_DEBUG_PRINT((ACPI_DB_INFO,267270 "Could not evaluate _PDC, using legacy perf. control...\n"));268271269269- return_VALUE(status);272272+ return status;270273}271274272275/* --------------------------------------------------------------------------···279282{280283 struct acpi_processor *pr = (struct acpi_processor *)seq->private;281284282282- ACPI_FUNCTION_TRACE("acpi_processor_info_seq_show");283285284286 if (!pr)285287 goto end;···297301 pr->flags.limit ? "yes" : "no");298302299303 end:300300- return_VALUE(0);304304+ return 0;301305}302306303307static int acpi_processor_info_open_fs(struct inode *inode, struct file *file)···310314{311315 struct proc_dir_entry *entry = NULL;312316313313- ACPI_FUNCTION_TRACE("acpi_processor_add_fs");314317315318 if (!acpi_device_dir(device)) {316319 acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device),317320 acpi_processor_dir);318321 if (!acpi_device_dir(device))319319- return_VALUE(-ENODEV);322322+ return -ENODEV;320323 }321324 acpi_device_dir(device)->owner = THIS_MODULE;322325···323328 entry = create_proc_entry(ACPI_PROCESSOR_FILE_INFO,324329 S_IRUGO, acpi_device_dir(device));325330 if (!entry)326326- return_VALUE(-EIO);331331+ return -EIO;327332 else {328333 entry->proc_fops = &acpi_processor_info_fops;329334 entry->data = acpi_driver_data(device);···335340 S_IFREG | S_IRUGO | S_IWUSR,336341 acpi_device_dir(device));337342 if (!entry)338338- return_VALUE(-EIO);343343+ return -EIO;339344 else {340345 entry->proc_fops = &acpi_processor_throttling_fops;341346 entry->data = acpi_driver_data(device);···347352 S_IFREG | S_IRUGO | S_IWUSR,348353 acpi_device_dir(device));349354 if (!entry)350350- return_VALUE( -EIO);355355+ return -EIO;351356 else {352357 entry->proc_fops = &acpi_processor_limit_fops;353358 entry->data = acpi_driver_data(device);354359 entry->owner = THIS_MODULE;355360 }356361357357- return_VALUE(0);362362+ return 0;358363}359364360365static int acpi_processor_remove_fs(struct acpi_device *device)361366{362362- ACPI_FUNCTION_TRACE("acpi_processor_remove_fs");363367364368 if (acpi_device_dir(device)) {365369 remove_proc_entry(ACPI_PROCESSOR_FILE_INFO,···371377 acpi_device_dir(device) = NULL;372378 }373379374374- return_VALUE(0);380380+ return 0;375381}376382377383/* Use the acpiid in MADT to map cpus in case of SMP */···418424 int cpu_index;419425 static int cpu0_initialized;420426421421- ACPI_FUNCTION_TRACE("acpi_processor_get_info");422427423428 if (!pr)424424- return_VALUE(-EINVAL);429429+ return -EINVAL;425430426431 if (num_online_cpus() > 1)427432 errata.smp = TRUE;···447454 status = acpi_evaluate_object(pr->handle, NULL, NULL, &buffer);448455 if (ACPI_FAILURE(status)) {449456 printk(KERN_ERR PREFIX "Evaluating processor object\n");450450- return_VALUE(-ENODEV);457457+ return -ENODEV;451458 }452459453460 /*···479486 printk(KERN_ERR PREFIX480487 "Getting cpuindex for acpiid 0x%x\n",481488 pr->acpi_id);482482- return_VALUE(-ENODEV);489489+ return -ENODEV;483490 }484491 }485492···514521 acpi_processor_get_throttling_info(pr);515522 acpi_processor_get_limit_info(pr);516523517517- return_VALUE(0);524524+ return 0;518525}519526520527static void *processor_device_array[NR_CPUS];···525532 acpi_status status = AE_OK;526533 struct acpi_processor *pr;527534528528- ACPI_FUNCTION_TRACE("acpi_processor_start");529535530536 pr = acpi_driver_data(device);531537532538 result = acpi_processor_get_info(pr);533539 if (result) {534540 /* Processor is physically not present */535535- return_VALUE(0);541541+ return 0;536542 }537543538544 BUG_ON((pr->id >= NR_CPUS) || (pr->id < 0));···545553 processor_device_array[pr->id] != (void *)device) {546554 printk(KERN_WARNING "BIOS reported wrong ACPI id"547555 "for the processor\n");548548- return_VALUE(-ENODEV);556556+ return -ENODEV;549557 }550558 processor_device_array[pr->id] = (void *)device;551559···573581574582 end:575583576576- return_VALUE(result);584584+ return result;577585}578586579587static void acpi_processor_notify(acpi_handle handle, u32 event, void *data)···581589 struct acpi_processor *pr = (struct acpi_processor *)data;582590 struct acpi_device *device = NULL;583591584584- ACPI_FUNCTION_TRACE("acpi_processor_notify");585592586593 if (!pr)587587- return_VOID;594594+ return;588595589596 if (acpi_bus_get_device(pr->handle, &device))590590- return_VOID;597597+ return;591598592599 switch (event) {593600 case ACPI_PROCESSOR_NOTIFY_PERFORMANCE:···604613 break;605614 }606615607607- return_VOID;616616+ return;608617}609618610619static int acpi_processor_add(struct acpi_device *device)611620{612621 struct acpi_processor *pr = NULL;613622614614- ACPI_FUNCTION_TRACE("acpi_processor_add");615623616624 if (!device)617617- return_VALUE(-EINVAL);625625+ return -EINVAL;618626619627 pr = kmalloc(sizeof(struct acpi_processor), GFP_KERNEL);620628 if (!pr)621621- return_VALUE(-ENOMEM);629629+ return -ENOMEM;622630 memset(pr, 0, sizeof(struct acpi_processor));623631624632 pr->handle = device->handle;···625635 strcpy(acpi_device_class(device), ACPI_PROCESSOR_CLASS);626636 acpi_driver_data(device) = pr;627637628628- return_VALUE(0);638638+ return 0;629639}630640631641static int acpi_processor_remove(struct acpi_device *device, int type)···633643 acpi_status status = AE_OK;634644 struct acpi_processor *pr = NULL;635645636636- ACPI_FUNCTION_TRACE("acpi_processor_remove");637646638647 if (!device || !acpi_driver_data(device))639639- return_VALUE(-EINVAL);648648+ return -EINVAL;640649641650 pr = (struct acpi_processor *)acpi_driver_data(device);642651643652 if (pr->id >= NR_CPUS) {644653 kfree(pr);645645- return_VALUE(0);654654+ return 0;646655 }647656648657 if (type == ACPI_BUS_REMOVAL_EJECT) {649658 if (acpi_processor_handle_eject(pr))650650- return_VALUE(-EINVAL);659659+ return -EINVAL;651660 }652661653662 acpi_processor_power_exit(pr, device);···660671661672 kfree(pr);662673663663- return_VALUE(0);674674+ return 0;664675}665676666677#ifdef CONFIG_ACPI_HOTPLUG_CPU···675686 acpi_status status;676687 unsigned long sta = 0;677688678678- ACPI_FUNCTION_TRACE("is_processor_present");679689680690 status = acpi_evaluate_integer(handle, "_STA", NULL, &sta);681691 if (ACPI_FAILURE(status) || !(sta & ACPI_STA_PRESENT)) {682692 ACPI_EXCEPTION((AE_INFO, status, "Processor Device is not present"));683683- return_VALUE(0);693693+ return 0;684694 }685685- return_VALUE(1);695695+ return 1;686696}687697688698static···691703 struct acpi_device *pdev;692704 struct acpi_processor *pr;693705694694- ACPI_FUNCTION_TRACE("acpi_processor_device_add");695706696707 if (acpi_get_parent(handle, &phandle)) {697697- return_VALUE(-ENODEV);708708+ return -ENODEV;698709 }699710700711 if (acpi_bus_get_device(phandle, &pdev)) {701701- return_VALUE(-ENODEV);712712+ return -ENODEV;702713 }703714704715 if (acpi_bus_add(device, pdev, handle, ACPI_BUS_TYPE_PROCESSOR)) {705705- return_VALUE(-ENODEV);716716+ return -ENODEV;706717 }707718708719 acpi_bus_start(*device);709720710721 pr = acpi_driver_data(*device);711722 if (!pr)712712- return_VALUE(-ENODEV);723723+ return -ENODEV;713724714725 if ((pr->id >= 0) && (pr->id < NR_CPUS)) {715726 kobject_uevent(&(*device)->kobj, KOBJ_ONLINE);716727 }717717- return_VALUE(0);728728+ return 0;718729}719730720731static void···723736 struct acpi_device *device = NULL;724737 int result;725738726726- ACPI_FUNCTION_TRACE("acpi_processor_hotplug_notify");727739728740 switch (event) {729741 case ACPI_NOTIFY_BUS_CHECK:···774788 if (!pr) {775789 printk(KERN_ERR PREFIX776790 "Driver data is NULL, dropping EJECT\n");777777- return_VOID;791791+ return;778792 }779793780794 if ((pr->id < NR_CPUS) && (cpu_present(pr->id)))···786800 break;787801 }788802789789- return_VOID;803803+ return;790804}791805792806static acpi_status···825839826840static acpi_status acpi_processor_hotadd_init(acpi_handle handle, int *p_cpu)827841{828828- ACPI_FUNCTION_TRACE("acpi_processor_hotadd_init");829842830843 if (!is_processor_present(handle)) {831831- return_VALUE(AE_ERROR);844844+ return AE_ERROR;832845 }833846834847 if (acpi_map_lsapic(handle, p_cpu))835835- return_VALUE(AE_ERROR);848848+ return AE_ERROR;836849837850 if (arch_register_cpu(*p_cpu)) {838851 acpi_unmap_lsapic(*p_cpu);839839- return_VALUE(AE_ERROR);852852+ return AE_ERROR;840853 }841854842842- return_VALUE(AE_OK);855855+ return AE_OK;843856}844857845858static int acpi_processor_handle_eject(struct acpi_processor *pr)···895910{896911 int result = 0;897912898898- ACPI_FUNCTION_TRACE("acpi_processor_init");899913900914 memset(&processors, 0, sizeof(processors));901915 memset(&errata, 0, sizeof(errata));902916903917 acpi_processor_dir = proc_mkdir(ACPI_PROCESSOR_CLASS, acpi_root_dir);904918 if (!acpi_processor_dir)905905- return_VALUE(0);919919+ return 0;906920 acpi_processor_dir->owner = THIS_MODULE;907921908922 result = acpi_bus_register_driver(&acpi_processor_driver);909923 if (result < 0) {910924 remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir);911911- return_VALUE(0);925925+ return 0;912926 }913927914928 acpi_processor_install_hotplug_notify();···916932917933 acpi_processor_ppc_init();918934919919- return_VALUE(0);935935+ return 0;920936}921937922938static void __exit acpi_processor_exit(void)923939{924924- ACPI_FUNCTION_TRACE("acpi_processor_exit");925940926941 acpi_processor_ppc_exit();927942···932949933950 remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir);934951935935- return_VOID;952952+ return;936953}937954938955module_init(acpi_processor_init);
+30-41
drivers/acpi/processor_idle.c
···517517 struct acpi_processor_cx *higher = NULL;518518 struct acpi_processor_cx *cx;519519520520- ACPI_FUNCTION_TRACE("acpi_processor_set_power_policy");521520522521 if (!pr)523523- return_VALUE(-EINVAL);522522+ return -EINVAL;524523525524 /*526525 * This function sets the default Cx state policy (OS idle handler).···543544 }544545545546 if (!state_is_set)546546- return_VALUE(-ENODEV);547547+ return -ENODEV;547548548549 /* demotion */549550 for (i = 1; i < ACPI_PROCESSOR_MAX_POWER; i++) {···582583 higher = cx;583584 }584585585585- return_VALUE(0);586586+ return 0;586587}587588588589static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr)589590{590590- ACPI_FUNCTION_TRACE("acpi_processor_get_power_info_fadt");591591592592 if (!pr)593593- return_VALUE(-EINVAL);593593+ return -EINVAL;594594595595 if (!pr->pblk)596596- return_VALUE(-ENODEV);596596+ return -ENODEV;597597598598 /* if info is obtained from pblk/fadt, type equals state */599599 pr->power.states[ACPI_STATE_C2].type = ACPI_STATE_C2;···604606 * an SMP system. 605607 */606608 if ((num_online_cpus() > 1) && !acpi_fadt.plvl2_up)607607- return_VALUE(-ENODEV);609609+ return -ENODEV;608610#endif609611610612 /* determine C2 and C3 address from pblk */···620622 pr->power.states[ACPI_STATE_C2].address,621623 pr->power.states[ACPI_STATE_C3].address));622624623623- return_VALUE(0);625625+ return 0;624626}625627626628static int acpi_processor_get_power_info_default_c1(struct acpi_processor *pr)627629{628628- ACPI_FUNCTION_TRACE("acpi_processor_get_power_info_default_c1");629630630631 /* Zero initialize all the C-states info. */631632 memset(pr->power.states, 0, sizeof(pr->power.states));···637640 pr->power.states[ACPI_STATE_C0].valid = 1;638641 pr->power.states[ACPI_STATE_C1].valid = 1;639642640640- return_VALUE(0);643643+ return 0;641644}642645643646static int acpi_processor_get_power_info_cst(struct acpi_processor *pr)···649652 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };650653 union acpi_object *cst;651654652652- ACPI_FUNCTION_TRACE("acpi_processor_get_power_info_cst");653655654656 if (nocst)655655- return_VALUE(-ENODEV);657657+ return -ENODEV;656658657659 current_count = 1;658660···663667 status = acpi_evaluate_object(pr->handle, "_CST", NULL, &buffer);664668 if (ACPI_FAILURE(status)) {665669 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No _CST, giving up\n"));666666- return_VALUE(-ENODEV);670670+ return -ENODEV;667671 }668672669673 cst = (union acpi_object *)buffer.pointer;···769773 end:770774 acpi_os_free(buffer.pointer);771775772772- return_VALUE(status);776776+ return status;773777}774778775779static void acpi_processor_power_verify_c2(struct acpi_processor_cx *cx)776780{777777- ACPI_FUNCTION_TRACE("acpi_processor_get_power_verify_c2");778781779782 if (!cx->address)780780- return_VOID;783783+ return;781784782785 /*783786 * C2 latency must be less than or equal to 100···785790 else if (cx->latency > ACPI_PROCESSOR_MAX_C2_LATENCY) {786791 ACPI_DEBUG_PRINT((ACPI_DB_INFO,787792 "latency too large [%d]\n", cx->latency));788788- return_VOID;793793+ return;789794 }790795791796 /*···795800 cx->valid = 1;796801 cx->latency_ticks = US_TO_PM_TIMER_TICKS(cx->latency);797802798798- return_VOID;803803+ return;799804}800805801806static void acpi_processor_power_verify_c3(struct acpi_processor *pr,···803808{804809 static int bm_check_flag;805810806806- ACPI_FUNCTION_TRACE("acpi_processor_get_power_verify_c3");807811808812 if (!cx->address)809809- return_VOID;813813+ return;810814811815 /*812816 * C3 latency must be less than or equal to 1000···814820 else if (cx->latency > ACPI_PROCESSOR_MAX_C3_LATENCY) {815821 ACPI_DEBUG_PRINT((ACPI_DB_INFO,816822 "latency too large [%d]\n", cx->latency));817817- return_VOID;823823+ return;818824 }819825820826 /*···827833 else if (errata.piix4.fdma) {828834 ACPI_DEBUG_PRINT((ACPI_DB_INFO,829835 "C3 not supported on PIIX4 with Type-F DMA\n"));830830- return_VOID;836836+ return;831837 }832838833839 /* All the logic here assumes flags.bm_check is same across all CPUs */···844850 if (!pr->flags.bm_control) {845851 ACPI_DEBUG_PRINT((ACPI_DB_INFO,846852 "C3 support requires bus mastering control\n"));847847- return_VOID;853853+ return;848854 }849855 } else {850856 /*···855861 ACPI_DEBUG_PRINT((ACPI_DB_INFO,856862 "Cache invalidation should work properly"857863 " for C3 to be enabled on SMP systems\n"));858858- return_VOID;864864+ return;859865 }860866 acpi_set_register(ACPI_BITREG_BUS_MASTER_RLD,861867 0, ACPI_MTX_DO_NOT_LOCK);···870876 cx->valid = 1;871877 cx->latency_ticks = US_TO_PM_TIMER_TICKS(cx->latency);872878873873- return_VOID;879879+ return;874880}875881876882static int acpi_processor_power_verify(struct acpi_processor *pr)···929935 unsigned int i;930936 int result;931937932932- ACPI_FUNCTION_TRACE("acpi_processor_get_power_info");933938934939 /* NOTE: the idle thread may not be running while calling935940 * this function */···951958 */952959 result = acpi_processor_set_power_policy(pr);953960 if (result)954954- return_VALUE(result);961961+ return result;955962956963 /*957964 * if one state of type C2 or C3 is available, mark this···965972 }966973 }967974968968- return_VALUE(0);975975+ return 0;969976}970977971978int acpi_processor_cst_has_changed(struct acpi_processor *pr)972979{973980 int result = 0;974981975975- ACPI_FUNCTION_TRACE("acpi_processor_cst_has_changed");976982977983 if (!pr)978978- return_VALUE(-EINVAL);984984+ return -EINVAL;979985980986 if (nocst) {981981- return_VALUE(-ENODEV);987987+ return -ENODEV;982988 }983989984990 if (!pr->flags.power_setup_done)985985- return_VALUE(-ENODEV);991991+ return -ENODEV;986992987993 /* Fall back to the default idle loop */988994 pm_idle = pm_idle_save;···9921000 if ((pr->flags.power == 1) && (pr->flags.power_setup_done))9931001 pm_idle = acpi_processor_idle;9941002995995- return_VALUE(result);10031003+ return result;9961004}99710059981006/* proc interface */···10021010 struct acpi_processor *pr = (struct acpi_processor *)seq->private;10031011 unsigned int i;1004101210051005- ACPI_FUNCTION_TRACE("acpi_processor_power_seq_show");1006101310071014 if (!pr)10081015 goto end;···10591068 }1060106910611070 end:10621062- return_VALUE(0);10711071+ return 0;10631072}1064107310651074static int acpi_processor_power_open_fs(struct inode *inode, struct file *file)···10831092 struct proc_dir_entry *entry = NULL;10841093 unsigned int i;1085109410861086- ACPI_FUNCTION_TRACE("acpi_processor_power_init");1087109510881096 if (!first_run) {10891097 dmi_check_system(processor_power_dmi_table);···10941104 }1095110510961106 if (!pr)10971097- return_VALUE(-EINVAL);11071107+ return -EINVAL;1098110810991109 if (acpi_fadt.cst_cnt && !nocst) {11001110 status =···1139114911401150 pr->flags.power_setup_done = 1;1141115111421142- return_VALUE(0);11521152+ return 0;11431153}1144115411451155int acpi_processor_power_exit(struct acpi_processor *pr,11461156 struct acpi_device *device)11471157{11481148- ACPI_FUNCTION_TRACE("acpi_processor_power_exit");1149115811501159 pr->flags.power_setup_done = 0;11511160···11641175 cpu_idle_wait();11651176 }1166117711671167- return_VALUE(0);11781178+ return 0;11681179}
+38-49
drivers/acpi/processor_perflib.c
···108108 acpi_status status = 0;109109 unsigned long ppc = 0;110110111111- ACPI_FUNCTION_TRACE("acpi_processor_get_platform_limit");112111113112 if (!pr)114114- return_VALUE(-EINVAL);113113+ return -EINVAL;115114116115 /*117116 * _PPC indicates the maximum state currently supported by the platform···123124124125 if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) {125126 ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PPC"));126126- return_VALUE(-ENODEV);127127+ return -ENODEV;127128 }128129129130 pr->performance_platform_limit = (int)ppc;130131131131- return_VALUE(0);132132+ return 0;132133}133134134135int acpi_processor_ppc_has_changed(struct acpi_processor *pr)···167168 union acpi_object *pct = NULL;168169 union acpi_object obj = { 0 };169170170170- ACPI_FUNCTION_TRACE("acpi_processor_get_performance_control");171171172172 status = acpi_evaluate_object(pr->handle, "_PCT", NULL, &buffer);173173 if (ACPI_FAILURE(status)) {174174 ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PCT"));175175- return_VALUE(-ENODEV);175175+ return -ENODEV;176176 }177177178178 pct = (union acpi_object *)buffer.pointer;···218220 end:219221 acpi_os_free(buffer.pointer);220222221221- return_VALUE(result);223223+ return result;222224}223225224226static int acpi_processor_get_performance_states(struct acpi_processor *pr)···231233 union acpi_object *pss = NULL;232234 int i;233235234234- ACPI_FUNCTION_TRACE("acpi_processor_get_performance_states");235236236237 status = acpi_evaluate_object(pr->handle, "_PSS", NULL, &buffer);237238 if (ACPI_FAILURE(status)) {238239 ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PSS"));239239- return_VALUE(-ENODEV);240240+ return -ENODEV;240241 }241242242243 pss = (union acpi_object *)buffer.pointer;···296299 end:297300 acpi_os_free(buffer.pointer);298301299299- return_VALUE(result);302302+ return result;300303}301304302305static int acpi_processor_get_performance_info(struct acpi_processor *pr)···305308 acpi_status status = AE_OK;306309 acpi_handle handle = NULL;307310308308- ACPI_FUNCTION_TRACE("acpi_processor_get_performance_info");309311310312 if (!pr || !pr->performance || !pr->handle)311311- return_VALUE(-EINVAL);313313+ return -EINVAL;312314313315 status = acpi_get_handle(pr->handle, "_PCT", &handle);314316 if (ACPI_FAILURE(status)) {315317 ACPI_DEBUG_PRINT((ACPI_DB_INFO,316318 "ACPI-based processor performance control unavailable\n"));317317- return_VALUE(-ENODEV);319319+ return -ENODEV;318320 }319321320322 result = acpi_processor_get_performance_control(pr);321323 if (result)322322- return_VALUE(result);324324+ return result;323325324326 result = acpi_processor_get_performance_states(pr);325327 if (result)326326- return_VALUE(result);328328+ return result;327329328330 result = acpi_processor_get_platform_limit(pr);329331 if (result)330330- return_VALUE(result);332332+ return result;331333332332- return_VALUE(0);334334+ return 0;333335}334336335337int acpi_processor_notify_smm(struct module *calling_module)···336340 acpi_status status;337341 static int is_done = 0;338342339339- ACPI_FUNCTION_TRACE("acpi_processor_notify_smm");340343341344 if (!(acpi_processor_ppc_status & PPC_REGISTERED))342342- return_VALUE(-EBUSY);345345+ return -EBUSY;343346344347 if (!try_module_get(calling_module))345345- return_VALUE(-EINVAL);348348+ return -EINVAL;346349347350 /* is_done is set to negative if an error occured,348351 * and to postitive if _no_ error occured, but SMM···350355 */351356 if (is_done > 0) {352357 module_put(calling_module);353353- return_VALUE(0);358358+ return 0;354359 } else if (is_done < 0) {355360 module_put(calling_module);356356- return_VALUE(is_done);361361+ return is_done;357362 }358363359364 is_done = -EIO;···362367 if ((!acpi_fadt.smi_cmd) || (!acpi_fadt.pstate_cnt)) {363368 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No SMI port or pstate_cnt\n"));364369 module_put(calling_module);365365- return_VALUE(0);370370+ return 0;366371 }367372368373 ACPI_DEBUG_PRINT((ACPI_DB_INFO,···384389 "smi_cmd [0x%x]", acpi_fadt.pstate_cnt,385390 acpi_fadt.smi_cmd));386391 module_put(calling_module);387387- return_VALUE(status);392392+ return status;388393 }389394390395 /* Success. If there's no _PPC, we need to fear nothing, so···394399 if (!(acpi_processor_ppc_status & PPC_IN_USE))395400 module_put(calling_module);396401397397- return_VALUE(0);402402+ return 0;398403}399404400405EXPORT_SYMBOL(acpi_processor_notify_smm);···415420 struct acpi_processor *pr = (struct acpi_processor *)seq->private;416421 int i;417422418418- ACPI_FUNCTION_TRACE("acpi_processor_perf_seq_show");419423420424 if (!pr)421425 goto end;···438444 (u32) pr->performance->states[i].transition_latency);439445440446 end:441441- return_VALUE(0);447447+ return 0;442448}443449444450static int acpi_processor_perf_open_fs(struct inode *inode, struct file *file)···460466 unsigned int new_state = 0;461467 struct cpufreq_policy policy;462468463463- ACPI_FUNCTION_TRACE("acpi_processor_write_performance");464469465470 if (!pr || (count > sizeof(state_string) - 1))466466- return_VALUE(-EINVAL);471471+ return -EINVAL;467472468473 perf = pr->performance;469474 if (!perf)470470- return_VALUE(-EINVAL);475475+ return -EINVAL;471476472477 if (copy_from_user(state_string, buffer, count))473473- return_VALUE(-EFAULT);478478+ return -EFAULT;474479475480 state_string[count] = '\0';476481 new_state = simple_strtoul(state_string, NULL, 0);477482478483 if (new_state >= perf->state_count)479479- return_VALUE(-EINVAL);484484+ return -EINVAL;480485481486 cpufreq_get_policy(&policy, pr->id);482487···485492486493 result = cpufreq_set_policy(&policy);487494 if (result)488488- return_VALUE(result);495495+ return result;489496490490- return_VALUE(count);497497+ return count;491498}492499493500static void acpi_cpufreq_add_file(struct acpi_processor *pr)···495502 struct proc_dir_entry *entry = NULL;496503 struct acpi_device *device = NULL;497504498498- ACPI_FUNCTION_TRACE("acpi_cpufreq_addfile");499505500506 if (acpi_bus_get_device(pr->handle, &device))501501- return_VOID;507507+ return;502508503509 /* add file 'performance' [R/W] */504510 entry = create_proc_entry(ACPI_PROCESSOR_FILE_PERFORMANCE,···509517 entry->data = acpi_driver_data(device);510518 entry->owner = THIS_MODULE;511519 }512512- return_VOID;520520+ return;513521}514522515523static void acpi_cpufreq_remove_file(struct acpi_processor *pr)516524{517525 struct acpi_device *device = NULL;518526519519- ACPI_FUNCTION_TRACE("acpi_cpufreq_addfile");520527521528 if (acpi_bus_get_device(pr->handle, &device))522522- return_VOID;529529+ return;523530524531 /* remove file 'performance' */525532 remove_proc_entry(ACPI_PROCESSOR_FILE_PERFORMANCE,526533 acpi_device_dir(device));527534528528- return_VOID;535535+ return;529536}530537531538#else···768777{769778 struct acpi_processor *pr;770779771771- ACPI_FUNCTION_TRACE("acpi_processor_register_performance");772780773781 if (!(acpi_processor_ppc_status & PPC_REGISTERED))774774- return_VALUE(-EINVAL);782782+ return -EINVAL;775783776784 mutex_lock(&performance_mutex);777785778786 pr = processors[cpu];779787 if (!pr) {780788 mutex_unlock(&performance_mutex);781781- return_VALUE(-ENODEV);789789+ return -ENODEV;782790 }783791784792 if (pr->performance) {785793 mutex_unlock(&performance_mutex);786786- return_VALUE(-EBUSY);794794+ return -EBUSY;787795 }788796789797 WARN_ON(!performance);···792802 if (acpi_processor_get_performance_info(pr)) {793803 pr->performance = NULL;794804 mutex_unlock(&performance_mutex);795795- return_VALUE(-EIO);805805+ return -EIO;796806 }797807798808 acpi_cpufreq_add_file(pr);799809800810 mutex_unlock(&performance_mutex);801801- return_VALUE(0);811811+ return 0;802812}803813804814EXPORT_SYMBOL(acpi_processor_register_performance);···809819{810820 struct acpi_processor *pr;811821812812- ACPI_FUNCTION_TRACE("acpi_processor_unregister_performance");813822814823 mutex_lock(&performance_mutex);815824816825 pr = processors[cpu];817826 if (!pr) {818827 mutex_unlock(&performance_mutex);819819- return_VOID;828828+ return;820829 }821830822831 if (pr->performance)···826837827838 mutex_unlock(&performance_mutex);828839829829- return_VOID;840840+ return;830841}831842832843EXPORT_SYMBOL(acpi_processor_unregister_performance);
+16-21
drivers/acpi/processor_thermal.c
···5454 u16 px = 0;5555 u16 tx = 0;56565757- ACPI_FUNCTION_TRACE("acpi_processor_apply_limit");58575958 if (!pr)6060- return_VALUE(-EINVAL);5959+ return -EINVAL;61606261 if (!pr->flags.limit)6363- return_VALUE(-ENODEV);6262+ return -ENODEV;64636564 if (pr->flags.throttling) {6665 if (pr->limit.user.tx > tx)···8384 if (result)8485 printk(KERN_ERR PREFIX "Unable to set limit\n");85868686- return_VALUE(result);8787+ return result;8788}88898990#ifdef CONFIG_CPU_FREQ···199200 struct acpi_device *device = NULL;200201 int tx = 0, max_tx_px = 0;201202202202- ACPI_FUNCTION_TRACE("acpi_processor_set_thermal_limit");203203204204 if ((type < ACPI_PROCESSOR_LIMIT_NONE)205205 || (type > ACPI_PROCESSOR_LIMIT_DECREMENT))206206- return_VALUE(-EINVAL);206206+ return -EINVAL;207207208208 result = acpi_bus_get_device(handle, &device);209209 if (result)210210- return_VALUE(result);210210+ return result;211211212212 pr = (struct acpi_processor *)acpi_driver_data(device);213213 if (!pr)214214- return_VALUE(-ENODEV);214214+ return -ENODEV;215215216216 /* Thermal limits are always relative to the current Px/Tx state. */217217 if (pr->flags.throttling)···294296 } else295297 result = 0;296298 if (max_tx_px)297297- return_VALUE(1);299299+ return 1;298300 else299299- return_VALUE(result);301301+ return result;300302}301303302304int acpi_processor_get_limit_info(struct acpi_processor *pr)303305{304304- ACPI_FUNCTION_TRACE("acpi_processor_get_limit_info");305306306307 if (!pr)307307- return_VALUE(-EINVAL);308308+ return -EINVAL;308309309310 if (pr->flags.throttling)310311 pr->flags.limit = 1;311312312312- return_VALUE(0);313313+ return 0;313314}314315315316/* /proc interface */···317320{318321 struct acpi_processor *pr = (struct acpi_processor *)seq->private;319322320320- ACPI_FUNCTION_TRACE("acpi_processor_limit_seq_show");321323322324 if (!pr)323325 goto end;···334338 pr->limit.thermal.px, pr->limit.thermal.tx);335339336340 end:337337- return_VALUE(0);341341+ return 0;338342}339343340344static int acpi_processor_limit_open_fs(struct inode *inode, struct file *file)···354358 int px = 0;355359 int tx = 0;356360357357- ACPI_FUNCTION_TRACE("acpi_processor_write_limit");358361359362 if (!pr || (count > sizeof(limit_string) - 1)) {360360- return_VALUE(-EINVAL);363363+ return -EINVAL;361364 }362365363366 if (copy_from_user(limit_string, buffer, count)) {364364- return_VALUE(-EFAULT);367367+ return -EFAULT;365368 }366369367370 limit_string[count] = '\0';368371369372 if (sscanf(limit_string, "%d:%d", &px, &tx) != 2) {370373 printk(KERN_ERR PREFIX "Invalid data format\n");371371- return_VALUE(-EINVAL);374374+ return -EINVAL;372375 }373376374377 if (pr->flags.throttling) {375378 if ((tx < 0) || (tx > (pr->throttling.state_count - 1))) {376379 printk(KERN_ERR PREFIX "Invalid tx\n");377377- return_VALUE(-EINVAL);380380+ return -EINVAL;378381 }379382 pr->limit.user.tx = tx;380383 }381384382385 result = acpi_processor_apply_limit(pr);383386384384- return_VALUE(count);387387+ return count;385388}386389387390struct file_operations acpi_processor_limit_fops = {
+19-24
drivers/acpi/processor_throttling.c
···5555 u32 duty_mask = 0;5656 u32 duty_value = 0;57575858- ACPI_FUNCTION_TRACE("acpi_processor_get_throttling");59586059 if (!pr)6161- return_VALUE(-EINVAL);6060+ return -EINVAL;62616362 if (!pr->flags.throttling)6464- return_VALUE(-ENODEV);6363+ return -ENODEV;65646665 pr->throttling.state = 0;6766···9293 "Throttling state is T%d (%d%% throttling applied)\n",9394 state, pr->throttling.states[state].performance));94959595- return_VALUE(0);9696+ return 0;9697}97989899int acpi_processor_set_throttling(struct acpi_processor *pr, int state)···101102 u32 duty_mask = 0;102103 u32 duty_value = 0;103104104104- ACPI_FUNCTION_TRACE("acpi_processor_set_throttling");105105106106 if (!pr)107107- return_VALUE(-EINVAL);107107+ return -EINVAL;108108109109 if ((state < 0) || (state > (pr->throttling.state_count - 1)))110110- return_VALUE(-EINVAL);110110+ return -EINVAL;111111112112 if (!pr->flags.throttling)113113- return_VALUE(-ENODEV);113113+ return -ENODEV;114114115115 if (state == pr->throttling.state)116116- return_VALUE(0);116116+ return 0;117117118118 /*119119 * Calculate the duty_value and duty_mask.···163165 (pr->throttling.states[state].performance ? pr->164166 throttling.states[state].performance / 10 : 0)));165167166166- return_VALUE(0);168168+ return 0;167169}168170169171int acpi_processor_get_throttling_info(struct acpi_processor *pr)···172174 int step = 0;173175 int i = 0;174176175175- ACPI_FUNCTION_TRACE("acpi_processor_get_throttling_info");176177177178 ACPI_DEBUG_PRINT((ACPI_DB_INFO,178179 "pblk_address[0x%08x] duty_offset[%d] duty_width[%d]\n",···180183 pr->throttling.duty_width));181184182185 if (!pr)183183- return_VALUE(-EINVAL);186186+ return -EINVAL;184187185188 /* TBD: Support ACPI 2.0 objects */186189187190 if (!pr->throttling.address) {188191 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No throttling register\n"));189189- return_VALUE(0);192192+ return 0;190193 } else if (!pr->throttling.duty_width) {191194 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No throttling states\n"));192192- return_VALUE(0);195195+ return 0;193196 }194197 /* TBD: Support duty_cycle values that span bit 4. */195198 else if ((pr->throttling.duty_offset + pr->throttling.duty_width) > 4) {196199 printk(KERN_WARNING PREFIX "duty_cycle spans bit 4\n");197197- return_VALUE(0);200200+ return 0;198201 }199202200203 /*···205208 if (errata.piix4.throttle) {206209 ACPI_DEBUG_PRINT((ACPI_DB_INFO,207210 "Throttling not supported on PIIX4 A- or B-step\n"));208208- return_VALUE(0);211211+ return 0;209212 }210213211214 pr->throttling.state_count = 1 << acpi_fadt.duty_width;···251254 if (result)252255 pr->flags.throttling = 0;253256254254- return_VALUE(result);257257+ return result;255258}256259257260/* proc interface */···263266 int i = 0;264267 int result = 0;265268266266- ACPI_FUNCTION_TRACE("acpi_processor_throttling_seq_show");267269268270 if (!pr)269271 goto end;···292296 throttling.states[i].performance / 10 : 0));293297294298 end:295295- return_VALUE(0);299299+ return 0;296300}297301298302static int acpi_processor_throttling_open_fs(struct inode *inode,···311315 struct acpi_processor *pr = (struct acpi_processor *)m->private;312316 char state_string[12] = { '\0' };313317314314- ACPI_FUNCTION_TRACE("acpi_processor_write_throttling");315318316319 if (!pr || (count > sizeof(state_string) - 1))317317- return_VALUE(-EINVAL);320320+ return -EINVAL;318321319322 if (copy_from_user(state_string, buffer, count))320320- return_VALUE(-EFAULT);323323+ return -EFAULT;321324322325 state_string[count] = '\0';323326···324329 simple_strtoul(state_string,325330 NULL, 0));326331 if (result)327327- return_VALUE(result);332332+ return result;328333329329- return_VALUE(count);334334+ return count;330335}331336332337struct file_operations acpi_processor_throttling_fops = {
+30-47
drivers/acpi/scan.c
···162162163163void acpi_bus_data_handler(acpi_handle handle, u32 function, void *context)164164{165165- ACPI_FUNCTION_TRACE("acpi_bus_data_handler");166165167166 /* TBD */168167169169- return_VOID;168168+ return;170169}171170172171static int acpi_bus_get_power_flags(struct acpi_device *device)···174175 acpi_handle handle = NULL;175176 u32 i = 0;176177177177- ACPI_FUNCTION_TRACE("acpi_bus_get_power_flags");178178179179 /*180180 * Power Management Flags···226228227229 device->power.state = ACPI_STATE_UNKNOWN;228230229229- return_VALUE(0);231231+ return 0;230232}231233232234int acpi_match_ids(struct acpi_device *device, char *ids)···304306 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };305307 union acpi_object *package = NULL;306308307307- ACPI_FUNCTION_TRACE("acpi_bus_get_wakeup_flags");308309309310 /* _PRW */310311 status = acpi_evaluate_object(device->handle, "_PRW", NULL, &buffer);···329332 end:330333 if (ACPI_FAILURE(status))331334 device->flags.wake_capable = 0;332332- return_VALUE(0);335335+ return 0;333336}334337335338/* --------------------------------------------------------------------------···485488{486489 int result = 0;487490488488- ACPI_FUNCTION_TRACE("acpi_bus_driver_init");489491490492 if (!device || !driver)491491- return_VALUE(-EINVAL);493493+ return -EINVAL;492494493495 if (!driver->ops.add)494494- return_VALUE(-ENOSYS);496496+ return -ENOSYS;495497496498 result = driver->ops.add(device);497499 if (result) {498500 device->driver = NULL;499501 acpi_driver_data(device) = NULL;500500- return_VALUE(result);502502+ return result;501503 }502504503505 device->driver = driver;···508512509513 ACPI_DEBUG_PRINT((ACPI_DB_INFO,510514 "Driver successfully bound to device\n"));511511- return_VALUE(0);515515+ return 0;512516}513517514518static int acpi_start_single_object(struct acpi_device *device)···516520 int result = 0;517521 struct acpi_driver *driver;518522519519- ACPI_FUNCTION_TRACE("acpi_start_single_object");520523521524 if (!(driver = device->driver))522522- return_VALUE(0);525525+ return 0;523526524527 if (driver->ops.start) {525528 result = driver->ops.start(device);···526531 driver->ops.remove(device, ACPI_BUS_REMOVAL_NORMAL);527532 }528533529529- return_VALUE(result);534534+ return result;530535}531536532537static void acpi_driver_attach(struct acpi_driver *drv)533538{534539 struct list_head *node, *next;535540536536- ACPI_FUNCTION_TRACE("acpi_driver_attach");537541538542 spin_lock(&acpi_device_lock);539543 list_for_each_safe(node, next, &acpi_device_list) {···561567{562568 struct list_head *node, *next;563569564564- ACPI_FUNCTION_TRACE("acpi_driver_detach");565570566571 spin_lock(&acpi_device_lock);567572 list_for_each_safe(node, next, &acpi_device_list) {···590597 */591598int acpi_bus_register_driver(struct acpi_driver *driver)592599{593593- ACPI_FUNCTION_TRACE("acpi_bus_register_driver");594600595601 if (acpi_disabled)596596- return_VALUE(-ENODEV);602602+ return -ENODEV;597603598604 spin_lock(&acpi_device_lock);599605 list_add_tail(&driver->node, &acpi_bus_drivers);600606 spin_unlock(&acpi_device_lock);601607 acpi_driver_attach(driver);602608603603- return_VALUE(0);609609+ return 0;604610}605611606612EXPORT_SYMBOL(acpi_bus_register_driver);···637645 int result = 0;638646 struct list_head *node, *next;639647640640- ACPI_FUNCTION_TRACE("acpi_bus_find_driver");641648642649 spin_lock(&acpi_device_lock);643650 list_for_each_safe(node, next, &acpi_bus_drivers) {···656665 spin_unlock(&acpi_device_lock);657666658667 Done:659659- return_VALUE(result);668668+ return result;660669}661670662671/* --------------------------------------------------------------------------···668677 acpi_status status = AE_OK;669678 acpi_handle temp = NULL;670679671671- ACPI_FUNCTION_TRACE("acpi_bus_get_flags");672680673681 /* Presence of _STA indicates 'dynamic_status' */674682 status = acpi_get_handle(device->handle, "_STA", &temp);···713723714724 /* TBD: Peformance management */715725716716- return_VALUE(0);726726+ return 0;717727}718728719729static void acpi_device_get_busid(struct acpi_device *device,···907917 int result = 0;908918 struct acpi_driver *driver;909919910910- ACPI_FUNCTION_TRACE("acpi_bus_remove");911920912921 if (!dev)913913- return_VALUE(-EINVAL);922922+ return -EINVAL;914923915924 driver = dev->driver;916925···918929 if (driver->ops.stop) {919930 result = driver->ops.stop(dev, ACPI_BUS_REMOVAL_EJECT);920931 if (result)921921- return_VALUE(result);932932+ return result;922933 }923934924935 result = dev->driver->ops.remove(dev, ACPI_BUS_REMOVAL_EJECT);925936 if (result) {926926- return_VALUE(result);937937+ return result;927938 }928939929940 atomic_dec(&dev->driver->references);···932943 }933944934945 if (!rmdevice)935935- return_VALUE(0);946946+ return 0;936947937948 if (dev->flags.bus_address) {938949 if ((dev->parent) && (dev->parent->ops.unbind))···941952942953 acpi_device_unregister(dev, ACPI_BUS_REMOVAL_EJECT);943954944944- return_VALUE(0);955955+ return 0;945956}946957947958static int···951962 int result = 0;952963 struct acpi_device *device = NULL;953964954954- ACPI_FUNCTION_TRACE("acpi_add_single_object");955965956966 if (!child)957957- return_VALUE(-EINVAL);967967+ return -EINVAL;958968959969 device = kmalloc(sizeof(struct acpi_device), GFP_KERNEL);960970 if (!device) {961971 printk(KERN_ERR PREFIX "Memory allocation error\n");962962- return_VALUE(-ENOMEM);972972+ return -ENOMEM;963973 }964974 memset(device, 0, sizeof(struct acpi_device));965975···10831095 kfree(device);10841096 }1085109710861086- return_VALUE(result);10981098+ return result;10871099}1088110010891101static int acpi_bus_scan(struct acpi_device *start, struct acpi_bus_ops *ops)···10961108 acpi_object_type type = 0;10971109 u32 level = 1;1098111010991099- ACPI_FUNCTION_TRACE("acpi_bus_scan");1100111111011112 if (!start)11021102- return_VALUE(-EINVAL);11131113+ return -EINVAL;1103111411041115 parent = start;11051116 phandle = start->handle;···11951208 }11961209 }1197121011981198- return_VALUE(0);12111211+ return 0;11991212}1200121312011214int···12051218 int result;12061219 struct acpi_bus_ops ops;1207122012081208- ACPI_FUNCTION_TRACE("acpi_bus_add");1209122112101222 result = acpi_add_single_object(child, parent, handle, type);12111223 if (!result) {···12121226 ops.acpi_op_add = 1;12131227 result = acpi_bus_scan(*child, &ops);12141228 }12151215- return_VALUE(result);12291229+ return result;12161230}1217123112181232EXPORT_SYMBOL(acpi_bus_add);···12221236 int result;12231237 struct acpi_bus_ops ops;1224123812251225- ACPI_FUNCTION_TRACE("acpi_bus_start");1226123912271240 if (!device)12281228- return_VALUE(-EINVAL);12411241+ return -EINVAL;1229124212301243 result = acpi_start_single_object(device);12311244 if (!result) {···12321247 ops.acpi_op_start = 1;12331248 result = acpi_bus_scan(device, &ops);12341249 }12351235- return_VALUE(result);12501250+ return result;12361251}1237125212381253EXPORT_SYMBOL(acpi_bus_start);···12981313 int result = 0;12991314 struct acpi_device *device = NULL;1300131513011301- ACPI_FUNCTION_TRACE("acpi_bus_scan_fixed");1302131613031317 if (!root)13041304- return_VALUE(-ENODEV);13181318+ return -ENODEV;1305131913061320 /*13071321 * Enumerate all fixed-feature devices.···13211337 result = acpi_start_single_object(device);13221338 }1323133913241324- return_VALUE(result);13401340+ return result;13251341}1326134213271343···14231439 int result;14241440 struct acpi_bus_ops ops;1425144114261426- ACPI_FUNCTION_TRACE("acpi_scan_init");1427144214281443 if (acpi_disabled)14291429- return_VALUE(0);14441444+ return 0;1430144514311446 kset_register(&acpi_namespace_kset);14321447···14701487 acpi_device_unregister(acpi_root, ACPI_BUS_REMOVAL_NORMAL);1471148814721489 Done:14731473- return_VALUE(result);14901490+ return result;14741491}1475149214761493subsys_initcall(acpi_scan_init);