-#define DEBUG
/*
* Copyright (C) 2004 Texas Instruments, Inc.
*
#define DRIVER_NAME "menelaus"
-#define pr_err(fmt, arg...) printk(KERN_ERR DRIVER_NAME ": ", ## arg);
-
#define MENELAUS_I2C_ADDRESS 0x72
#define MENELAUS_REV 0x01
int val = i2c_smbus_write_byte_data(the_menelaus->client, reg, value);
if (val < 0) {
- pr_err("write error");
+ dev_err(&the_menelaus->client->dev, "write error");
return val;
}
int val = i2c_smbus_read_byte_data(the_menelaus->client, reg);
if (val < 0)
- pr_err("read error");
+ dev_err(&the_menelaus->client->dev, "read error");
return val;
}
/* If a true probe check the device */
rev = menelaus_read_reg(MENELAUS_REV);
if (rev < 0) {
- pr_err("device not found");
+ dev_err(&client->dev, "device not found");
err = -ENODEV;
goto fail1;
}
mutex_init(&menelaus->lock);
INIT_WORK(&menelaus->work, menelaus_work);
- pr_info("Menelaus rev %d.%d\n", rev >> 4, rev & 0x0f);
+ dev_info(&client->dev, "Menelaus rev %d.%d\n", rev >> 4, rev & 0x0f);
val = menelaus_read_reg(MENELAUS_VCORE_CTRL1);
if (val < 0)
res = i2c_add_driver(&menelaus_i2c_driver);
if (res < 0) {
- pr_err("driver registration failed\n");
+ dev_err(&the_menelaus->client->dev, "driver registration failed\n");
return res;
}