View | Details | Raw Unified | Return to bug 7200 | Differences between
and this patch

Collapse All | Expand All

(-)linux-2.6.18-a/drivers/acpi/battery.c (+15 lines)
Lines 324-329 static int acpi_battery_check(struct acp Link Here
324
	return result;
324
	return result;
325
}
325
}
326
326
327
static void acpi_battery_check_present(struct acpi_battery *battery)
328
{
329
	if (!battery->flags.present) {
330
		acpi_battery_check(battery);
331
	}
332
}
333
327
/* --------------------------------------------------------------------------
334
/* --------------------------------------------------------------------------
328
                              FS Interface (/proc)
335
                              FS Interface (/proc)
329
   -------------------------------------------------------------------------- */
336
   -------------------------------------------------------------------------- */
Lines 340-345 static int acpi_battery_read_info(struct Link Here
340
	if (!battery)
347
	if (!battery)
341
		goto end;
348
		goto end;
342
349
350
	acpi_battery_check_present(battery);
351
343
	if (battery->flags.present)
352
	if (battery->flags.present)
344
		seq_printf(seq, "present:                 yes\n");
353
		seq_printf(seq, "present:                 yes\n");
345
	else {
354
	else {
Lines 424-429 static int acpi_battery_read_state(struc Link Here
424
	if (!battery)
433
	if (!battery)
425
		goto end;
434
		goto end;
426
435
436
	acpi_battery_check_present(battery);
437
427
	if (battery->flags.present)
438
	if (battery->flags.present)
428
		seq_printf(seq, "present:                 yes\n");
439
		seq_printf(seq, "present:                 yes\n");
429
	else {
440
	else {
Lines 499-504 static int acpi_battery_read_alarm(struc Link Here
499
	if (!battery)
510
	if (!battery)
500
		goto end;
511
		goto end;
501
512
513
	acpi_battery_check_present(battery);
514
502
	if (!battery->flags.present) {
515
	if (!battery->flags.present) {
503
		seq_printf(seq, "present:                 no\n");
516
		seq_printf(seq, "present:                 no\n");
504
		goto end;
517
		goto end;
Lines 536-541 acpi_battery_write_alarm(struct file *fi Link Here
536
	if (!battery || (count > sizeof(alarm_string) - 1))
549
	if (!battery || (count > sizeof(alarm_string) - 1))
537
		return -EINVAL;
550
		return -EINVAL;
538
551
552
	acpi_battery_check_present(battery);
553
539
	if (!battery->flags.present)
554
	if (!battery->flags.present)
540
		return -ENODEV;
555
		return -ENODEV;
541
556

Return to bug 7200