public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] regmap: provide dummy regmap_exit()
@ 2014-11-25 20:21 Olof Johansson
  2014-11-25 20:39 ` Lars-Peter Clausen
  0 siblings, 1 reply; 6+ messages in thread
From: Olof Johansson @ 2014-11-25 20:21 UTC (permalink / raw)
  To: broonie; +Cc: linux-kernel, Lars-Peter Clausen, Olof Johansson

Fixes build error:

sound/soc/soc-core.c: In function 'snd_soc_component_exit_regmap':
sound/soc/soc-core.c:2644:2: error: implicit declaration of function 'regmap_exit' [-Werror=implicit-function-declaration]
  regmap_exit(component->regmap);

Due to the other regmap functions providing appropriate stubs when
!CONFIG_REGMAP, but this one is missing. Add it.

Signed-off-by: Olof Johansson <olof@lixom.net>
---
 include/linux/regmap.h |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index 4419b99..efb58a0 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -737,6 +737,11 @@ static inline struct regmap *dev_get_regmap(struct device *dev,
 	return NULL;
 }
 
+static inline void regmap_exit(struct regmap *map)
+{
+	return;
+}
+
 static inline struct device *regmap_get_device(struct regmap *map)
 {
 	WARN_ONCE(1, "regmap API is disabled");
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] regmap: provide dummy regmap_exit()
  2014-11-25 20:21 [PATCH] regmap: provide dummy regmap_exit() Olof Johansson
@ 2014-11-25 20:39 ` Lars-Peter Clausen
  2014-11-25 21:03   ` [PATCH v2] " Olof Johansson
  0 siblings, 1 reply; 6+ messages in thread
From: Lars-Peter Clausen @ 2014-11-25 20:39 UTC (permalink / raw)
  To: Olof Johansson, broonie; +Cc: linux-kernel

On 11/25/2014 09:21 PM, Olof Johansson wrote:
> Fixes build error:
>
> sound/soc/soc-core.c: In function 'snd_soc_component_exit_regmap':
> sound/soc/soc-core.c:2644:2: error: implicit declaration of function 'regmap_exit' [-Werror=implicit-function-declaration]
>    regmap_exit(component->regmap);
>
> Due to the other regmap functions providing appropriate stubs when
> !CONFIG_REGMAP, but this one is missing. Add it.
>
> Signed-off-by: Olof Johansson <olof@lixom.net>

I did a different patch for this I was just about to send. This looks good 
as well I guess, but ...

> ---
>   include/linux/regmap.h |    5 +++++
>   1 file changed, 5 insertions(+)
>
> diff --git a/include/linux/regmap.h b/include/linux/regmap.h
> index 4419b99..efb58a0 100644
> --- a/include/linux/regmap.h
> +++ b/include/linux/regmap.h
> @@ -737,6 +737,11 @@ static inline struct regmap *dev_get_regmap(struct device *dev,
>   	return NULL;
>   }
>
> +static inline void regmap_exit(struct regmap *map)
> +{
> +	return;

... but we really don't need the return here.

> +}
> +
>   static inline struct device *regmap_get_device(struct regmap *map)
>   {
>   	WARN_ONCE(1, "regmap API is disabled");
>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2] regmap: provide dummy regmap_exit()
  2014-11-25 20:39 ` Lars-Peter Clausen
@ 2014-11-25 21:03   ` Olof Johansson
  2014-11-25 21:14     ` Mark Brown
  0 siblings, 1 reply; 6+ messages in thread
From: Olof Johansson @ 2014-11-25 21:03 UTC (permalink / raw)
  To: broonie; +Cc: linux-kernel, Lars-Peter Clausen, Olof Johansson

Fixes build error:

sound/soc/soc-core.c: In function 'snd_soc_component_exit_regmap':
sound/soc/soc-core.c:2644:2: error: implicit declaration of function 'regmap_exit' [-Werror=implicit-function-declaration]
  regmap_exit(component->regmap);

Due to the other regmap functions providing appropriate stubs when
!CONFIG_REGMAP, but this one is missing. Add it.

Signed-off-by: Olof Johansson <olof@lixom.net>
---
 include/linux/regmap.h |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index 4419b99..a13e2bf 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -737,6 +737,8 @@ static inline struct regmap *dev_get_regmap(struct device *dev,
 	return NULL;
 }
 
+static inline void regmap_exit(struct regmap *map) { }
+
 static inline struct device *regmap_get_device(struct regmap *map)
 {
 	WARN_ONCE(1, "regmap API is disabled");
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] regmap: provide dummy regmap_exit()
  2014-11-25 21:03   ` [PATCH v2] " Olof Johansson
@ 2014-11-25 21:14     ` Mark Brown
  2014-11-25 21:18       ` Mark Brown
  2014-11-25 21:27       ` Olof Johansson
  0 siblings, 2 replies; 6+ messages in thread
From: Mark Brown @ 2014-11-25 21:14 UTC (permalink / raw)
  To: Olof Johansson; +Cc: linux-kernel, Lars-Peter Clausen

[-- Attachment #1: Type: text/plain, Size: 1061 bytes --]

On Tue, Nov 25, 2014 at 01:03:19PM -0800, Olof Johansson wrote:
> Fixes build error:
> 
> sound/soc/soc-core.c: In function 'snd_soc_component_exit_regmap':
> sound/soc/soc-core.c:2644:2: error: implicit declaration of function 'regmap_exit' [-Werror=implicit-function-declaration]
>   regmap_exit(component->regmap);

In which configuration?

> Due to the other regmap functions providing appropriate stubs when
> !CONFIG_REGMAP, but this one is missing. Add it.

Be careful on this one, you'll notice that the matching creation
functions *aren't* stubbed since there is no way to reference them
without an active dependency on regmap and indeed this use is a bit
dodgy since the core ends up freeing something that a driver allocated
which isn't ideal but probably is OK due to the general horrificness of
the AC'97 device model integration.  We only stub functions that generic
code might have a sensible reason to use in order to make it less faff
to provide generic helpers for things.  

I'll tweak the commit message when applying.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] regmap: provide dummy regmap_exit()
  2014-11-25 21:14     ` Mark Brown
@ 2014-11-25 21:18       ` Mark Brown
  2014-11-25 21:27       ` Olof Johansson
  1 sibling, 0 replies; 6+ messages in thread
From: Mark Brown @ 2014-11-25 21:18 UTC (permalink / raw)
  To: Olof Johansson; +Cc: linux-kernel, Lars-Peter Clausen

[-- Attachment #1: Type: text/plain, Size: 352 bytes --]

On Tue, Nov 25, 2014 at 09:14:31PM +0000, Mark Brown wrote:

> I'll tweak the commit message when applying.

Oh, on second thoughts Lars sent his orthogonal fix so we don't need
this for build.  Given that I'm not entirely happy with that one user
and don't really want to see others I'll skip this so we catch any other
potential users.  Makes sense?

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] regmap: provide dummy regmap_exit()
  2014-11-25 21:14     ` Mark Brown
  2014-11-25 21:18       ` Mark Brown
@ 2014-11-25 21:27       ` Olof Johansson
  1 sibling, 0 replies; 6+ messages in thread
From: Olof Johansson @ 2014-11-25 21:27 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-kernel@vger.kernel.org, Lars-Peter Clausen

On Tue, Nov 25, 2014 at 1:14 PM, Mark Brown <broonie@kernel.org> wrote:
> On Tue, Nov 25, 2014 at 01:03:19PM -0800, Olof Johansson wrote:
>> Fixes build error:
>>
>> sound/soc/soc-core.c: In function 'snd_soc_component_exit_regmap':
>> sound/soc/soc-core.c:2644:2: error: implicit declaration of function 'regmap_exit' [-Werror=implicit-function-declaration]
>>   regmap_exit(component->regmap);
>
> In which configuration?

eseries_pxa_defconfig

>> Due to the other regmap functions providing appropriate stubs when
>> !CONFIG_REGMAP, but this one is missing. Add it.
>
> Be careful on this one, you'll notice that the matching creation
> functions *aren't* stubbed since there is no way to reference them
> without an active dependency on regmap and indeed this use is a bit
> dodgy since the core ends up freeing something that a driver allocated
> which isn't ideal but probably is OK due to the general horrificness of
> the AC'97 device model integration.  We only stub functions that generic
> code might have a sensible reason to use in order to make it less faff
> to provide generic helpers for things.
>
> I'll tweak the commit message when applying.

Based on the other reply, you went with ifdefs in the audio code
instead, which is ok with me.


-Olof

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-11-25 21:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-25 20:21 [PATCH] regmap: provide dummy regmap_exit() Olof Johansson
2014-11-25 20:39 ` Lars-Peter Clausen
2014-11-25 21:03   ` [PATCH v2] " Olof Johansson
2014-11-25 21:14     ` Mark Brown
2014-11-25 21:18       ` Mark Brown
2014-11-25 21:27       ` Olof Johansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox