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

Collapse All | Expand All

(-)a/drivers/acpi/video.c (-10 / +17 lines)
Lines 414-419 acpi_video_device_lcd_set_level(struct acpi_video_device *device, int level) Link Here
414
	struct acpi_object_list args = { 1, &arg0 };
414
	struct acpi_object_list args = { 1, &arg0 };
415
415
416
416
417
	if (device->cap._BCL) {
418
		int i;
419
420
		/* validate through the list of available levels as
421
		   requested in ACPI spec section B.6.3 */
422
		for (i = 0; i < device->brightness->count; i++)
423
			if (level == device->brightness->levels[i])
424
				break;
425
426
		if (i == device->brightness->count) {
427
			/* didn't find a valid level */
428
			return_ACPI_STATUS(AE_BAD_PARAMETER);
429
		}
430
	}
431
417
	arg0.integer.value = level;
432
	arg0.integer.value = level;
418
433
419
	if (device->cap._BCM)
434
	if (device->cap._BCM)
Lines 898-904 acpi_video_device_write_brightness(struct file *file, Link Here
898
	struct acpi_video_device *dev = m->private;
913
	struct acpi_video_device *dev = m->private;
899
	char str[5] = { 0 };
914
	char str[5] = { 0 };
900
	unsigned int level = 0;
915
	unsigned int level = 0;
901
	int i;
902
916
903
917
904
	if (!dev || !dev->brightness || count + 1 > sizeof str)
918
	if (!dev || !dev->brightness || count + 1 > sizeof str)
Lines 913-926 acpi_video_device_write_brightness(struct file *file, Link Here
913
	if (level > 100)
927
	if (level > 100)
914
		return -EFAULT;
928
		return -EFAULT;
915
929
916
	/* validate through the list of available levels */
930
	if (ACPI_SUCCESS(acpi_video_device_lcd_set_level(dev, level)))
917
	for (i = 0; i < dev->brightness->count; i++)
931
		dev->brightness->curr = level;
918
		if (level == dev->brightness->levels[i]) {
919
			if (ACPI_SUCCESS
920
			    (acpi_video_device_lcd_set_level(dev, level)))
921
				dev->brightness->curr = level;
922
			break;
923
		}
924
932
925
	return count;
933
	return count;
926
}
934
}
927
- 

Return to bug 9277