[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YcrHi7cZDWZlTZ2w@kroah.com>
Date: Tue, 28 Dec 2021 09:15:07 +0100
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: Niklas Schnelle <schnelle@...ux.ibm.com>
Cc: Arnd Bergmann <arnd@...nel.org>,
Bjorn Helgaas <bhelgaas@...gle.com>,
John Garry <john.garry@...wei.com>,
Nick Hu <nickhu@...estech.com>,
Greentime Hu <green.hu@...il.com>,
Vincent Chen <deanbo422@...il.com>,
Paul Walmsley <paul.walmsley@...ive.com>,
Palmer Dabbelt <palmer@...belt.com>,
Albert Ou <aou@...s.berkeley.edu>, Guo Ren <guoren@...nel.org>,
Arnd Bergmann <arnd@...db.de>, linux-kernel@...r.kernel.org,
linux-arch@...r.kernel.org, linux-pci@...r.kernel.org,
linux-riscv@...ts.infradead.org, linux-csky@...r.kernel.org
Subject: Re: [RFC 16/32] misc: handle HAS_IOPORT dependencies
On Mon, Dec 27, 2021 at 05:43:01PM +0100, Niklas Schnelle wrote:
> In a future patch HAS_IOPORT=n will result in inb()/outb() and friends
> not being declared. We thus need to add HAS_IOPORT as dependency for
> those drivers using them.
>
> Co-developed-by: Arnd Bergmann <arnd@...nel.org>
> Signed-off-by: Arnd Bergmann <arnd@...nel.org>
> Signed-off-by: Niklas Schnelle <schnelle@...ux.ibm.com>
> ---
> drivers/misc/altera-stapl/Makefile | 3 ++-
> drivers/misc/altera-stapl/altera.c | 6 +++++-
> 2 files changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/misc/altera-stapl/Makefile b/drivers/misc/altera-stapl/Makefile
> index dd0f8189666b..90f18e7bf9b0 100644
> --- a/drivers/misc/altera-stapl/Makefile
> +++ b/drivers/misc/altera-stapl/Makefile
> @@ -1,4 +1,5 @@
> # SPDX-License-Identifier: GPL-2.0-only
> -altera-stapl-objs = altera-lpt.o altera-jtag.o altera-comp.o altera.o
> +altera-stapl-y = altera-jtag.o altera-comp.o altera.o
> +altera-stapl-$(CONFIG_HAS_IOPORT) += altera-lpt.o
>
> obj-$(CONFIG_ALTERA_STAPL) += altera-stapl.o
> diff --git a/drivers/misc/altera-stapl/altera.c b/drivers/misc/altera-stapl/altera.c
> index 92c0611034b0..c7ae64de8bb4 100644
> --- a/drivers/misc/altera-stapl/altera.c
> +++ b/drivers/misc/altera-stapl/altera.c
> @@ -2431,6 +2431,10 @@ int altera_init(struct altera_config *config, const struct firmware *fw)
>
> astate->config = config;
> if (!astate->config->jtag_io) {
> + if (!IS_ENABLED(CONFIG_HAS_IOPORT)) {
> + retval = -ENODEV;
> + goto free_state;
> + }
A comment as to why you are doing this check here would be nice, as it
is not obvious at all what is going on.
thanks,
greg k-h
Powered by blists - more mailing lists