linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@kernel.org>
To: "Vaittinen, Matti" <matti.vaittinen@fi.rohmeurope.com>
Cc: Sebastian Reichel <sre@kernel.org>,
	Timon Baetz <timon.baetz@protonmail.com>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Andy Shevchenko <andy.shevchenko@gmail.com>,
	Linux PM list <linux-pm@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] power: supply: max8997_charger: make EXTCON dependency unconditional
Date: Mon, 8 Mar 2021 17:07:25 +0100	[thread overview]
Message-ID: <CAK8P3a1ssi+S_axTKowKgszqBkBNdh4+bi-UCUOb2jWiVu18Ag@mail.gmail.com> (raw)
In-Reply-To: <7ca68ba756672ab937550f6ffd2b07dbd1b021d1.camel@fi.rohmeurope.com>

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

  reply	other threads:[~2021-03-08 16:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2021-03-08 16:06 ` Andy Shevchenko
2021-03-08 16:10   ` Andy Shevchenko
2021-03-08 16:31   ` Vaittinen, Matti

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=CAK8P3a1ssi+S_axTKowKgszqBkBNdh4+bi-UCUOb2jWiVu18Ag@mail.gmail.com \
    --to=arnd@kernel.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=krzk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=matti.vaittinen@fi.rohmeurope.com \
    --cc=sre@kernel.org \
    --cc=timon.baetz@protonmail.com \
    /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).