Commit 5781aaf2 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] ip2 cleanup

	switched to devfs_remove(), killed gratitious devfs_handle_t fields.
parent 62e492d5
...@@ -405,12 +405,6 @@ typedef struct _i2eBordStr ...@@ -405,12 +405,6 @@ typedef struct _i2eBordStr
struct timer_list SendPendingTimer; // Used by iiSendPending struct timer_list SendPendingTimer; // Used by iiSendPending
unsigned int SendPendingRetry; unsigned int SendPendingRetry;
#ifdef CONFIG_DEVFS_FS
/* Device handles into devfs */
devfs_handle_t devfs_ipl_handle;
devfs_handle_t devfs_stat_handle;
#endif
} i2eBordStr, *i2eBordStrPtr; } i2eBordStr, *i2eBordStrPtr;
//------------------------------------------------------------------- //-------------------------------------------------------------------
......
...@@ -510,10 +510,8 @@ cleanup_module(void) ...@@ -510,10 +510,8 @@ cleanup_module(void)
iiResetDelay( i2BoardPtrTable[i] ); iiResetDelay( i2BoardPtrTable[i] );
/* free io addresses and Tibet */ /* free io addresses and Tibet */
release_region( ip2config.addr[i], 8 ); release_region( ip2config.addr[i], 8 );
#ifdef CONFIG_DEVFS_FS devfs_remove("ip2/ipl%d", i);
devfs_unregister (i2BoardPtrTable[i]->devfs_ipl_handle); devfs_remove("ip2/stat%d", i);
devfs_unregister (i2BoardPtrTable[i]->devfs_stat_handle);
#endif
} }
/* Disable and remove interrupt handler. */ /* Disable and remove interrupt handler. */
if ( (ip2config.irq[i] > 0) && have_requested_irq(ip2config.irq[i]) ) { if ( (ip2config.irq[i] > 0) && have_requested_irq(ip2config.irq[i]) ) {
...@@ -521,6 +519,7 @@ cleanup_module(void) ...@@ -521,6 +519,7 @@ cleanup_module(void)
clear_requested_irq( ip2config.irq[i]); clear_requested_irq( ip2config.irq[i]);
} }
} }
devfs_remove("ip2");
if ( ( err = tty_unregister_driver ( &ip2_tty_driver ) ) ) { if ( ( err = tty_unregister_driver ( &ip2_tty_driver ) ) ) {
printk(KERN_ERR "IP2: failed to unregister tty driver (%d)\n", err); printk(KERN_ERR "IP2: failed to unregister tty driver (%d)\n", err);
} }
...@@ -574,7 +573,6 @@ int ...@@ -574,7 +573,6 @@ int
ip2_loadmain(int *iop, int *irqp, unsigned char *firmware, int firmsize) ip2_loadmain(int *iop, int *irqp, unsigned char *firmware, int firmsize)
{ {
#ifdef CONFIG_DEVFS_FS #ifdef CONFIG_DEVFS_FS
static devfs_handle_t devfs_handle;
int j, box; int j, box;
#endif #endif
int i; int i;
...@@ -869,10 +867,6 @@ ip2_loadmain(int *iop, int *irqp, unsigned char *firmware, int firmsize) ...@@ -869,10 +867,6 @@ ip2_loadmain(int *iop, int *irqp, unsigned char *firmware, int firmsize)
/* Register the interrupt handler or poll handler, depending upon the /* Register the interrupt handler or poll handler, depending upon the
* specified interrupt. * specified interrupt.
*/ */
#ifdef CONFIG_DEVFS_FS
if (!devfs_handle)
devfs_handle = devfs_mk_dir (NULL, "ip2", NULL);
#endif
for( i = 0; i < IP2_MAX_BOARDS; ++i ) { for( i = 0; i < IP2_MAX_BOARDS; ++i ) {
#ifdef CONFIG_DEVFS_FS #ifdef CONFIG_DEVFS_FS
...@@ -885,17 +879,15 @@ ip2_loadmain(int *iop, int *irqp, unsigned char *firmware, int firmsize) ...@@ -885,17 +879,15 @@ ip2_loadmain(int *iop, int *irqp, unsigned char *firmware, int firmsize)
#ifdef CONFIG_DEVFS_FS #ifdef CONFIG_DEVFS_FS
if ( NULL != ( pB = i2BoardPtrTable[i] ) ) { if ( NULL != ( pB = i2BoardPtrTable[i] ) ) {
sprintf( name, "ipl%d", i ); sprintf( name, "ip2/ipl%d", i );
pB->devfs_ipl_handle = devfs_register(NULL, name,
devfs_register (devfs_handle, name,
DEVFS_FL_DEFAULT, DEVFS_FL_DEFAULT,
IP2_IPL_MAJOR, 4 * i, IP2_IPL_MAJOR, 4 * i,
S_IRUSR | S_IWUSR | S_IRGRP | S_IFCHR, S_IRUSR | S_IWUSR | S_IRGRP | S_IFCHR,
&ip2_ipl, NULL); &ip2_ipl, NULL);
sprintf( name, "stat%d", i ); sprintf( name, "ip2/stat%d", i );
pB->devfs_stat_handle = devfs_register(NULL, name,
devfs_register (devfs_handle, name,
DEVFS_FL_DEFAULT, DEVFS_FL_DEFAULT,
IP2_IPL_MAJOR, 4 * i + 1, IP2_IPL_MAJOR, 4 * i + 1,
S_IRUSR | S_IWUSR | S_IRGRP | S_IFCHR, S_IRUSR | S_IWUSR | S_IRGRP | S_IFCHR,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment