linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: Nathan Chancellor <nathan@kernel.org>
Cc: Lee Jones <lee@kernel.org>, Daniel Thompson <danielt@kernel.org>,
	Madhavan Srinivasan <maddy@linux.ibm.com>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Nicholas Piggin <npiggin@gmail.com>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Simona Vetter <simona.vetter@ffwll.ch>,
	linuxppc-dev@lists.ozlabs.org, patches@lists.linux.dev
Subject: Re: [PATCH 2/2] macintosh/via-pmu-backlight: Include linux/of.h and uapi/linux/fb.h
Date: Tue, 4 Nov 2025 19:11:12 +0100	[thread overview]
Message-ID: <0827d0ea-9831-4839-989f-13e33d8d6729@suse.de> (raw)
In-Reply-To: <20251104170104.GA1416336@ax162>

Hi

Am 04.11.25 um 18:01 schrieb Nathan Chancellor:
> On Tue, Nov 04, 2025 at 01:43:26PM +0100, Thomas Zimmermann wrote:
>> Hi
>>
>> Am 26.09.25 um 01:46 schrieb Nathan Chancellor:
>>> After the recent removal of the fb.h include from backlight.h, which
>>> transitively included of.h, there are several errors from
>>> via-pmu-backlight.c (errors from bl_curve not being properly defined
>>> omitted):
>>>
>>>     drivers/macintosh/via-pmu-backlight.c:22:20: error: 'FB_BACKLIGHT_LEVELS' undeclared here (not in a function)
>>>        22 | static u8 bl_curve[FB_BACKLIGHT_LEVELS];
>>>           |                    ^~~~~~~~~~~~~~~~~~~
>>>     drivers/macintosh/via-pmu-backlight.c: In function 'pmu_backlight_get_level_brightness':
>>>     drivers/macintosh/via-pmu-backlight.c:63:38: error: 'FB_BACKLIGHT_MAX' undeclared (first use in this function); did you mean 'BACKLIGHT_RAW'?
>>>        63 |         pmulevel = bl_curve[level] * FB_BACKLIGHT_MAX / MAX_PMU_LEVEL;
>>>           |                                      ^~~~~~~~~~~~~~~~
>>>           |                                      BACKLIGHT_RAW
>>>     drivers/macintosh/via-pmu-backlight.c: In function 'pmu_backlight_init':
>>>     drivers/macintosh/via-pmu-backlight.c:144:17: error: implicit declaration of function 'of_machine_is_compatible' [-Wimplicit-function-declaration]
>>>       144 |                 of_machine_is_compatible("AAPL,3400/2400") ||
>>>           |                 ^~~~~~~~~~~~~~~~~~~~~~~~
>>>
>>> FB_BACKLIGHT_{LEVELS,MAX} are available from the userspace API fb.h so
>>> just include that avoid dragging in the full fb.h header unnecessarily.
>>> Include linux/of.h for of_machine_is_compatible().
>>>
>>> Fixes: 9f218f9bb9d2 ("backlight: Do not include <linux/fb.h> in header file")
>>> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
>>> ---
>>>    drivers/macintosh/via-pmu-backlight.c | 2 ++
>>>    1 file changed, 2 insertions(+)
>>>
>>> diff --git a/drivers/macintosh/via-pmu-backlight.c b/drivers/macintosh/via-pmu-backlight.c
>>> index 26bd9ed5e664..f7b7853b3802 100644
>>> --- a/drivers/macintosh/via-pmu-backlight.c
>>> +++ b/drivers/macintosh/via-pmu-backlight.c
>>> @@ -11,7 +11,9 @@
>>>    #include <asm/ptrace.h>
>>>    #include <linux/adb.h>
>>>    #include <linux/backlight.h>
>>> +#include <linux/of.h>
>>>    #include <linux/pmu.h>
>>> +#include <uapi/linux/fb.h>
>> Should this not be <linux/fb.h> ?
> It could be but as I mention above, this file only needs the UAPI
> FB_BACKLIGHT_LEVELS and FB_BACKLIGHT_MAX constants so I did not really
> feel like it was worth it to drag in the whole fb.h header.

I mean that I thought that the internal header would be preferred over 
the UAPI header if both exist. But maybe I misremember.

Best regards
Thomas

>
>>>    #include <asm/backlight.h>
>>>    #define MAX_PMU_LEVEL 0xFF
>>>
>> -- 
>> --
>> Thomas Zimmermann
>> Graphics Driver Developer
>> SUSE Software Solutions Germany GmbH
>> Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
>> GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG Nürnberg)
>>
>>

-- 
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG Nürnberg)




  reply	other threads:[~2025-11-04 18:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-25 23:46 [PATCH 0/2] Fixes for pmac32_defconfig after fb.h removal from backlight.h Nathan Chancellor
2025-09-25 23:46 ` [PATCH 1/2] powerpc/powermac: Include linux/of.h in backlight.c Nathan Chancellor
2025-09-26  8:28   ` Christophe Leroy
2025-09-25 23:46 ` [PATCH 2/2] macintosh/via-pmu-backlight: Include linux/of.h and uapi/linux/fb.h Nathan Chancellor
2025-09-26  8:29   ` Christophe Leroy
2025-11-04 12:43   ` Thomas Zimmermann
2025-11-04 17:01     ` Nathan Chancellor
2025-11-04 18:11       ` Thomas Zimmermann [this message]
2025-11-04 11:29 ` [PATCH 0/2] Fixes for pmac32_defconfig after fb.h removal from backlight.h Christophe Leroy
2025-11-05  3:50   ` Madhavan Srinivasan
2025-11-04 12:42 ` Thomas Zimmermann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0827d0ea-9831-4839-989f-13e33d8d6729@suse.de \
    --to=tzimmermann@suse.de \
    --cc=christophe.leroy@csgroup.eu \
    --cc=danielt@kernel.org \
    --cc=lee@kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maddy@linux.ibm.com \
    --cc=mpe@ellerman.id.au \
    --cc=nathan@kernel.org \
    --cc=npiggin@gmail.com \
    --cc=patches@lists.linux.dev \
    --cc=simona.vetter@ffwll.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).