* [PATCH] power: supply: max8997_charger: make EXTCON dependency unconditional
@ 2021-03-08 15:29 Arnd Bergmann
2021-03-08 15:33 ` Krzysztof Kozlowski
` (2 more replies)
0 siblings, 3 replies; 10+ messages in thread
From: Arnd Bergmann @ 2021-03-08 15:29 UTC (permalink / raw)
To: Sebastian Reichel, Timon Baetz, Krzysztof Kozlowski
Cc: Arnd Bergmann, Matti Vaittinen, Andy Shevchenko, linux-pm, linux-kernel
From: Arnd Bergmann <arnd@arndb.de>
Some of the extcon interfaces have a fallback implementation that can
be used when EXTCON is disabled, but some others do not, causing a
build failure:
drivers/power/supply/max8997_charger.c:261:9: error: implicit declaration of function 'devm_extcon_register_notifier_all' [-Werror,-Wimplicit-function-declaration]
ret = devm_extcon_register_notifier_all(&pdev->dev, charger->edev,
^
drivers/power/supply/max8997_charger.c:261:9: note: did you mean 'devm_extcon_register_notifier'?
include/linux/extcon.h:263:19: note: 'devm_extcon_register_notifier' declared here
static inline int devm_extcon_register_notifier(struct device *dev,
I assume there is no reason to actually build this driver without extcon
support, so a hard dependency is the easiest fix. Alternatively the
header file could be extended to provide additional inline stubs.
Fixes: f384989e88d4 ("power: supply: max8997_charger: Set CHARGER current limit")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/power/supply/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/power/supply/Kconfig b/drivers/power/supply/Kconfig
index 006b95eca673..6cce17e1d47a 100644
--- a/drivers/power/supply/Kconfig
+++ b/drivers/power/supply/Kconfig
@@ -555,7 +555,7 @@ config CHARGER_MAX77693
config CHARGER_MAX8997
tristate "Maxim MAX8997/MAX8966 PMIC battery charger driver"
depends on MFD_MAX8997 && REGULATOR_MAX8997
- depends on EXTCON || !EXTCON
+ depends on EXTCON
help
Say Y to enable support for the battery charger control sysfs and
platform data of MAX8997/LP3974 PMICs.
--
2.29.2
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH] power: supply: max8997_charger: make EXTCON dependency unconditional
2021-03-08 15:29 [PATCH] power: supply: max8997_charger: make EXTCON dependency unconditional Arnd Bergmann
@ 2021-03-08 15:33 ` Krzysztof Kozlowski
2021-03-08 16:02 ` Arnd Bergmann
2021-03-08 15:50 ` Matti Vaittinen
2021-03-08 16:06 ` Andy Shevchenko
2 siblings, 1 reply; 10+ messages in thread
From: Krzysztof Kozlowski @ 2021-03-08 15:33 UTC (permalink / raw)
To: Arnd Bergmann, Sebastian Reichel, Timon Baetz
Cc: Arnd Bergmann, Matti Vaittinen, Andy Shevchenko, linux-pm,
linux-kernel, Chanwoo Choi
On 08/03/2021 16:29, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> Some of the extcon interfaces have a fallback implementation that can
> be used when EXTCON is disabled, but some others do not, causing a
> build failure:
>
> drivers/power/supply/max8997_charger.c:261:9: error: implicit declaration of function 'devm_extcon_register_notifier_all' [-Werror,-Wimplicit-function-declaration]
> ret = devm_extcon_register_notifier_all(&pdev->dev, charger->edev,
> ^
> drivers/power/supply/max8997_charger.c:261:9: note: did you mean 'devm_extcon_register_notifier'?
> include/linux/extcon.h:263:19: note: 'devm_extcon_register_notifier' declared here
> static inline int devm_extcon_register_notifier(struct device *dev,
>
> I assume there is no reason to actually build this driver without extcon
> support, so a hard dependency is the easiest fix. Alternatively the
> header file could be extended to provide additional inline stubs.
Hi Arnd,
Thanks for the patch but I think I got it covered with:
https://lore.kernel.org/lkml/20210215100610.19911-2-cw00.choi@samsung.com/
(sent via extcon tree).
Did you experience a new/different issue?
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] power: supply: max8997_charger: make EXTCON dependency unconditional
2021-03-08 15:33 ` Krzysztof Kozlowski
@ 2021-03-08 16:02 ` Arnd Bergmann
2021-03-08 16:11 ` Krzysztof Kozlowski
0 siblings, 1 reply; 10+ messages in thread
From: Arnd Bergmann @ 2021-03-08 16:02 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Sebastian Reichel, Timon Baetz, Matti Vaittinen, Andy Shevchenko,
Linux PM list, linux-kernel, Chanwoo Choi
On Mon, Mar 8, 2021 at 4:33 PM Krzysztof Kozlowski <krzk@kernel.org> wrote:
>
> On 08/03/2021 16:29, Arnd Bergmann wrote:
> > From: Arnd Bergmann <arnd@arndb.de>
> >
> > Some of the extcon interfaces have a fallback implementation that can
> > be used when EXTCON is disabled, but some others do not, causing a
> > build failure:
> >
> > drivers/power/supply/max8997_charger.c:261:9: error: implicit declaration of function 'devm_extcon_register_notifier_all' [-Werror,-Wimplicit-function-declaration]
> > ret = devm_extcon_register_notifier_all(&pdev->dev, charger->edev,
> > ^
> > drivers/power/supply/max8997_charger.c:261:9: note: did you mean 'devm_extcon_register_notifier'?
> > include/linux/extcon.h:263:19: note: 'devm_extcon_register_notifier' declared here
> > static inline int devm_extcon_register_notifier(struct device *dev,
> >
> > I assume there is no reason to actually build this driver without extcon
> > support, so a hard dependency is the easiest fix. Alternatively the
> > header file could be extended to provide additional inline stubs.
>
> Hi Arnd,
>
> Thanks for the patch but I think I got it covered with:
> https://lore.kernel.org/lkml/20210215100610.19911-2-cw00.choi@samsung.com/
> (sent via extcon tree).
>
> Did you experience a new/different issue?
The patch should be fine and address the problem, I just didn't see it was
already fixed in linux-next as I'm still testing on mainline (rc2 at
the moment).
I assume the fix will make it into a future -rc then.
Arnd
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] power: supply: max8997_charger: make EXTCON dependency unconditional
2021-03-08 16:02 ` Arnd Bergmann
@ 2021-03-08 16:11 ` Krzysztof Kozlowski
2021-03-09 10:11 ` Chanwoo Choi
0 siblings, 1 reply; 10+ messages in thread
From: Krzysztof Kozlowski @ 2021-03-08 16:11 UTC (permalink / raw)
To: Arnd Bergmann, Chanwoo Choi
Cc: Sebastian Reichel, Timon Baetz, Matti Vaittinen, Andy Shevchenko,
Linux PM list, linux-kernel
On Mon, 8 Mar 2021 at 17:02, Arnd Bergmann <arnd@kernel.org> wrote:
>
> On Mon, Mar 8, 2021 at 4:33 PM Krzysztof Kozlowski <krzk@kernel.org> wrote:
> >
> > On 08/03/2021 16:29, Arnd Bergmann wrote:
> > > From: Arnd Bergmann <arnd@arndb.de>
> > >
> > > Some of the extcon interfaces have a fallback implementation that can
> > > be used when EXTCON is disabled, but some others do not, causing a
> > > build failure:
> > >
> > > drivers/power/supply/max8997_charger.c:261:9: error: implicit declaration of function 'devm_extcon_register_notifier_all' [-Werror,-Wimplicit-function-declaration]
> > > ret = devm_extcon_register_notifier_all(&pdev->dev, charger->edev,
> > > ^
> > > drivers/power/supply/max8997_charger.c:261:9: note: did you mean 'devm_extcon_register_notifier'?
> > > include/linux/extcon.h:263:19: note: 'devm_extcon_register_notifier' declared here
> > > static inline int devm_extcon_register_notifier(struct device *dev,
> > >
> > > I assume there is no reason to actually build this driver without extcon
> > > support, so a hard dependency is the easiest fix. Alternatively the
> > > header file could be extended to provide additional inline stubs.
> >
> > Hi Arnd,
> >
> > Thanks for the patch but I think I got it covered with:
> > https://lore.kernel.org/lkml/20210215100610.19911-2-cw00.choi@samsung.com/
> > (sent via extcon tree).
> >
> > Did you experience a new/different issue?
>
> The patch should be fine and address the problem, I just didn't see it was
> already fixed in linux-next as I'm still testing on mainline (rc2 at
> the moment).
>
> I assume the fix will make it into a future -rc then.
It's still only in linux-next via extcon tree, so it seems Greg did
not take it yet.
Chanwoo,
You might need to follow up on this, so your pull request won't get lost.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] power: supply: max8997_charger: make EXTCON dependency unconditional
2021-03-08 16:11 ` Krzysztof Kozlowski
@ 2021-03-09 10:11 ` Chanwoo Choi
0 siblings, 0 replies; 10+ messages in thread
From: Chanwoo Choi @ 2021-03-09 10:11 UTC (permalink / raw)
To: Krzysztof Kozlowski, Arnd Bergmann
Cc: Sebastian Reichel, Timon Baetz, Matti Vaittinen, Andy Shevchenko,
Linux PM list, linux-kernel
Hi Krzysztof,
On 3/9/21 1:11 AM, Krzysztof Kozlowski wrote:
> On Mon, 8 Mar 2021 at 17:02, Arnd Bergmann <arnd@kernel.org> wrote:
>>
>> On Mon, Mar 8, 2021 at 4:33 PM Krzysztof Kozlowski <krzk@kernel.org> wrote:
>>>
>>> On 08/03/2021 16:29, Arnd Bergmann wrote:
>>>> From: Arnd Bergmann <arnd@arndb.de>
>>>>
>>>> Some of the extcon interfaces have a fallback implementation that can
>>>> be used when EXTCON is disabled, but some others do not, causing a
>>>> build failure:
>>>>
>>>> drivers/power/supply/max8997_charger.c:261:9: error: implicit declaration of function 'devm_extcon_register_notifier_all' [-Werror,-Wimplicit-function-declaration]
>>>> ret = devm_extcon_register_notifier_all(&pdev->dev, charger->edev,
>>>> ^
>>>> drivers/power/supply/max8997_charger.c:261:9: note: did you mean 'devm_extcon_register_notifier'?
>>>> include/linux/extcon.h:263:19: note: 'devm_extcon_register_notifier' declared here
>>>> static inline int devm_extcon_register_notifier(struct device *dev,
>>>>
>>>> I assume there is no reason to actually build this driver without extcon
>>>> support, so a hard dependency is the easiest fix. Alternatively the
>>>> header file could be extended to provide additional inline stubs.
>>>
>>> Hi Arnd,
>>>
>>> Thanks for the patch but I think I got it covered with:
>>> https://lore.kernel.org/lkml/20210215100610.19911-2-cw00.choi@samsung.com/
>>> (sent via extcon tree).
>>>
>>> Did you experience a new/different issue?
>>
>> The patch should be fine and address the problem, I just didn't see it was
>> already fixed in linux-next as I'm still testing on mainline (rc2 at
>> the moment).
>>
>> I assume the fix will make it into a future -rc then.
>
> It's still only in linux-next via extcon tree, so it seems Greg did
> not take it yet.
>
> Chanwoo,
> You might need to follow up on this, so your pull request won't get lost.
I'm sorry. Because of my fault, the previous pull request was not merged to v5.12-rc1.
To fix this issue, I'll send the pull request for rc3 to Greg.
Best Regards,
Chanwoo Choi
Samsung Electronics
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] power: supply: max8997_charger: make EXTCON dependency unconditional
2021-03-08 15:29 [PATCH] power: supply: max8997_charger: make EXTCON dependency unconditional Arnd Bergmann
2021-03-08 15:33 ` Krzysztof Kozlowski
@ 2021-03-08 15:50 ` Matti Vaittinen
2021-03-08 16:07 ` Arnd Bergmann
2021-03-08 16:06 ` Andy Shevchenko
2 siblings, 1 reply; 10+ messages in thread
From: Matti Vaittinen @ 2021-03-08 15:50 UTC (permalink / raw)
To: Arnd Bergmann, Sebastian Reichel, Timon Baetz, Krzysztof Kozlowski
Cc: Arnd Bergmann, Andy Shevchenko, linux-pm, linux-kernel
Hello Arnd,
On Mon, 2021-03-08 at 16:29 +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> I assume there is no reason to actually build this driver without
> extcon
> support, so a hard dependency is the easiest fix. Alternatively the
> header file could be extended to provide additional inline stubs.
I am absolutely not insisting this but it would be better if there was
no hard dependency. I've tried couple of times to do changes to bunch
of drivers (added some devm-functionality or generic definitions or -
you name it) and I always end up at least compile-testing changes to
multiple drivers. I always repeat following:
1. Manually hack the Makefiles to compile changed drivers as modules
2. Try CONFIG_COMPLILE_TEST
- unfortunately not too widely supported
3. Manually hack more to get drivers with 'hard dependencies' compiled
- occasionally ending up to commenting out the calls with dependencies.
So, if adding the stub is straightforward I'd vote for it.
But I guess you know this quite well so I am just giving my 10 cents -
decision can be yours :)
Best Regards
Matti Vaittinen
--
Matti Vaittinen, Linux device drivers
ROHM Semiconductors, Finland
SWDC
Kiviharjunlenkki 1E
90220 OULU
FINLAND
~~~ "I don't think so," said Rene Descartes. Just then he vanished ~~~
Simon says - in Latin please.
"non cogito me" dixit Rene Descarte, deinde evanescavit
(Thanks for the translation Simon)
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] power: supply: max8997_charger: make EXTCON dependency unconditional
2021-03-08 15:50 ` Matti Vaittinen
@ 2021-03-08 16:07 ` Arnd Bergmann
0 siblings, 0 replies; 10+ messages in thread
From: Arnd Bergmann @ 2021-03-08 16:07 UTC (permalink / raw)
To: Vaittinen, Matti
Cc: Sebastian Reichel, Timon Baetz, Krzysztof Kozlowski,
Andy Shevchenko, Linux PM list, linux-kernel
On Mon, Mar 8, 2021 at 4:52 PM Matti Vaittinen
<matti.vaittinen@fi.rohmeurope.com> wrote:
>
> Hello Arnd,
>
> On Mon, 2021-03-08 at 16:29 +0100, Arnd Bergmann wrote:
> > From: Arnd Bergmann <arnd@arndb.de>
> >
> > I assume there is no reason to actually build this driver without
> > extcon
> > support, so a hard dependency is the easiest fix. Alternatively the
> > header file could be extended to provide additional inline stubs.
>
> I am absolutely not insisting this but it would be better if there was
> no hard dependency. I've tried couple of times to do changes to bunch
> of drivers (added some devm-functionality or generic definitions or -
> you name it) and I always end up at least compile-testing changes to
> multiple drivers. I always repeat following:
>
> 1. Manually hack the Makefiles to compile changed drivers as modules
>
> 2. Try CONFIG_COMPLILE_TEST
> - unfortunately not too widely supported
>
> 3. Manually hack more to get drivers with 'hard dependencies' compiled
> - occasionally ending up to commenting out the calls with dependencies.
>
> So, if adding the stub is straightforward I'd vote for it.
>
> But I guess you know this quite well so I am just giving my 10 cents -
> decision can be yours :)
As Krzysztof said, he's already fixed this in linux-next the way you
prefer. Both approaches are common, and subsystem maintainers
have different preferences. I more or less picked one at random
here.
The main downside of the 'depends on FOO || !FOO' dependency is
that new developers tend to be confused by the syntax. It also
means you don't easily catch the problem with building the driver as
built-in if the dependency is missing, these can go unnoticed for a
long time until someone runs into the wrong randconfig build.
Arnd
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] power: supply: max8997_charger: make EXTCON dependency unconditional
2021-03-08 15:29 [PATCH] power: supply: max8997_charger: make EXTCON dependency unconditional Arnd Bergmann
2021-03-08 15:33 ` Krzysztof Kozlowski
2021-03-08 15:50 ` Matti Vaittinen
@ 2021-03-08 16:06 ` Andy Shevchenko
2021-03-08 16:10 ` Andy Shevchenko
2021-03-08 16:31 ` Vaittinen, Matti
2 siblings, 2 replies; 10+ messages in thread
From: Andy Shevchenko @ 2021-03-08 16:06 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Sebastian Reichel, Timon Baetz, Krzysztof Kozlowski,
Arnd Bergmann, Matti Vaittinen, Linux PM,
Linux Kernel Mailing List
On Mon, Mar 8, 2021 at 5:29 PM Arnd Bergmann <arnd@kernel.org> wrote:
> - depends on EXTCON || !EXTCON
I stumbled over this.
What is the point of having this line at all?
What magic trick does it serve for?
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] power: supply: max8997_charger: make EXTCON dependency unconditional
2021-03-08 16:06 ` Andy Shevchenko
@ 2021-03-08 16:10 ` Andy Shevchenko
2021-03-08 16:31 ` Vaittinen, Matti
1 sibling, 0 replies; 10+ messages in thread
From: Andy Shevchenko @ 2021-03-08 16:10 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Sebastian Reichel, Timon Baetz, Krzysztof Kozlowski,
Arnd Bergmann, Matti Vaittinen, Linux PM,
Linux Kernel Mailing List
On Mon, Mar 8, 2021 at 6:06 PM Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
> On Mon, Mar 8, 2021 at 5:29 PM Arnd Bergmann <arnd@kernel.org> wrote:
>
> > - depends on EXTCON || !EXTCON
>
> I stumbled over this.
> What is the point of having this line at all?
> What magic trick does it serve for?
Okay, it seems I can answer my question: it requires extcon to be
built-in when the driver is built-in. I often saw similar written
slightly differently.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] power: supply: max8997_charger: make EXTCON dependency unconditional
2021-03-08 16:06 ` Andy Shevchenko
2021-03-08 16:10 ` Andy Shevchenko
@ 2021-03-08 16:31 ` Vaittinen, Matti
1 sibling, 0 replies; 10+ messages in thread
From: Vaittinen, Matti @ 2021-03-08 16:31 UTC (permalink / raw)
To: andy.shevchenko, arnd
Cc: timon.baetz, sre, linux-pm, linux-kernel, krzk, arnd
On Mon, 2021-03-08 at 18:06 +0200, Andy Shevchenko wrote:
> On Mon, Mar 8, 2021 at 5:29 PM Arnd Bergmann <arnd@kernel.org> wrote:
>
> > - depends on EXTCON || !EXTCON
>
> I stumbled over this.
> What is the point of having this line at all?
> What magic trick does it serve for?
The logic was somewhat hairy. I used it once for BD70528 watchdog which
provides lock functions for RTC - or stubs if WDG is not used. Problem
which that solved was that when RTC was built-in and WDG was a module -
these functions were missing. It might've been Guenter or A. Belloni
who suggested it.
I don't remember 100% sure but I think it might require EXTCON to be
build as a module. I guess the discussion I had regarding BD70528 can
be found from lore.kernel.org - but it is probably buried deep... Maybe
someone will give better and more definite answer.
Best Regards
Matti Vaittinen
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2021-03-09 9:55 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-08 15:29 [PATCH] power: supply: max8997_charger: make EXTCON dependency unconditional Arnd Bergmann
2021-03-08 15:33 ` Krzysztof Kozlowski
2021-03-08 16:02 ` Arnd Bergmann
2021-03-08 16:11 ` Krzysztof Kozlowski
2021-03-09 10:11 ` Chanwoo Choi
2021-03-08 15:50 ` Matti Vaittinen
2021-03-08 16:07 ` Arnd Bergmann
2021-03-08 16:06 ` Andy Shevchenko
2021-03-08 16:10 ` Andy Shevchenko
2021-03-08 16:31 ` Vaittinen, Matti
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).