linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Eduardo Valentin <edubezval@gmail.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org, linux-pm@vger.kernel.org,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Zhang Rui <rui.zhang@intel.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] thermal: mediatek: add missing dependencies
Date: Tue, 23 Feb 2016 09:55:06 +0100	[thread overview]
Message-ID: <20160223085506.GB3939@pengutronix.de> (raw)
In-Reply-To: <1455921381-1881305-1-git-send-email-arnd@arndb.de>

Hi Arnd,

On Fri, Feb 19, 2016 at 11:36:06PM +0100, Arnd Bergmann wrote:
> The newly added mtk_thermal driver uses the generic reset
> and nvmem infrastructure, but lacks a dependency that enforces
> them from actually being present:
> 
> drivers/thermal/mtk_thermal.c: In function 'mtk_thermal_probe':
> drivers/thermal/mtk_thermal.c:560:8: error: implicit declaration of function 'device_reset' [-Werror=implicit-function-declaration]
> drivers/thermal/built-in.o: In function `mtk_thermal_probe':
> mtk_thermal.c:(.text+0x7fb0): undefined reference to `nvmem_cell_get'
> mtk_thermal.c:(.text+0x7fd8): undefined reference to `nvmem_cell_read'
> mtk_thermal.c:(.text+0x7fe4): undefined reference to `nvmem_cell_put'
> 
> Without CONFIG_THERMAL, the driver cannot build, so this needs
> to be a hard dependency.

s/CONFIG_THERMAL/CONFIG_RESET_CONTROLLER/ ?

> 
> For CONFIG_NVMEM, the header file allows building the driver even
> when the subsystem is disabled, but we get the link error above
> when nvmem is built as a module and the thermal driver is built-in,
> so we can allow compile-testing when NVMEM is completely disabled,
> but otherwise require the dependency.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/thermal/Kconfig | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig
> index 5e7c97a3f1d8..75d164341f0d 100644
> --- a/drivers/thermal/Kconfig
> +++ b/drivers/thermal/Kconfig
> @@ -368,6 +368,8 @@ config INTEL_PCH_THERMAL
>  config MTK_THERMAL
>  	tristate "Temperature sensor driver for mediatek SoCs"
>  	depends on ARCH_MEDIATEK || COMPILE_TEST
> +	depends on NVMEM || (!NVMEM && COMPILE_TEST)

This doesn't work as expected. When NVMEM is off I can still not select
MTK_THERMAL, even when COMPILE_TEST is enabled.

Even if it would work, do we really want this? It raises eyebrows and
without reading the commit messages it's probably not clear what's going
on here. I don't see that much value in it.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

      reply	other threads:[~2016-02-23  8:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-19 22:36 [PATCH] thermal: mediatek: add missing dependencies Arnd Bergmann
2016-02-23  8:55 ` Sascha Hauer [this message]

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=20160223085506.GB3939@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=arnd@arndb.de \
    --cc=edubezval@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=matthias.bgg@gmail.com \
    --cc=rui.zhang@intel.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).