Changeset 2801

Show
Ignore:
Timestamp:
12/22/04 18:43:16 (8 years ago)
Author:
khali
Message:

Define devexit_p for kernels which don't know about it (2.4.16

and older).

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/trunk/kernel/include/sensors_compat.h

    r1754 r2801  
    1010#ifndef _SENSORS_COMPAT_H_ 
    1111#define _SENSORS_COMPAT_H_ 
     12 
     13#include <linux/config.h> 
    1214 
    1315/* debugging and troubleshooting/diagnostic helpers. */ 
     
    2931        dev_printk(KERN_WARNING , dev , format , ## arg) 
    3032 
     33 
     34/* The part below, taken from linux/init.h, is required for compatibility with 
     35   kernels 2.4.16 and older, which don't know about __devexit_p. */ 
     36 
     37/* Functions marked as __devexit may be discarded at kernel link time, depending 
     38   on config options.  Newer versions of binutils detect references from 
     39   retained sections to discarded sections and flag an error.  Pointers to 
     40   __devexit functions must use __devexit_p(function_name), the wrapper will 
     41   insert either the function_name or NULL, depending on the config options. 
     42 */ 
     43#ifndef __devexit_p 
     44#if defined(MODULE) || defined(CONFIG_HOTPLUG) 
     45#define __devexit_p(x) x 
     46#else 
     47#define __devexit_p(x) NULL 
     48#endif 
     49#endif /* __devexit_p */ 
     50 
    3151#endif /* _SENSORS_COMPAT_H_ */