linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: David Airlie <airlied@linux.ie>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	Alex Deucher <alexander.deucher@amd.com>
Subject: Re: [PATCH] drm: pl111: add CONFIG_VEXPRESS_CONFIG dependency
Date: Wed, 27 May 2020 21:03:30 +0200	[thread overview]
Message-ID: <CAK8P3a29zkDn50DuRBK1wKDtZnLdyfq5VX5pC3kmEo+=BKCQbw@mail.gmail.com> (raw)
In-Reply-To: <20200527175012.GB98921@ravnborg.org>

On Wed, May 27, 2020 at 7:50 PM Sam Ravnborg <sam@ravnborg.org> wrote:
> On Wed, May 27, 2020 at 05:47:21PM +0200, Arnd Bergmann wrote:
> > On Wed, May 27, 2020 at 4:52 PM Sam Ravnborg <sam@ravnborg.org> wrote:
> > >
> > > Hi Arnd.
> > >
> > > On Wed, May 27, 2020 at 03:31:42PM +0200, Arnd Bergmann wrote:
> > > > The vexpress_config code fails to link in some configurations:
> > > >
> > > > drivers/gpu/drm/pl111/pl111_versatile.o: in function `pl111_versatile_init':
> > > > (.text+0x1f0): undefined reference to `devm_regmap_init_vexpress_config'
> > > >
> > > > Add a dependency that links to this only if the dependency is there,
> > > > and prevent the configuration where the drm driver is built-in but
> > > > the config is a loadable module.
> > > >
> > > > Fixes: 826fc86b5903 ("drm: pl111: Move VExpress setup into versatile init")
> > > > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > >
> > > Could this be another way to fix it:
> > >
> > > diff --git a/drivers/gpu/drm/pl111/pl111_versatile.c b/drivers/gpu/drm/pl111/pl111_versatile.c
> > > index 64f01a4e6767..1c38d3bd2e84 100644
> > > --- a/drivers/gpu/drm/pl111/pl111_versatile.c
> > > +++ b/drivers/gpu/drm/pl111/pl111_versatile.c
> > > @@ -379,7 +379,7 @@ static int pl111_vexpress_clcd_init(struct device *dev, struct device_node *np,
> > >         u32 val;
> > >         int ret;
> > >
> > > -       if (!IS_ENABLED(CONFIG_VEXPRESS_CONFIG))
> > > +       if (!IS_REACHABLE(CONFIG_VEXPRESS_CONFIG))
> > >                 return -ENODEV;
> > >
> > >         /*
> > >
> > >
> > > Then we no longer have the whole driver depending on
> > > the value of VEXPRESS_CONFIG.
> > > Not that I like IS_REACHABLE() but we already had
> > > IS_ENABLED() to cover up here, and that was not enough.
> > >
> > > With your patch would we then need the IS_ENABLED()
> > > check?
> >
> > The IS_ENABLED() check is what I'm adding, not removing. I'd still
> > the Kconfig dependency combined with that check over
> > IS_REACHABLE(), which is more likely to silently not work.
>
> Then the now redundant IS_ENABLED() check should go.
> With you patch it looks like this:
>
>         ...
>         if (IS_ENABLED(CONFIG_VEXPRESS_CONFIG) && ...)
>                 pl111_vexpress_clcd_init()
>
>
> And in pl111_vexpress_clcd_init() we have:
>
> {
>         if (!IS_ENABLED(CONFIG_VEXPRESS_CONFIG))
>                 return -ENODEV;
>
> The IS_ENABLED() in pl111_vexpress_clcd_init() is redundant
> and the patch should drop it.

Ah I see your point now, sorry I missed the double IS_ENABLED()
check at first. I'll remove the second one from my patch and
resubmit after some more build testing then.

        Arnd

  reply	other threads:[~2020-05-27 19:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-27 13:31 [PATCH] drm: pl111: add CONFIG_VEXPRESS_CONFIG dependency Arnd Bergmann
2020-05-27 13:42 ` Linus Walleij
2020-05-27 14:52 ` Sam Ravnborg
2020-05-27 15:47   ` Arnd Bergmann
2020-05-27 17:50     ` Sam Ravnborg
2020-05-27 19:03       ` Arnd Bergmann [this message]
2020-05-28 21:36 ` Rob Herring

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='CAK8P3a29zkDn50DuRBK1wKDtZnLdyfq5VX5pC3kmEo+=BKCQbw@mail.gmail.com' \
    --to=arnd@arndb.de \
    --cc=airlied@linux.ie \
    --cc=alexander.deucher@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sam@ravnborg.org \
    /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).