Commit d7b9f322 authored by Mattias Wallin's avatar Mattias Wallin Committed by Samuel Ortiz

mfd: Fix ab8500-debug indentation errors

Replace spaces with proper tabs.
Signed-off-by: default avatarMattias Wallin <mattias.wallin@stericsson.com>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent baa3f63b
...@@ -24,9 +24,9 @@ static u32 debug_address; ...@@ -24,9 +24,9 @@ static u32 debug_address;
* @perm: access permissions for the range * @perm: access permissions for the range
*/ */
struct ab8500_reg_range { struct ab8500_reg_range {
u8 first; u8 first;
u8 last; u8 last;
u8 perm; u8 perm;
}; };
/** /**
...@@ -36,9 +36,9 @@ struct ab8500_reg_range { ...@@ -36,9 +36,9 @@ struct ab8500_reg_range {
* @range: the list of register ranges * @range: the list of register ranges
*/ */
struct ab8500_i2c_ranges { struct ab8500_i2c_ranges {
u8 num_ranges; u8 num_ranges;
u8 bankid; u8 bankid;
const struct ab8500_reg_range *range; const struct ab8500_reg_range *range;
}; };
#define AB8500_NAME_STRING "ab8500" #define AB8500_NAME_STRING "ab8500"
...@@ -47,521 +47,521 @@ struct ab8500_i2c_ranges { ...@@ -47,521 +47,521 @@ struct ab8500_i2c_ranges {
#define AB8500_REV_REG 0x80 #define AB8500_REV_REG 0x80
static struct ab8500_i2c_ranges debug_ranges[AB8500_NUM_BANKS] = { static struct ab8500_i2c_ranges debug_ranges[AB8500_NUM_BANKS] = {
[0x0] = { [0x0] = {
.num_ranges = 0, .num_ranges = 0,
.range = 0, .range = 0,
}, },
[AB8500_SYS_CTRL1_BLOCK] = { [AB8500_SYS_CTRL1_BLOCK] = {
.num_ranges = 3, .num_ranges = 3,
.range = (struct ab8500_reg_range[]) { .range = (struct ab8500_reg_range[]) {
{ {
.first = 0x00, .first = 0x00,
.last = 0x02, .last = 0x02,
}, },
{ {
.first = 0x42, .first = 0x42,
.last = 0x42, .last = 0x42,
}, },
{ {
.first = 0x80, .first = 0x80,
.last = 0x81, .last = 0x81,
}, },
}, },
}, },
[AB8500_SYS_CTRL2_BLOCK] = { [AB8500_SYS_CTRL2_BLOCK] = {
.num_ranges = 4, .num_ranges = 4,
.range = (struct ab8500_reg_range[]) { .range = (struct ab8500_reg_range[]) {
{ {
.first = 0x00, .first = 0x00,
.last = 0x0D, .last = 0x0D,
}, },
{ {
.first = 0x0F, .first = 0x0F,
.last = 0x17, .last = 0x17,
}, },
{ {
.first = 0x30, .first = 0x30,
.last = 0x30, .last = 0x30,
}, },
{ {
.first = 0x32, .first = 0x32,
.last = 0x33, .last = 0x33,
}, },
}, },
}, },
[AB8500_REGU_CTRL1] = { [AB8500_REGU_CTRL1] = {
.num_ranges = 3, .num_ranges = 3,
.range = (struct ab8500_reg_range[]) { .range = (struct ab8500_reg_range[]) {
{ {
.first = 0x00, .first = 0x00,
.last = 0x00, .last = 0x00,
}, },
{ {
.first = 0x03, .first = 0x03,
.last = 0x10, .last = 0x10,
}, },
{ {
.first = 0x80, .first = 0x80,
.last = 0x84, .last = 0x84,
}, },
}, },
}, },
[AB8500_REGU_CTRL2] = { [AB8500_REGU_CTRL2] = {
.num_ranges = 5, .num_ranges = 5,
.range = (struct ab8500_reg_range[]) { .range = (struct ab8500_reg_range[]) {
{ {
.first = 0x00, .first = 0x00,
.last = 0x15, .last = 0x15,
}, },
{ {
.first = 0x17, .first = 0x17,
.last = 0x19, .last = 0x19,
}, },
{ {
.first = 0x1B, .first = 0x1B,
.last = 0x1D, .last = 0x1D,
}, },
{ {
.first = 0x1F, .first = 0x1F,
.last = 0x22, .last = 0x22,
}, },
{ {
.first = 0x40, .first = 0x40,
.last = 0x44, .last = 0x44,
}, },
/* 0x80-0x8B is SIM registers and should /* 0x80-0x8B is SIM registers and should
* not be accessed from here */ * not be accessed from here */
}, },
}, },
[AB8500_USB] = { [AB8500_USB] = {
.num_ranges = 2, .num_ranges = 2,
.range = (struct ab8500_reg_range[]) { .range = (struct ab8500_reg_range[]) {
{ {
.first = 0x80, .first = 0x80,
.last = 0x83, .last = 0x83,
}, },
{ {
.first = 0x87, .first = 0x87,
.last = 0x8A, .last = 0x8A,
}, },
}, },
}, },
[AB8500_TVOUT] = { [AB8500_TVOUT] = {
.num_ranges = 9, .num_ranges = 9,
.range = (struct ab8500_reg_range[]) { .range = (struct ab8500_reg_range[]) {
{ {
.first = 0x00, .first = 0x00,
.last = 0x12, .last = 0x12,
}, },
{ {
.first = 0x15, .first = 0x15,
.last = 0x17, .last = 0x17,
}, },
{ {
.first = 0x19, .first = 0x19,
.last = 0x21, .last = 0x21,
}, },
{ {
.first = 0x27, .first = 0x27,
.last = 0x2C, .last = 0x2C,
}, },
{ {
.first = 0x41, .first = 0x41,
.last = 0x41, .last = 0x41,
}, },
{ {
.first = 0x45, .first = 0x45,
.last = 0x5B, .last = 0x5B,
}, },
{ {
.first = 0x5D, .first = 0x5D,
.last = 0x5D, .last = 0x5D,
}, },
{ {
.first = 0x69, .first = 0x69,
.last = 0x69, .last = 0x69,
}, },
{ {
.first = 0x80, .first = 0x80,
.last = 0x81, .last = 0x81,
}, },
}, },
}, },
[AB8500_DBI] = { [AB8500_DBI] = {
.num_ranges = 0, .num_ranges = 0,
.range = 0, .range = 0,
}, },
[AB8500_ECI_AV_ACC] = { [AB8500_ECI_AV_ACC] = {
.num_ranges = 1, .num_ranges = 1,
.range = (struct ab8500_reg_range[]) { .range = (struct ab8500_reg_range[]) {
{ {
.first = 0x80, .first = 0x80,
.last = 0x82, .last = 0x82,
}, },
}, },
}, },
[0x9] = { [0x9] = {
.num_ranges = 0, .num_ranges = 0,
.range = 0, .range = 0,
}, },
[AB8500_GPADC] = { [AB8500_GPADC] = {
.num_ranges = 1, .num_ranges = 1,
.range = (struct ab8500_reg_range[]) { .range = (struct ab8500_reg_range[]) {
{ {
.first = 0x00, .first = 0x00,
.last = 0x08, .last = 0x08,
}, },
}, },
}, },
[AB8500_CHARGER] = { [AB8500_CHARGER] = {
.num_ranges = 8, .num_ranges = 8,
.range = (struct ab8500_reg_range[]) { .range = (struct ab8500_reg_range[]) {
{ {
.first = 0x00, .first = 0x00,
.last = 0x03, .last = 0x03,
}, },
{ {
.first = 0x05, .first = 0x05,
.last = 0x05, .last = 0x05,
}, },
{ {
.first = 0x40, .first = 0x40,
.last = 0x40, .last = 0x40,
}, },
{ {
.first = 0x42, .first = 0x42,
.last = 0x42, .last = 0x42,
}, },
{ {
.first = 0x44, .first = 0x44,
.last = 0x44, .last = 0x44,
}, },
{ {
.first = 0x50, .first = 0x50,
.last = 0x55, .last = 0x55,
}, },
{ {
.first = 0x80, .first = 0x80,
.last = 0x82, .last = 0x82,
}, },
{ {
.first = 0xC0, .first = 0xC0,
.last = 0xC2, .last = 0xC2,
}, },
}, },
}, },
[AB8500_GAS_GAUGE] = { [AB8500_GAS_GAUGE] = {
.num_ranges = 3, .num_ranges = 3,
.range = (struct ab8500_reg_range[]) { .range = (struct ab8500_reg_range[]) {
{ {
.first = 0x00, .first = 0x00,
.last = 0x00, .last = 0x00,
}, },
{ {
.first = 0x07, .first = 0x07,
.last = 0x0A, .last = 0x0A,
}, },
{ {
.first = 0x10, .first = 0x10,
.last = 0x14, .last = 0x14,
}, },
}, },
}, },
[AB8500_AUDIO] = { [AB8500_AUDIO] = {
.num_ranges = 1, .num_ranges = 1,
.range = (struct ab8500_reg_range[]) { .range = (struct ab8500_reg_range[]) {
{ {
.first = 0x00, .first = 0x00,
.last = 0x6F, .last = 0x6F,
}, },
}, },
}, },
[AB8500_INTERRUPT] = { [AB8500_INTERRUPT] = {
.num_ranges = 0, .num_ranges = 0,
.range = 0, .range = 0,
}, },
[AB8500_RTC] = { [AB8500_RTC] = {
.num_ranges = 1, .num_ranges = 1,
.range = (struct ab8500_reg_range[]) { .range = (struct ab8500_reg_range[]) {
{ {
.first = 0x00, .first = 0x00,
.last = 0x0F, .last = 0x0F,
}, },
}, },
}, },
[AB8500_MISC] = { [AB8500_MISC] = {
.num_ranges = 8, .num_ranges = 8,
.range = (struct ab8500_reg_range[]) { .range = (struct ab8500_reg_range[]) {
{ {
.first = 0x00, .first = 0x00,
.last = 0x05, .last = 0x05,
}, },
{ {
.first = 0x10, .first = 0x10,
.last = 0x15, .last = 0x15,
}, },
{ {
.first = 0x20, .first = 0x20,
.last = 0x25, .last = 0x25,
}, },
{ {
.first = 0x30, .first = 0x30,
.last = 0x35, .last = 0x35,
}, },
{ {
.first = 0x40, .first = 0x40,
.last = 0x45, .last = 0x45,
}, },
{ {
.first = 0x50, .first = 0x50,
.last = 0x50, .last = 0x50,
}, },
{ {
.first = 0x60, .first = 0x60,
.last = 0x67, .last = 0x67,
}, },
{ {
.first = 0x80, .first = 0x80,
.last = 0x80, .last = 0x80,
}, },
}, },
}, },
[0x11] = { [0x11] = {
.num_ranges = 0, .num_ranges = 0,
.range = 0, .range = 0,
}, },
[0x12] = { [0x12] = {
.num_ranges = 0, .num_ranges = 0,
.range = 0, .range = 0,
}, },
[0x13] = { [0x13] = {
.num_ranges = 0, .num_ranges = 0,
.range = 0, .range = 0,
}, },
[0x14] = { [0x14] = {
.num_ranges = 0, .num_ranges = 0,
.range = 0, .range = 0,
}, },
[AB8500_OTP_EMUL] = { [AB8500_OTP_EMUL] = {
.num_ranges = 1, .num_ranges = 1,
.range = (struct ab8500_reg_range[]) { .range = (struct ab8500_reg_range[]) {
{ {
.first = 0x01, .first = 0x01,
.last = 0x0F, .last = 0x0F,
}, },
}, },
}, },
}; };
static int ab8500_registers_print(struct seq_file *s, void *p) static int ab8500_registers_print(struct seq_file *s, void *p)
{ {
struct device *dev = s->private; struct device *dev = s->private;
unsigned int i; unsigned int i;
u32 bank = debug_bank; u32 bank = debug_bank;
seq_printf(s, AB8500_NAME_STRING " register values:\n"); seq_printf(s, AB8500_NAME_STRING " register values:\n");
seq_printf(s, " bank %u:\n", bank); seq_printf(s, " bank %u:\n", bank);
for (i = 0; i < debug_ranges[bank].num_ranges; i++) { for (i = 0; i < debug_ranges[bank].num_ranges; i++) {
u32 reg; u32 reg;
for (reg = debug_ranges[bank].range[i].first; for (reg = debug_ranges[bank].range[i].first;
reg <= debug_ranges[bank].range[i].last; reg <= debug_ranges[bank].range[i].last;
reg++) { reg++) {
u8 value; u8 value;
int err; int err;
err = abx500_get_register_interruptible(dev, err = abx500_get_register_interruptible(dev,
(u8)bank, (u8)reg, &value); (u8)bank, (u8)reg, &value);
if (err < 0) { if (err < 0) {
dev_err(dev, "ab->read fail %d\n", err); dev_err(dev, "ab->read fail %d\n", err);
return err; return err;
} }
err = seq_printf(s, " [%u/0x%02X]: 0x%02X\n", bank, err = seq_printf(s, " [%u/0x%02X]: 0x%02X\n", bank,
reg, value); reg, value);
if (err < 0) { if (err < 0) {
dev_err(dev, "seq_printf overflow\n"); dev_err(dev, "seq_printf overflow\n");
/* Error is not returned here since /* Error is not returned here since
* the output is wanted in any case */ * the output is wanted in any case */
return 0; return 0;
} }
} }
} }
return 0; return 0;
} }
static int ab8500_registers_open(struct inode *inode, struct file *file) static int ab8500_registers_open(struct inode *inode, struct file *file)
{ {
return single_open(file, ab8500_registers_print, inode->i_private); return single_open(file, ab8500_registers_print, inode->i_private);
} }
static const struct file_operations ab8500_registers_fops = { static const struct file_operations ab8500_registers_fops = {
.open = ab8500_registers_open, .open = ab8500_registers_open,
.read = seq_read, .read = seq_read,
.llseek = seq_lseek, .llseek = seq_lseek,
.release = single_release, .release = single_release,
.owner = THIS_MODULE, .owner = THIS_MODULE,
}; };
static int ab8500_bank_print(struct seq_file *s, void *p) static int ab8500_bank_print(struct seq_file *s, void *p)
{ {
return seq_printf(s, "%d\n", debug_bank); return seq_printf(s, "%d\n", debug_bank);
} }
static int ab8500_bank_open(struct inode *inode, struct file *file) static int ab8500_bank_open(struct inode *inode, struct file *file)
{ {
return single_open(file, ab8500_bank_print, inode->i_private); return single_open(file, ab8500_bank_print, inode->i_private);
} }
static ssize_t ab8500_bank_write(struct file *file, static ssize_t ab8500_bank_write(struct file *file,
const char __user *user_buf, const char __user *user_buf,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
{ {
struct device *dev = ((struct seq_file *)(file->private_data))->private; struct device *dev = ((struct seq_file *)(file->private_data))->private;
char buf[32]; char buf[32];
int buf_size; int buf_size;
unsigned long user_bank; unsigned long user_bank;
int err; int err;
/* Get userspace string and assure termination */ /* Get userspace string and assure termination */
buf_size = min(count, (sizeof(buf) - 1)); buf_size = min(count, (sizeof(buf) - 1));
if (copy_from_user(buf, user_buf, buf_size)) if (copy_from_user(buf, user_buf, buf_size))
return -EFAULT; return -EFAULT;
buf[buf_size] = 0; buf[buf_size] = 0;
err = strict_strtoul(buf, 0, &user_bank); err = strict_strtoul(buf, 0, &user_bank);
if (err) if (err)
return -EINVAL; return -EINVAL;
if (user_bank >= AB8500_NUM_BANKS) { if (user_bank >= AB8500_NUM_BANKS) {
dev_err(dev, "debugfs error input > number of banks\n"); dev_err(dev, "debugfs error input > number of banks\n");
return -EINVAL; return -EINVAL;
} }
debug_bank = user_bank; debug_bank = user_bank;
return buf_size; return buf_size;
} }
static int ab8500_address_print(struct seq_file *s, void *p) static int ab8500_address_print(struct seq_file *s, void *p)
{ {
return seq_printf(s, "0x%02X\n", debug_address); return seq_printf(s, "0x%02X\n", debug_address);
} }
static int ab8500_address_open(struct inode *inode, struct file *file) static int ab8500_address_open(struct inode *inode, struct file *file)
{ {
return single_open(file, ab8500_address_print, inode->i_private); return single_open(file, ab8500_address_print, inode->i_private);
} }
static ssize_t ab8500_address_write(struct file *file, static ssize_t ab8500_address_write(struct file *file,
const char __user *user_buf, const char __user *user_buf,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
{ {
struct device *dev = ((struct seq_file *)(file->private_data))->private; struct device *dev = ((struct seq_file *)(file->private_data))->private;
char buf[32]; char buf[32];
int buf_size; int buf_size;
unsigned long user_address; unsigned long user_address;
int err; int err;
/* Get userspace string and assure termination */ /* Get userspace string and assure termination */
buf_size = min(count, (sizeof(buf) - 1)); buf_size = min(count, (sizeof(buf) - 1));
if (copy_from_user(buf, user_buf, buf_size)) if (copy_from_user(buf, user_buf, buf_size))
return -EFAULT; return -EFAULT;
buf[buf_size] = 0; buf[buf_size] = 0;
err = strict_strtoul(buf, 0, &user_address); err = strict_strtoul(buf, 0, &user_address);
if (err) if (err)
return -EINVAL; return -EINVAL;
if (user_address > 0xff) { if (user_address > 0xff) {
dev_err(dev, "debugfs error input > 0xff\n"); dev_err(dev, "debugfs error input > 0xff\n");
return -EINVAL; return -EINVAL;
} }
debug_address = user_address; debug_address = user_address;
return buf_size; return buf_size;
} }
static int ab8500_val_print(struct seq_file *s, void *p) static int ab8500_val_print(struct seq_file *s, void *p)
{ {
struct device *dev = s->private; struct device *dev = s->private;
int ret; int ret;
u8 regvalue; u8 regvalue;
ret = abx500_get_register_interruptible(dev, ret = abx500_get_register_interruptible(dev,
(u8)debug_bank, (u8)debug_address, &regvalue); (u8)debug_bank, (u8)debug_address, &regvalue);
if (ret < 0) { if (ret < 0) {
dev_err(dev, "abx500_get_reg fail %d, %d\n", dev_err(dev, "abx500_get_reg fail %d, %d\n",
ret, __LINE__); ret, __LINE__);
return -EINVAL; return -EINVAL;
} }
seq_printf(s, "0x%02X\n", regvalue); seq_printf(s, "0x%02X\n", regvalue);
return 0; return 0;
} }
static int ab8500_val_open(struct inode *inode, struct file *file) static int ab8500_val_open(struct inode *inode, struct file *file)
{ {
return single_open(file, ab8500_val_print, inode->i_private); return single_open(file, ab8500_val_print, inode->i_private);
} }
static ssize_t ab8500_val_write(struct file *file, static ssize_t ab8500_val_write(struct file *file,
const char __user *user_buf, const char __user *user_buf,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
{ {
struct device *dev = ((struct seq_file *)(file->private_data))->private; struct device *dev = ((struct seq_file *)(file->private_data))->private;
char buf[32]; char buf[32];
int buf_size; int buf_size;
unsigned long user_val; unsigned long user_val;
int err; int err;
/* Get userspace string and assure termination */ /* Get userspace string and assure termination */
buf_size = min(count, (sizeof(buf)-1)); buf_size = min(count, (sizeof(buf)-1));
if (copy_from_user(buf, user_buf, buf_size)) if (copy_from_user(buf, user_buf, buf_size))
return -EFAULT; return -EFAULT;
buf[buf_size] = 0; buf[buf_size] = 0;
err = strict_strtoul(buf, 0, &user_val); err = strict_strtoul(buf, 0, &user_val);
if (err) if (err)
return -EINVAL; return -EINVAL;
if (user_val > 0xff) { if (user_val > 0xff) {
dev_err(dev, "debugfs error input > 0xff\n"); dev_err(dev, "debugfs error input > 0xff\n");
return -EINVAL; return -EINVAL;
} }
err = abx500_set_register_interruptible(dev, err = abx500_set_register_interruptible(dev,
(u8)debug_bank, debug_address, (u8)user_val); (u8)debug_bank, debug_address, (u8)user_val);
if (err < 0) { if (err < 0) {
printk(KERN_ERR "abx500_set_reg failed %d, %d", err, __LINE__); printk(KERN_ERR "abx500_set_reg failed %d, %d", err, __LINE__);
return -EINVAL; return -EINVAL;
} }
return buf_size; return buf_size;
} }
static const struct file_operations ab8500_bank_fops = { static const struct file_operations ab8500_bank_fops = {
.open = ab8500_bank_open, .open = ab8500_bank_open,
.write = ab8500_bank_write, .write = ab8500_bank_write,
.read = seq_read, .read = seq_read,
.llseek = seq_lseek, .llseek = seq_lseek,
.release = single_release, .release = single_release,
.owner = THIS_MODULE, .owner = THIS_MODULE,
}; };
static const struct file_operations ab8500_address_fops = { static const struct file_operations ab8500_address_fops = {
.open = ab8500_address_open, .open = ab8500_address_open,
.write = ab8500_address_write, .write = ab8500_address_write,
.read = seq_read, .read = seq_read,
.llseek = seq_lseek, .llseek = seq_lseek,
.release = single_release, .release = single_release,
.owner = THIS_MODULE, .owner = THIS_MODULE,
}; };
static const struct file_operations ab8500_val_fops = { static const struct file_operations ab8500_val_fops = {
.open = ab8500_val_open, .open = ab8500_val_open,
.write = ab8500_val_write, .write = ab8500_val_write,
.read = seq_read, .read = seq_read,
.llseek = seq_lseek, .llseek = seq_lseek,
.release = single_release, .release = single_release,
.owner = THIS_MODULE, .owner = THIS_MODULE,
}; };
static struct dentry *ab8500_dir; static struct dentry *ab8500_dir;
...@@ -572,77 +572,77 @@ static struct dentry *ab8500_val_file; ...@@ -572,77 +572,77 @@ static struct dentry *ab8500_val_file;
static int __devinit ab8500_debug_probe(struct platform_device *plf) static int __devinit ab8500_debug_probe(struct platform_device *plf)
{ {
debug_bank = AB8500_MISC; debug_bank = AB8500_MISC;
debug_address = AB8500_REV_REG & 0x00FF; debug_address = AB8500_REV_REG & 0x00FF;
ab8500_dir = debugfs_create_dir(AB8500_NAME_STRING, NULL); ab8500_dir = debugfs_create_dir(AB8500_NAME_STRING, NULL);
if (!ab8500_dir) if (!ab8500_dir)
goto exit_no_debugfs; goto exit_no_debugfs;
ab8500_reg_file = debugfs_create_file("all-bank-registers", ab8500_reg_file = debugfs_create_file("all-bank-registers",
S_IRUGO, ab8500_dir, &plf->dev, &ab8500_registers_fops); S_IRUGO, ab8500_dir, &plf->dev, &ab8500_registers_fops);
if (!ab8500_reg_file) if (!ab8500_reg_file)
goto exit_destroy_dir; goto exit_destroy_dir;
ab8500_bank_file = debugfs_create_file("register-bank", ab8500_bank_file = debugfs_create_file("register-bank",
(S_IRUGO | S_IWUGO), ab8500_dir, &plf->dev, &ab8500_bank_fops); (S_IRUGO | S_IWUGO), ab8500_dir, &plf->dev, &ab8500_bank_fops);
if (!ab8500_bank_file) if (!ab8500_bank_file)
goto exit_destroy_reg; goto exit_destroy_reg;
ab8500_address_file = debugfs_create_file("register-address", ab8500_address_file = debugfs_create_file("register-address",
(S_IRUGO | S_IWUGO), ab8500_dir, &plf->dev, (S_IRUGO | S_IWUGO), ab8500_dir, &plf->dev,
&ab8500_address_fops); &ab8500_address_fops);
if (!ab8500_address_file) if (!ab8500_address_file)
goto exit_destroy_bank; goto exit_destroy_bank;
ab8500_val_file = debugfs_create_file("register-value", ab8500_val_file = debugfs_create_file("register-value",
(S_IRUGO | S_IWUGO), ab8500_dir, &plf->dev, &ab8500_val_fops); (S_IRUGO | S_IWUGO), ab8500_dir, &plf->dev, &ab8500_val_fops);
if (!ab8500_val_file) if (!ab8500_val_file)
goto exit_destroy_address; goto exit_destroy_address;
return 0; return 0;
exit_destroy_address: exit_destroy_address:
debugfs_remove(ab8500_address_file); debugfs_remove(ab8500_address_file);
exit_destroy_bank: exit_destroy_bank:
debugfs_remove(ab8500_bank_file); debugfs_remove(ab8500_bank_file);
exit_destroy_reg: exit_destroy_reg:
debugfs_remove(ab8500_reg_file); debugfs_remove(ab8500_reg_file);
exit_destroy_dir: exit_destroy_dir:
debugfs_remove(ab8500_dir); debugfs_remove(ab8500_dir);
exit_no_debugfs: exit_no_debugfs:
dev_err(&plf->dev, "failed to create debugfs entries.\n"); dev_err(&plf->dev, "failed to create debugfs entries.\n");
return -ENOMEM; return -ENOMEM;
} }
static int __devexit ab8500_debug_remove(struct platform_device *plf) static int __devexit ab8500_debug_remove(struct platform_device *plf)
{ {
debugfs_remove(ab8500_val_file); debugfs_remove(ab8500_val_file);
debugfs_remove(ab8500_address_file); debugfs_remove(ab8500_address_file);
debugfs_remove(ab8500_bank_file); debugfs_remove(ab8500_bank_file);
debugfs_remove(ab8500_reg_file); debugfs_remove(ab8500_reg_file);
debugfs_remove(ab8500_dir); debugfs_remove(ab8500_dir);
return 0; return 0;
} }
static struct platform_driver ab8500_debug_driver = { static struct platform_driver ab8500_debug_driver = {
.driver = { .driver = {
.name = "ab8500-debug", .name = "ab8500-debug",
.owner = THIS_MODULE, .owner = THIS_MODULE,
}, },
.probe = ab8500_debug_probe, .probe = ab8500_debug_probe,
.remove = __devexit_p(ab8500_debug_remove) .remove = __devexit_p(ab8500_debug_remove)
}; };
static int __init ab8500_debug_init(void) static int __init ab8500_debug_init(void)
{ {
return platform_driver_register(&ab8500_debug_driver); return platform_driver_register(&ab8500_debug_driver);
} }
static void __exit ab8500_debug_exit(void) static void __exit ab8500_debug_exit(void)
{ {
platform_driver_unregister(&ab8500_debug_driver); platform_driver_unregister(&ab8500_debug_driver);
} }
subsys_initcall(ab8500_debug_init); subsys_initcall(ab8500_debug_init);
module_exit(ab8500_debug_exit); module_exit(ab8500_debug_exit);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment