[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: utilizing another device driver routine..




On Wed, Dec 08, 1999 at 04:00:53AM +0500, CyberPsychotic wrote:
> Hello people,
> I am playing with device drivers for my hardware, and I've got  a few
> questions:
> I found out that I could use another device's routine which works with
> the same chip, but I get `undefined symbol' errors, when I try to link the
> bsd image, though in the other device driver these are declared as
> `static', and I declare them as `extern'. Is there anything I am missing
> here? 

This is a C language issue.  A quick review:

"static" = this is for my use only, mine mine mine, don't let anyone
   else see it.

"extern" = I want to share; if possible I want to share *yours*.

You would need to remove the "static" modifier in the first driver, if
you want to link with it; however, there might be a good reason it was
made private.  E.g. the driver will break if it's used from more than
one place.  Changing this without understanding the driver might work
fine, or might lead to a kernel build that runs fine most of the time,
but crashes "randomly" if the two devices are used near the same time.

  -- Clifton

-- 
 Clifton Royston  --  LavaNet Systems Architect --  cliftonr@lava.net
        "An absolute monarch would be absolutely wise and good.  
           But no man is strong enough to have no interest.  
             Therefore the best king would be Pure Chance.  
              It is Pure Chance that rules the Universe; 
          therefore, and only therefore, life is good." - AC