Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1548546

[PATCH 5/5] Staging: comedi: proc: Warn if unable to create proc entry

From Cheah Kok Cheong <thrust73@gmail.com>
Newsgroups linux.kernel
Subject [PATCH 5/5] Staging: comedi: proc: Warn if unable to create proc entry
Date 2016-12-30 12:30 +0100
Message-ID <sU3xM-3H7-7@gated-at.bofh.it> (permalink)
References <sU3xM-3H7-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


The proc entry is not essential for the comedi system as
evident by the support for !CONFIG_PROC_FS. So for failure
to create, just warn and continue loading.

Signed-off-by: Cheah Kok Cheong <thrust73@gmail.com>
---
 drivers/staging/comedi/proc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/proc.c b/drivers/staging/comedi/proc.c
index 99b23b2e..2644dd4 100644
--- a/drivers/staging/comedi/proc.c
+++ b/drivers/staging/comedi/proc.c
@@ -89,7 +89,8 @@ static const struct file_operations comedi_proc_fops = {
 
 void __init comedi_proc_init(void)
 {
-	proc_create("comedi", 0444, NULL, &comedi_proc_fops);
+	if (!proc_create("comedi", 0444, NULL, &comedi_proc_fops))
+		pr_warn("comedi: unable to create proc entry\n");
 }
 
 void comedi_proc_cleanup(void)
-- 
2.7.4

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/5] Staging: comedi: Proc FS related cleanup Cheah Kok Cheong <thrust73@gmail.com> - 2016-12-30 12:30 +0100
  [PATCH 5/5] Staging: comedi: proc: Warn if unable to create proc entry Cheah Kok Cheong <thrust73@gmail.com> - 2016-12-30 12:30 +0100
  [PATCH 4/5] Staging: comedi: proc: Add module owner Cheah Kok Cheong <thrust73@gmail.com> - 2016-12-30 12:30 +0100
  [PATCH 3/5] Staging: comedi: proc: Add __init prefix Cheah Kok Cheong <thrust73@gmail.com> - 2016-12-30 12:30 +0100
  Re: [PATCH 0/5] Staging: comedi: Proc FS related cleanup Ian Abbott <abbotti@mev.co.uk> - 2017-01-03 11:50 +0100

csiph-web