Commit 2dc0026b authored by Alessandro Rubini's avatar Alessandro Rubini

general: fixed diagnostics, less verbose

parent 0a6b3b6f
......@@ -7,7 +7,7 @@ KBUILD_EXTRA_SYMBOLS := $(ZIO)/Module.symvers $(SPEC_SW)/kernel/Module.symvers
ccflags-y = -I$(ZIO)/include -I$(SPEC_SW)/kernel -I$M
ccflags-y += -DDEBUG # temporary
#ccflags-y += -DDEBUG
subdirs-ccflags-y = $(ccflags-y)
......
......@@ -135,7 +135,6 @@ int fd_probe(struct spec_dev *dev)
struct spec_fd *fd;
int i, ret;
pr_debug("%s\n",__func__);
fd = kzalloc(sizeof(*fd), GFP_KERNEL);
if (!fd) {
pr_err("%s: can't allocate device\n", __func__);
......@@ -212,7 +211,6 @@ void fd_remove(struct spec_dev *dev)
if (!test_bit(FD_FLAG_INITED, &fd->flags))
return; /* No init, no exit */
pr_debug("%s\n",__func__);
while (--i >= 0) {
m = mods + i;
if (m->exit)
......@@ -224,7 +222,6 @@ static int fd_init(void)
{
int ret;
pr_debug("%s\n",__func__);
ret = fd_zio_register();
if (ret < 0)
return ret;
......
......@@ -24,7 +24,6 @@
static int fd_is_valid(int bus, int devfn)
{
/* FIXME: restrict to some of the spec devices with moduleparam */
pr_debug("%s: %x %x\n", __func__, bus, devfn);
return 1;
}
......
......@@ -524,7 +524,7 @@ out:
if (test_and_clear_bit(FD_FLAG_DO_OUTPUT + i, &fd->flags)) {
struct zio_cset *cset = fd->zdev->cset + i;
cset->ti->t_op->data_done(cset);
printk("called data_done\n");
pr_debug("called data_done\n");
}
mod_timer(&fd->fifo_timer, jiffies + fd_timer_period_jiffies);
......@@ -607,16 +607,13 @@ static int fd_zio_output(struct zio_cset *cset)
fd = cset->zdev->private_data;
ctrl = zio_get_ctrl(cset->chan->active_block);
for (i = 0; i < 4; i++)
printk("triggered %i: %x (%i)\n", i,
fd_ch_readl(fd, i, FD_REG_DCR),
fd_ch_readl(fd, i, FD_REG_DCR) & FD_DCR_PG_TRIG ? 1: 0);
pr_info("%s: attrs: ", __func__);
for (i = FD_ATTR_DEV__LAST; i < FD_ATTR_OUT__LAST; i++)
printk("%08x%c", ctrl->attr_channel.ext_val[i],
i == FD_ATTR_OUT__LAST -1 ? '\n' : ' ');
if (fd->verbose > 1) {
for (i = 0; i < 4; i++)
pr_info("%s: attrs: ", __func__);
for (i = FD_ATTR_DEV__LAST; i < FD_ATTR_OUT__LAST; i++)
printk("%08x%c", ctrl->attr_channel.ext_val[i],
i == FD_ATTR_OUT__LAST -1 ? '\n' : ' ');
}
__fd_zio_output(fd, cset->index, ctrl->attr_channel.ext_val);
/*
* There's a buglet in this version of zio: we can't
......
......@@ -53,7 +53,7 @@ static int gpio_writel_with_retry(struct spec_fd *fd, int val, int reg)
if(rv >= 0 && (rv == val))
{
if(SPI_RETRIES-1-retries > 0)
printk("%s: succeded after %d retries\n",
pr_info("%s: succeded after %d retries\n",
__func__, SPI_RETRIES - 1 - retries);
return 0;
}
......@@ -96,7 +96,6 @@ int fd_gpio_init(struct spec_fd *fd)
fd->mcp_iodir = 0xffff;
fd->mcp_olat = 0;
pr_debug("%s\n",__func__);
if (gpio_writel(fd, 0x00, FD_MCP_IOCON) < 0)
goto out;
......
......@@ -233,10 +233,11 @@ int fd_onewire_init(struct spec_fd *fd)
if(ds18x_read_serial(fd) < 0)
return -EIO;
pr_info("%s: Found DS18xx sensor: ", __func__);
for (i = 0; i < 8; i++)
printk("%02x%c", fd->ds18_id[i], i == 7 ? '\n' : ':');
if (fd->verbose) {
pr_info("%s: Found DS18xx sensor: ", __func__);
for (i = 0; i < 8; i++)
printk("%02x%c", fd->ds18_id[i], i == 7 ? '\n' : ':');
}
/* read the temperature once, to ensure it works, and print it */
fd_read_temp(fd, 2);
......
......@@ -40,7 +40,6 @@ int fd_pll_init(struct spec_fd *fd)
unsigned long j;
const struct ad9516_reg *r;
pr_debug("%s\n",__func__);
if (pll_writel(fd, 0x99, 0x000) < 0)
goto out;
if (pll_writel(fd, 0x01, 0x232) < 0)
......@@ -93,11 +92,8 @@ int fd_pll_init(struct spec_fd *fd)
if (pll_writel(fd, 0x01, 0x232) < 0)
goto out;
pr_debug("success!\n");
return 0;
out:
pr_err("%s: Error in SPI communication\n", KBUILD_MODNAME);
return -EIO;
......
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