All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: most: register net and video config subsystems with configFS
@ 2019-06-12  9:30 Christian Gromm
  0 siblings, 0 replies; only message in thread
From: Christian Gromm @ 2019-06-12  9:30 UTC (permalink / raw)
  To: gregkh; +Cc: Christian Gromm, driverdev-devel

This patch makes the core components net and video register their config
subsystems with configFS. It is needed to have the configuration interface
of the modules exposed to user space.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
---
 drivers/staging/most/net/net.c     | 12 +++++++++++-
 drivers/staging/most/video/video.c | 12 +++++++++++-
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/most/net/net.c b/drivers/staging/most/net/net.c
index c8a64e2..3fc80ad 100644
--- a/drivers/staging/most/net/net.c
+++ b/drivers/staging/most/net/net.c
@@ -507,9 +507,19 @@ static struct core_component comp = {
 
 static int __init most_net_init(void)
 {
+	int err;
+
 	spin_lock_init(&list_lock);
 	mutex_init(&probe_disc_mt);
-	return most_register_component(&comp);
+	err = most_register_component(&comp);
+	if (err)
+		return err;
+	err = most_register_configfs_subsys(&comp);
+	if (err) {
+		most_deregister_component(&comp);
+		return err;
+	}
+	return 0;
 }
 
 static void __exit most_net_exit(void)
diff --git a/drivers/staging/most/video/video.c b/drivers/staging/most/video/video.c
index adca250..72622eb 100644
--- a/drivers/staging/most/video/video.c
+++ b/drivers/staging/most/video/video.c
@@ -540,8 +540,18 @@ static struct core_component comp = {
 
 static int __init comp_init(void)
 {
+	int err;
+
 	spin_lock_init(&list_lock);
-	return most_register_component(&comp);
+	err = most_register_component(&comp);
+	if (err)
+		return err;
+	err = most_register_configfs_subsys(&comp);
+	if (err) {
+		most_deregister_component(&comp);
+		return err;
+	}
+	return 0;
 }
 
 static void __exit comp_exit(void)
-- 
2.7.4

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-06-12  9:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-12  9:30 [PATCH] staging: most: register net and video config subsystems with configFS Christian Gromm

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.