systemd/0004-backlight-warn-if-kernel-exposes-backlight-device-wi.patch

41 lines
1.5 KiB
Diff
Raw Normal View History

Accepting request 233680 from Base:System - Add patch log-target-null-instead-kmsg.patch from Thomas Blume to enable the kernel developers to see a clean kmsg ring buffer without any systemd/udev messages included (bnc#877021) - Add upstram patches for backlight 0001-backlight-Avoid-restoring-brightness-to-an-unreadabl.patch 0002-backlight-do-nothing-if-max_brightness-is-0.patch 0003-backlight-unify-error-messages.patch 0004-backlight-warn-if-kernel-exposes-backlight-device-wi.patch 0005-backlight-handle-saved-brightness-exceeding-max-brig.patch - Add upstream patches 0001-errno-make-sure-to-handle-the-3-errnos-that-are-alia.patch 0002-udev-warn-when-name_to_handle_at-is-not-implemented.patch 0003-analyze-fix-plot-with-bad-y-size.patch 0004-job-add-waiting-jobs-to-run-queue-in-unit_coldplug.patch 0005-job-always-add-waiting-jobs-to-run-queue-during-cold.patch - Drop upstream-net_id-changes.patch and replace them with the correct patches from upstream and their commits: add: 1014-udev-update-net_id-comments.patch add: 1015-udev-persistent-naming-we-cannot-use-virtio-numbers-.patch - Add patch log-target-null-instead-kmsg.patch from Thomas Blume to enable the kernel developers to see a clean kmsg ring buffer without any systemd/udev messages included (bnc#877021) - Add upstram patches for backlight 0001-backlight-Avoid-restoring-brightness-to-an-unreadabl.patch 0002-backlight-do-nothing-if-max_brightness-is-0.patch OBS-URL: https://build.opensuse.org/request/show/233680 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=186
2014-05-13 20:46:20 +02:00
From c7fdf44d08e1217d40dc092fb90a65978a0f541f Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Wed, 23 Apr 2014 06:55:54 +0200
Subject: [PATCH] backlight: warn if kernel exposes backlight device with
bogus max_brightness
We shouldn't silently tape over broken kernel drivers.
---
src/backlight/backlight.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git src/backlight/backlight.c src/backlight/backlight.c
index 754a646..c708391 100644
--- src/backlight/backlight.c
+++ src/backlight/backlight.c
@@ -205,14 +205,18 @@ static unsigned get_max_brightness(struct udev_device *device) {
max_brightness_str = udev_device_get_sysattr_value(device, "max_brightness");
if (!max_brightness_str) {
- log_warning("Failed to read 'max_brightness' attribute");
+ log_warning("Failed to read 'max_brightness' attribute.");
return 0;
}
r = safe_atou(max_brightness_str, &max_brightness);
if (r < 0) {
- log_warning("Failed to parse 'max_brightness' \"%s\": %s",
- max_brightness_str, strerror(-r));
+ log_warning("Failed to parse 'max_brightness' \"%s\": %s", max_brightness_str, strerror(-r));
+ return 0;
+ }
+
+ if (max_brightness <= 0) {
+ log_warning("Maximum brightness is 0, ignoring device.");
return 0;
}
--
1.7.9.2