Skip to content

Commit 838f865

Browse files
author
Thomas Zimmermann
committed
arch/powerpc: Remove <linux/fb.h> from backlight code
Replace <linux/fb.h> with a forward declaration in <asm/backlight.h> to resolve an unnecessary dependency. Remove pmac_backlight_curve_lookup() and struct fb_info from source and header files. The function and the framebuffer struct are unused. No functional changes. v3: * Add Fixes tag (Christophe) * fix typos in commit message (Jani) Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Fixes: d565dd3 ("[PATCH] powerpc: More via-pmu backlight fixes") Reviewed-by: Jani Nikula <jani.nikula@intel.com> Acked-by: Michael Ellerman <mpe@ellerman.id.au> # (powerpc) Link: https://patchwork.freedesktop.org/patch/msgid/20240306122935.10626-4-tzimmermann@suse.de
1 parent 074d363 commit 838f865

File tree

2 files changed

+2
-29
lines changed

2 files changed

+2
-29
lines changed

arch/powerpc/include/asm/backlight.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,14 @@
1010
#define __ASM_POWERPC_BACKLIGHT_H
1111
#ifdef __KERNEL__
1212

13-
#include <linux/fb.h>
1413
#include <linux/mutex.h>
1514

15+
struct backlight_device;
16+
1617
/* For locking instructions, see the implementation file */
1718
extern struct backlight_device *pmac_backlight;
1819
extern struct mutex pmac_backlight_mutex;
1920

20-
extern int pmac_backlight_curve_lookup(struct fb_info *info, int value);
21-
2221
extern int pmac_has_backlight_type(const char *type);
2322

2423
extern void pmac_backlight_key(int direction);

arch/powerpc/platforms/powermac/backlight.c

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
*/
1010

1111
#include <linux/kernel.h>
12-
#include <linux/fb.h>
1312
#include <linux/backlight.h>
1413
#include <linux/adb.h>
1514
#include <linux/pmu.h>
@@ -72,31 +71,6 @@ int pmac_has_backlight_type(const char *type)
7271
return 0;
7372
}
7473

75-
int pmac_backlight_curve_lookup(struct fb_info *info, int value)
76-
{
77-
int level = (FB_BACKLIGHT_LEVELS - 1);
78-
79-
if (info && info->bl_dev) {
80-
int i, max = 0;
81-
82-
/* Look for biggest value */
83-
for (i = 0; i < FB_BACKLIGHT_LEVELS; i++)
84-
max = max((int)info->bl_curve[i], max);
85-
86-
/* Look for nearest value */
87-
for (i = 0; i < FB_BACKLIGHT_LEVELS; i++) {
88-
int diff = abs(info->bl_curve[i] - value);
89-
if (diff < max) {
90-
max = diff;
91-
level = i;
92-
}
93-
}
94-
95-
}
96-
97-
return level;
98-
}
99-
10074
static void pmac_backlight_key_worker(struct work_struct *work)
10175
{
10276
if (atomic_read(&kernel_backlight_disabled))

0 commit comments

Comments
 (0)