mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-11-08 16:11:26 +00:00
Makefile enhancements, printk enhancements
* Modules now print their version number and date on insertion * Some printk statements missed a \n * 'make clean' now works, even if some .d (dependency) files contain garbage. Note that *only* 'make clean' helps in that case; 'make clean all', for example, will fail! There is really no nice way to solve that. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@11 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
d0f87b72e9
commit
ed7e4c3001
11 files changed
+36
-17
No files matched your search
+1
-1
@@ -25,7 +25,7 @@ MODULE_DIR := src
|
||||
SRCTARGETS := $(MODULE_DIR)/smbus.o $(MODULE_DIR)/piix4.o
|
||||
|
||||
# Include all dependency files
|
||||
include $(SRCTARGETS:.o=.d)
|
||||
INCLUDEFILES += $(SRCTARGETS:.o=.d)
|
||||
|
||||
all :: $(SRCTARGETS)
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <linux/module.h>
|
||||
#include <linux/kernel.h>
|
||||
#include "smbus.h"
|
||||
#include "version.h"
|
||||
|
||||
static int piix4_init(void);
|
||||
static int piix4_cleanup(void);
|
||||
@@ -39,6 +40,7 @@ static int piix4_initialized;
|
||||
Return -ENODEV if not found. */
|
||||
int piix4_setup(void)
|
||||
{
|
||||
return -ENODEV;
|
||||
/* TO BE WRITTEN! */
|
||||
}
|
||||
|
||||
@@ -53,15 +55,16 @@ s32 piix4_access(u8 addr, char read_write,
|
||||
int piix4_init(void)
|
||||
{
|
||||
int res;
|
||||
printk("piix4.o version %s (%s)\n",LM_VERSION,LM_DATE);
|
||||
#ifdef DEBUG
|
||||
if (piix4_initialized) {
|
||||
printk("piix4.o: Oops, piix4_init called a second time!");
|
||||
printk("piix4.o: Oops, piix4_init called a second time!\n");
|
||||
return -EBUSY;
|
||||
}
|
||||
#endif
|
||||
piix4_initialized = 0;
|
||||
if ((res = piix4_setup())) {
|
||||
printk("piix4.o: PIIX4 not detected, module not inserted");
|
||||
printk("piix4.o: PIIX4 not detected, module not inserted\n");
|
||||
piix4_cleanup();
|
||||
return res;
|
||||
}
|
||||
@@ -71,12 +74,12 @@ int piix4_init(void)
|
||||
piix4_adapter.algo = &smbus_algorithm;
|
||||
piix4_adapter.smbus_access = &piix4_access;
|
||||
if ((res = smbus_add_adapter(&piix4_adapter))) {
|
||||
printk("piix4.o: smbus_add_adapter failed, module not inserted");
|
||||
printk("piix4.o: smbus_add_adapter failed, module not inserted\n");
|
||||
piix4_cleanup();
|
||||
return res;
|
||||
}
|
||||
piix4_initialized++;
|
||||
printk("piix4.o: PIIX4 bus detected and initialized");
|
||||
printk("piix4.o: PIIX4 bus detected and initialized\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
+3
-1
@@ -26,6 +26,7 @@
|
||||
#include <asm/semaphore.h>
|
||||
#endif
|
||||
|
||||
#include "version.h"
|
||||
#include "smbus.h"
|
||||
|
||||
static s32 smbus_access_i2c (struct smbus_adapter * adapter, u8 addr,
|
||||
@@ -201,10 +202,11 @@ int smbus_detach_client(struct smbus_client *client)
|
||||
int smbus_init(void)
|
||||
{
|
||||
int res;
|
||||
printk("smbus.o version %s (%s)\n",LM_VERSION,LM_DATE);
|
||||
if ((res = smbus_add_algorithm(&smbus_algorithm)))
|
||||
printk("Module smbus.o not inserted!\n");
|
||||
else
|
||||
printk("smbus.o initialized");
|
||||
printk("smbus.o initialized\n");
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user