Messages in this thread | | | Date | Wed, 17 Nov 1999 15:53:02 -0800 (PST) | From | Linux Lists <> | Subject | Re: Allowing WAN card driver to be built-in to the kernel |
| |
On Wed, 17 Nov 1999, Alan Cox wrote:
> > static struct device cpc1_dev = > > {"cpc1", 0, 0, 0, 0, 0, 0, 0, 0, 0, &cpc2_dev, NULL}; > > You don't need these
If I don't have these, I get the following kernel msg:
early initialization of device cpc1 is deferred early initialization of device cpc2 is deferred (...)
> > static struct device cpc0_dev = > > {"cpc0", 0, 0, 0, 0, 0, 0, 0, 0, 0, &cpc1_dev, cpc_probe}; > > Cal it something like "cpc_init"
I already have a function called cpc_init ... :) Anyhow, let's focus on the problem for now. I can change the names later, if necessary.
> > The problem is that as this is not a pointer, it can't be the same > > structure as the one defined in Space.c (or can it??) and, thus, I don't > > have how to tell the driver (and syncppp) to use the structure defined in > > Space.c. If I use the Space.c definition in the driver, it will not be in > > sync with the ppp_device structure, and that will surely cause problems. > > You dont want to use the structure in Space.c. Throw it away. For pci > devices its actually just a legacy mess. Return a failure in the probe > routine after allocating your new drivers
Even in this case, it would be better to have a pointer in ppp_device instead of the structure itself. Imagine the case where the driver supports several different protocols (which actually is the case of my driver -- it supports X.25 as well as PPP/Cisco HDLC). In this case, I would have to declare the ppp_device structure anyway just to use the struct device inside it, and this doesn't sound right to me. Do you agree??
Question: could you please tell me how I should implement this thing so that I don't get the aforementioned msg ("early initialization ..."), besides having the first device functional??
Regards, Ivan
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |