linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marek Belisko <marek.belisko@open-nandra.com>
To: Greg Kroah-Hartman <gregkh@suse.de>
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
	Marek Belisko <marek.belisko@open-nandra.com>
Subject: [PATCH 1/6] staging: ft1000: Remove functions which create devices in kernel space.
Date: Tue, 23 Nov 2010 13:29:28 +0100	[thread overview]
Message-ID: <1290515373-16145-2-git-send-email-marek.belisko@open-nandra.com> (raw)
In-Reply-To: <1290515373-16145-1-git-send-email-marek.belisko@open-nandra.com>

Remove exec_mknod() and rm_mknod() helpers which was used for
device nodes creating/removing in kernel space.

Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com>
---
 drivers/staging/ft1000/ft1000-usb/ft1000_chdev.c |   93 ----------------------
 1 files changed, 0 insertions(+), 93 deletions(-)

diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_chdev.c b/drivers/staging/ft1000/ft1000-usb/ft1000_chdev.c
index 76cee9e..1aec926 100644
--- a/drivers/staging/ft1000/ft1000-usb/ft1000_chdev.c
+++ b/drivers/staging/ft1000/ft1000-usb/ft1000_chdev.c
@@ -78,88 +78,6 @@ static struct file_operations ft1000fops =
 	.llseek		= no_llseek,
 };
 
-
-
-
-//---------------------------------------------------------------------------
-// Function:    exec_mknod
-//
-// Parameters:
-//
-// Returns:
-//
-// Description:
-//
-// Notes:
-//
-//---------------------------------------------------------------------------
-static int exec_mknod (void *pdata)
-{
-	struct ft1000_info *info;
-    char mjnum[4];
-    char minornum[4];
-    char temp[32];
-    int retcode;
-//    int i;					//aelias [-] reason : unused variable
-    char *envp[] = { "HOME=/", "PATH=/usr/bin:/bin", NULL };
-    char *argv[]={"-m 666",temp,"c",mjnum,minornum,NULL};
-
-    info = pdata;
-    DEBUG("ft1000_chdev:exec_mknod is called with major number = %d\n", info->DeviceMajor);
-    sprintf(temp, "%s%s", "/dev/", info->DeviceName) ;
-    sprintf(mjnum, "%d", info->DeviceMajor);
-    sprintf(minornum, "%d", info->CardNumber);
-
-    //char *argv[]={"mknod","-m 666",temp,"c",mjnum,minornum,NULL};
-//    char *argv[]={"-m 666",temp,"c",mjnum,minornum,NULL};
-
-    //for (i=0; i<7;i++)
-    //    DEBUG("argv[%d]=%s\n", i, argv[i]);
-
-
-    retcode = call_usermodehelper ("/bin/mknod", argv, envp, 1);
-    if (retcode) {
-        DEBUG("ft1000_chdev:exec_mknod failed to make the node: retcode = %d\n", retcode);
-    }
-
-
-
-    return retcode;
-
-}
-
-//---------------------------------------------------------------------------
-// Function:    rm_mknod
-//
-// Description: This module removes the FT1000 device file
-//
-//---------------------------------------------------------------------------
-static int rm_mknod (void *pdata)
-{
-
-	struct ft1000_info *info;
-    //char *argv[4]={"rm", "-f", "/dev/FT1000", NULL};
-    int retcode;
-    char temp[32];
-    char *argv[]={"rm", "-f", temp, NULL};
-
-	info = (struct ft1000_info *)pdata;
-    DEBUG("ft1000_chdev:rm_mknod is called for device %s\n", info->DeviceName);
-    sprintf(temp, "%s%s", "/dev/", info->DeviceName) ;
-
-//    char *argv[]={"rm", "-f", temp, NULL};
-
-    retcode = call_usermodehelper ("/bin/rm", argv, NULL, 1);
-    if (retcode) {
-        DEBUG("ft1000_chdev:rm_mknod failed to remove the node: retcode = %d\n", retcode);
-    }
-    else
-        DEBUG("ft1000_chdev:rm_mknod done!\n");
-
-
-    return retcode;
-
-}
 //---------------------------------------------------------------------------
 // Function:    ft1000_get_buffer
 //
@@ -238,15 +156,10 @@ int ft1000_CreateDevice(struct ft1000_device *dev)
 	struct ft1000_info *info = netdev_priv(dev->net);
     int result;
     int i;
-    pid_t pid;
 
     // make a new device name
     sprintf(info->DeviceName, "%s%d", "FT100", info->CardNumber);
 
-    // Delete any existing FT1000 node
-    pid = kernel_thread (rm_mknod,(void *)info, 0);
-    msleep(1000);
-
     DEBUG("ft1000_CreateDevice: number of instance = %d\n", ft1000_flarion_cnt);
     DEBUG("DeviceCreated = %x\n", info->DeviceCreated);
 
@@ -282,9 +195,6 @@ int ft1000_CreateDevice(struct ft1000_device *dev)
 	DEBUG("ft1000_PcdCreateDevice: device major = %d\n", info->DeviceMajor);
     }
 
-    // Create a thread to call user mode app to mknod
-    pid = kernel_thread (exec_mknod, (void *)info, 0);
-
     // initialize application information
 
 //    if (ft1000_flarion_cnt == 0) {
@@ -350,7 +260,6 @@ void ft1000_DestroyDevice(struct net_device *dev)
 {
 	struct ft1000_info *info = netdev_priv(dev);
     int result = 0;
-    pid_t pid;
 		int i;
 	struct dpram_blk *pdpram_blk;
 	struct dpram_blk *ptr;
@@ -366,8 +275,6 @@ void ft1000_DestroyDevice(struct net_device *dev)
 		DEBUG("ft1000_DestroyDevice: unregistered device \"%s\", result = %d\n",
 					   info->DeviceName, result);
 
-       pid = kernel_thread (rm_mknod, (void *)info, 0);
-
         // Make sure we free any memory reserve for slow Queue
         for (i=0; i<MAX_NUM_APP; i++) {
             while (list_empty(&info->app_info[i].app_sqlist) == 0) {
-- 
1.7.1


  reply	other threads:[~2010-11-23 12:27 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-23 12:29 [PATCH 0/6] Add misc device handling Marek Belisko
2010-11-23 12:29 ` Marek Belisko [this message]
2010-11-23 12:29 ` [PATCH 2/6] staging: ft1000: Use misc device instead self created device Marek Belisko
2010-11-23 13:53   ` Jiri Slaby
2010-11-23 14:00     ` Belisko Marek
2010-11-23 21:28       ` Jiri Slaby
2010-11-24  9:16         ` Belisko Marek
2010-11-29 19:44           ` Greg KH
2010-11-29 20:08             ` Belisko Marek
2010-12-01  4:06               ` Greg KH
2010-12-01  9:35                 ` Belisko Marek
2010-11-23 12:29 ` [PATCH 3/6] staging: ft1000: Remove unused variables Marek Belisko
2010-11-23 12:29 ` [PATCH 4/6] staging: ft1000: Remove unused headers Marek Belisko
2010-11-29 19:43   ` Greg KH
2010-11-23 12:29 ` [PATCH 5/6] staging: ft1000: Remove dead code Marek Belisko
2010-11-23 12:29 ` [PATCH 6/6] staging: ft1000: Check return value of ft1000_CreateDevice() Marek Belisko
2010-11-29 19:44 ` [PATCH 0/6] Add misc device handling Greg KH

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=1290515373-16145-2-git-send-email-marek.belisko@open-nandra.com \
    --to=marek.belisko@open-nandra.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    /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).