diff --git a/driver/init.c b/driver/init.c index 0d2b17c..be03f7b 100644 --- a/driver/init.c +++ b/driver/init.c @@ -3,21 +3,21 @@ #include #include +#include "ls7366r.h" +#include "trigger.h" +#include "leds.h" MODULE_LICENSE("GPL"); MODULE_AUTHOR("Wolfgang Hottgenroth"); MODULE_DESCRIPTION("Driver for the MainsCnt measurement hat"); -extern struct platform_driver leds_driver; -extern struct spi_driver ls7366r_driver; -extern struct platform_driver interrupt_driver; /* module loading and unloading */ static int __init my_init(void) { printk("counter - Loading the leds driver...\n"); if(platform_driver_register(&leds_driver)) { - printk("dt_gpio - Error! Could not load leds driver\n"); + printk("counter - Error! Could not load leds driver\n"); return -1; } @@ -29,7 +29,7 @@ static int __init my_init(void) { printk("counter - Loading the interrupt driver...\n"); if(platform_driver_register(&interrupt_driver)) { - printk("dt_gpio - Error! Could not load interrupt driver\n"); + printk("counter - Error! Could not load interrupt driver\n"); return -1; } diff --git a/driver/leds.h b/driver/leds.h index e69de29..56f0af9 100644 --- a/driver/leds.h +++ b/driver/leds.h @@ -0,0 +1,8 @@ +#ifndef _LEDS_H_ +#define _LEDS_H_ + +#include + +extern struct platform_driver leds_driver; + +#endif /* _LEDS_H_ */ diff --git a/driver/ls7366r.c b/driver/ls7366r.c index ec487ee..90ff711 100644 --- a/driver/ls7366r.c +++ b/driver/ls7366r.c @@ -6,9 +6,6 @@ #include #include #include -#include -#include -#include #include "ls7366r_registers.h" #include "ls7366r.h" diff --git a/driver/ls7366r.h b/driver/ls7366r.h index 04b756a..ca776da 100644 --- a/driver/ls7366r.h +++ b/driver/ls7366r.h @@ -1,6 +1,11 @@ #ifndef _LS7366R_H_ #define _LS7366R_H_ +#include + +extern struct spi_driver ls7366r_driver; +extern struct spi_device *ls7366r_spi_client; + int read_otr(struct spi_device *client, u32 *r); #endif /* _LS7366R_H_ */ diff --git a/driver/trigger.c b/driver/trigger.c index 1025a41..52d318f 100644 --- a/driver/trigger.c +++ b/driver/trigger.c @@ -14,7 +14,6 @@ -extern struct spi_device *ls7366r_spi_client; /* interrupt stuff */ diff --git a/driver/trigger.h b/driver/trigger.h new file mode 100644 index 0000000..c08412e --- /dev/null +++ b/driver/trigger.h @@ -0,0 +1,8 @@ +#ifndef _TRIGGER_H_ +#define _TRIGGER_H_ + +#include + +extern struct platform_driver interrupt_driver; + +#endif /* _TRIGGER_H_ */