lkml.org 
[lkml]   [1996]   [May]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectRe: Dummy driver broken in pre-2.0.5
Date
>  *          Thomas Bogendoerfer :       Return ENODEV for dev_open, if there
> * is no device open function.
>
> breaks the dummy device; unless it is compiled as a module, it has no
> device open function. I did

upps, that's the second thing, which broke because my change:-(

> I'm sure there is a good reason that this is the wrong solution, but
> It Works For Me

your patch is ok. But I don't see a reason, why we should use two
different open routines.

Thomas.

--- orig/linux-pre-2.0.5/drivers/net/dummy.c Wed May 8 20:29:10 1996
+++ linux-pre-2.0.5/drivers/net/dummy.c Sun May 19 12:45:50 1996
@@ -58,19 +58,22 @@
static struct enet_statistics *dummy_get_stats(struct device *dev);
#endif

-#ifdef MODULE
+
static int dummy_open(struct device *dev)
{
+#ifdef MODULE
MOD_INC_USE_COUNT;
+#endif
return 0;
}

static int dummy_close(struct device *dev)
{
+#ifdef MODULE
MOD_DEC_USE_COUNT;
+#endif
return 0;
}
-#endif


int dummy_init(struct device *dev)
@@ -89,10 +92,8 @@
memset(dev->priv, 0, sizeof(struct enet_statistics));
dev->get_stats = dummy_get_stats;
#endif
-#ifdef MODULE
dev->open = &dummy_open;
dev->stop = &dummy_close;
-#endif

/* Fill in the fields of the device structure with ethernet-generic values. */
ether_setup(dev);
--
That process _deserves_ to die ("My name is Linus Torvalds, prepare to
die"). [Linus Torvalds on linux-kernel]


\
 
 \ /
  Last update: 2005-03-22 13:37    [W:0.022 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site