Commit 63ad39dc authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] remove driver model code in mwave driver

From: Christoph Hellwig <hch@lst.de>

Someone blindly added sysfs support to the driver long time ago without
understanding the implications (and if they were understood the driver
would need half a rewrite for it).  Herber Xu recently noticed the problems
this causes on unload, so let's if 0 out all that code and get the driver
working again.
parent dd3871ec
...@@ -466,6 +466,7 @@ static struct file_operations mwave_fops = { ...@@ -466,6 +466,7 @@ static struct file_operations mwave_fops = {
static struct miscdevice mwave_misc_dev = { MWAVE_MINOR, "mwave", &mwave_fops }; static struct miscdevice mwave_misc_dev = { MWAVE_MINOR, "mwave", &mwave_fops };
#if 0 /* totally b0rked */
/* /*
* sysfs support <paulsch@us.ibm.com> * sysfs support <paulsch@us.ibm.com>
*/ */
...@@ -499,6 +500,7 @@ static struct device_attribute * const mwave_dev_attrs[] = { ...@@ -499,6 +500,7 @@ static struct device_attribute * const mwave_dev_attrs[] = {
&dev_attr_uart_irq, &dev_attr_uart_irq,
&dev_attr_uart_io, &dev_attr_uart_io,
}; };
#endif
/* /*
* mwave_init is called on module load * mwave_init is called on module load
...@@ -508,11 +510,11 @@ static struct device_attribute * const mwave_dev_attrs[] = { ...@@ -508,11 +510,11 @@ static struct device_attribute * const mwave_dev_attrs[] = {
*/ */
static void mwave_exit(void) static void mwave_exit(void)
{ {
int i;
pMWAVE_DEVICE_DATA pDrvData = &mwave_s_mdd; pMWAVE_DEVICE_DATA pDrvData = &mwave_s_mdd;
PRINTK_1(TRACE_MWAVE, "mwavedd::mwave_exit entry\n"); PRINTK_1(TRACE_MWAVE, "mwavedd::mwave_exit entry\n");
#if 0
for (i = 0; i < pDrvData->nr_registered_attrs; i++) for (i = 0; i < pDrvData->nr_registered_attrs; i++)
device_remove_file(&mwave_device, mwave_dev_attrs[i]); device_remove_file(&mwave_device, mwave_dev_attrs[i]);
pDrvData->nr_registered_attrs = 0; pDrvData->nr_registered_attrs = 0;
...@@ -521,6 +523,7 @@ static void mwave_exit(void) ...@@ -521,6 +523,7 @@ static void mwave_exit(void)
device_unregister(&mwave_device); device_unregister(&mwave_device);
pDrvData->device_registered = FALSE; pDrvData->device_registered = FALSE;
} }
#endif
if ( pDrvData->sLine >= 0 ) { if ( pDrvData->sLine >= 0 ) {
unregister_serial(pDrvData->sLine); unregister_serial(pDrvData->sLine);
...@@ -638,6 +641,7 @@ static int __init mwave_init(void) ...@@ -638,6 +641,7 @@ static int __init mwave_init(void)
} }
/* uart is registered */ /* uart is registered */
#if 0
/* sysfs */ /* sysfs */
memset(&mwave_device, 0, sizeof (struct device)); memset(&mwave_device, 0, sizeof (struct device));
snprintf(mwave_device.bus_id, BUS_ID_SIZE, "mwave"); snprintf(mwave_device.bus_id, BUS_ID_SIZE, "mwave");
...@@ -655,6 +659,7 @@ static int __init mwave_init(void) ...@@ -655,6 +659,7 @@ static int __init mwave_init(void)
} }
pDrvData->nr_registered_attrs++; pDrvData->nr_registered_attrs++;
} }
#endif
/* SUCCESS! */ /* SUCCESS! */
return 0; return 0;
......
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