* [PATCH] iio: sw-device: Fix config group initialization
@ 2017-03-09 16:20 Lars-Peter Clausen
2017-03-09 16:24 ` Lars-Peter Clausen
2017-03-10 7:54 ` Daniel Baluta
0 siblings, 2 replies; 4+ messages in thread
From: Lars-Peter Clausen @ 2017-03-09 16:20 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Hartmut Knaack, Peter Meerwald-Stadler, Daniel Baluta,
Miguel Robles, linux-iio, Lars-Peter Clausen
Use the IS_ENABLED() helper macro to ensure that the configfs group is
initialized either when configfs is built-in or when configfs is built as a
module. Otherwise software device creation will result in undefined
behaviour when configfs is built as a mdoule since the configfs group for
the device not properly initialized.
Similar to commit b2f0c09664b7 ("iio: sw-trigger: Fix config group
initialization").
Fixes: 0f3a8c3f34f7 ("iio: Add support for creating IIO devices via configfs")
Reported-by: Miguel Robles <miguel.robles@farole.net>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
include/linux/iio/sw_device.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/iio/sw_device.h b/include/linux/iio/sw_device.h
index 23ca415..fa79319 100644
--- a/include/linux/iio/sw_device.h
+++ b/include/linux/iio/sw_device.h
@@ -62,7 +62,7 @@ void iio_swd_group_init_type_name(struct iio_sw_device *d,
const char *name,
struct config_item_type *type)
{
-#ifdef CONFIG_CONFIGFS_FS
+#if IS_ENABLED(CONFIG_CONFIGFS_FS)
config_group_init_type_name(&d->group, name, type);
#endif
}
--
2.1.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] iio: sw-device: Fix config group initialization
2017-03-09 16:20 [PATCH] iio: sw-device: Fix config group initialization Lars-Peter Clausen
@ 2017-03-09 16:24 ` Lars-Peter Clausen
2017-03-10 7:54 ` Daniel Baluta
1 sibling, 0 replies; 4+ messages in thread
From: Lars-Peter Clausen @ 2017-03-09 16:24 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Hartmut Knaack, Peter Meerwald-Stadler, Daniel Baluta,
Miguel Robles, linux-iio
On 03/09/2017 05:20 PM, Lars-Peter Clausen wrote:
> Use the IS_ENABLED() helper macro to ensure that the configfs group is
> initialized either when configfs is built-in or when configfs is built as a
> module. Otherwise software device creation will result in undefined
> behaviour when configfs is built as a mdoule since the configfs group for
typo: module
> the device not properly initialized.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] iio: sw-device: Fix config group initialization
2017-03-09 16:20 [PATCH] iio: sw-device: Fix config group initialization Lars-Peter Clausen
2017-03-09 16:24 ` Lars-Peter Clausen
@ 2017-03-10 7:54 ` Daniel Baluta
2017-03-13 20:43 ` Jonathan Cameron
1 sibling, 1 reply; 4+ messages in thread
From: Daniel Baluta @ 2017-03-10 7:54 UTC (permalink / raw)
To: Lars-Peter Clausen
Cc: Jonathan Cameron, Hartmut Knaack, Peter Meerwald-Stadler,
Miguel Robles, linux-iio
On Thu, Mar 9, 2017 at 6:20 PM, Lars-Peter Clausen <lars@metafoo.de> wrote:
> Use the IS_ENABLED() helper macro to ensure that the configfs group is
> initialized either when configfs is built-in or when configfs is built as a
> module. Otherwise software device creation will result in undefined
> behaviour when configfs is built as a mdoule since the configfs group for
> the device not properly initialized.
>
> Similar to commit b2f0c09664b7 ("iio: sw-trigger: Fix config group
> initialization").
>
> Fixes: 0f3a8c3f34f7 ("iio: Add support for creating IIO devices via configfs")
> Reported-by: Miguel Robles <miguel.robles@farole.net>
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Daniel Baluta <daniel.baluta@gmail.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] iio: sw-device: Fix config group initialization
2017-03-10 7:54 ` Daniel Baluta
@ 2017-03-13 20:43 ` Jonathan Cameron
0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Cameron @ 2017-03-13 20:43 UTC (permalink / raw)
To: Daniel Baluta, Lars-Peter Clausen
Cc: Hartmut Knaack, Peter Meerwald-Stadler, Miguel Robles, linux-iio
On 10/03/17 07:54, Daniel Baluta wrote:
> On Thu, Mar 9, 2017 at 6:20 PM, Lars-Peter Clausen <lars@metafoo.de> wrote:
>> Use the IS_ENABLED() helper macro to ensure that the configfs group is
>> initialized either when configfs is built-in or when configfs is built as a
>> module. Otherwise software device creation will result in undefined
>> behaviour when configfs is built as a mdoule since the configfs group for
>> the device not properly initialized.
>>
>> Similar to commit b2f0c09664b7 ("iio: sw-trigger: Fix config group
>> initialization").
>>
>> Fixes: 0f3a8c3f34f7 ("iio: Add support for creating IIO devices via configfs")
>> Reported-by: Miguel Robles <miguel.robles@farole.net>
>> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
>
> Acked-by: Daniel Baluta <daniel.baluta@gmail.com>
Applied to the fixes-togreg branch of iio.git
with description typo fixed and marked for stable.
Thanks,
Jonathan
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-03-13 20:44 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-09 16:20 [PATCH] iio: sw-device: Fix config group initialization Lars-Peter Clausen
2017-03-09 16:24 ` Lars-Peter Clausen
2017-03-10 7:54 ` Daniel Baluta
2017-03-13 20:43 ` Jonathan Cameron
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.