Commit ac1da162 authored by Glen Lee's avatar Glen Lee Committed by Greg Kroah-Hartman

staging: wilc1000: sdio/spi: use device print api instead of custom one

This patch use device print api instead of driver defined print. Remove
varialbe dPrint as well. String "[wilc sdio]" and "[wilc spi]" are also removed
from all the print statment if exist because it shows which device the message
is related to.
Signed-off-by: default avatarGlen Lee <glen.lee@atmel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 67e2a07e
......@@ -52,7 +52,7 @@ int wilc_sdio_cmd52(struct wilc *wilc, sdio_cmd52_t *cmd)
sdio_release_host(func);
if (ret < 0) {
PRINT_ER("wilc_sdio_cmd52..failed, err(%d)\n", ret);
dev_err(&func->dev, "wilc_sdio_cmd52..failed, err(%d)\n", ret);
return 0;
}
return 1;
......@@ -83,7 +83,7 @@ int wilc_sdio_cmd53(struct wilc *wilc, sdio_cmd53_t *cmd)
if (ret < 0) {
PRINT_ER("wilc_sdio_cmd53..failed, err(%d)\n", ret);
dev_err(&func->dev, "wilc_sdio_cmd53..failed, err(%d)\n", ret);
return 0;
}
......@@ -102,16 +102,16 @@ static int linux_sdio_probe(struct sdio_func *func, const struct sdio_device_id
gpio = GPIO_NUM;
}
PRINT_D(INIT_DBG, "Initializing netdev\n");
dev_dbg(&func->dev, "Initializing netdev\n");
if (wilc_netdev_init(&wilc, &func->dev, HIF_SDIO, gpio,
&wilc_hif_sdio)) {
PRINT_ER("Couldn't initialize netdev\n");
dev_err(&func->dev, "Couldn't initialize netdev\n");
return -1;
}
sdio_set_drvdata(func, wilc);
wilc->dev = &func->dev;
printk("Driver Initializing success\n");
dev_info(&func->dev, "Driver Initializing success\n");
return 0;
}
......@@ -139,7 +139,7 @@ int wilc_sdio_enable_interrupt(struct wilc *dev)
sdio_release_host(func);
if (ret < 0) {
PRINT_ER("can't claim sdio_irq, err(%d)\n", ret);
dev_err(&func->dev, "can't claim sdio_irq, err(%d)\n", ret);
ret = -EIO;
}
return ret;
......@@ -150,16 +150,16 @@ void wilc_sdio_disable_interrupt(struct wilc *dev)
struct sdio_func *func = container_of(dev->dev, struct sdio_func, dev);
int ret;
PRINT_D(INIT_DBG, "wilc_sdio_disable_interrupt IN\n");
dev_dbg(&func->dev, "wilc_sdio_disable_interrupt IN\n");
sdio_claim_host(func);
ret = sdio_release_irq(func);
if (ret < 0) {
PRINT_ER("can't release sdio_irq, err(%d)\n", ret);
dev_err(&func->dev, "can't release sdio_irq, err(%d)\n", ret);
}
sdio_release_host(func);
PRINT_D(INIT_DBG, "wilc_sdio_disable_interrupt OUT\n");
dev_info(&func->dev, "wilc_sdio_disable_interrupt OUT\n");
}
int wilc_sdio_init(void)
......
......@@ -83,7 +83,7 @@ int wilc_spi_write(struct wilc *wilc, u8 *b, u32 len)
return -ENOMEM;
tr.rx_buf = r_buffer;
PRINT_D(BUS_DBG, "Request writing %d bytes\n", len);
dev_dbg(&spi->dev, "Request writing %d bytes\n", len);
memset(&msg, 0, sizeof(msg));
spi_message_init(&msg);
......@@ -95,13 +95,17 @@ int wilc_spi_write(struct wilc *wilc, u8 *b, u32 len)
ret = spi_sync(spi, &msg);
if (ret < 0) {
PRINT_ER("SPI transaction failed\n");
dev_err(&spi->dev, "SPI transaction failed\n");
}
kfree(r_buffer);
} else {
PRINT_ER("can't write data with the following length: %d\n", len);
PRINT_ER("FAILED due to NULL buffer or ZERO length check the following length: %d\n", len);
dev_err(&spi->dev,
"can't write data with the following length: %d\n",
len);
dev_err(&spi->dev,
"FAILED due to NULL buffer or ZERO length check the following length: %d\n",
len);
ret = -1;
}
......@@ -141,11 +145,13 @@ int wilc_spi_read(struct wilc *wilc, u8 *rb, u32 rlen)
ret = spi_sync(spi, &msg);
if (ret < 0) {
PRINT_ER("SPI transaction failed\n");
dev_err(&spi->dev, "SPI transaction failed\n");
}
kfree(t_buffer);
} else {
PRINT_ER("can't read data with the following length: %u\n", rlen);
dev_err(&spi->dev,
"can't read data with the following length: %u\n",
rlen);
ret = -1;
}
/* change return value to match WILC interface */
......@@ -178,10 +184,12 @@ int wilc_spi_write_read(struct wilc *wilc, u8 *wb, u8 *rb, u32 rlen)
spi_message_add_tail(&tr, &msg);
ret = spi_sync(spi, &msg);
if (ret < 0) {
PRINT_ER("SPI transaction failed\n");
dev_err(&spi->dev, "SPI transaction failed\n");
}
} else {
PRINT_ER("can't read data with the following length: %u\n", rlen);
dev_err(&spi->dev,
"can't read data with the following length: %u\n",
rlen);
ret = -1;
}
/* change return value to match WILC interface */
......
This diff is collapsed.
This diff is collapsed.
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