summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Richter <stefanr@s5r6.in-berlin.de>2010-07-22 11:56:38 +0200
committerStefan Richter <stefanr@s5r6.in-berlin.de>2010-07-27 11:04:11 +0200
commit7429b17d30a19fd52a0c07de9d3959746d321e15 (patch)
tree2dc1e07547893ed804fd06b84eb24a86a38cc571
parentfd8c8d46ca9402c15383d2cf0bc3ee7740de3b62 (diff)
firewire: nosy: use generic printk macros
Replace home-grown printk wrapper macros by ones from kernel.h and device.h. Also raise the log level in set_phy_reg() from debug to error because these are really error conditions. Could even be WARN_ON. Lower the log level in the device probe and driver shutdown from notice to info. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
-rw-r--r--drivers/firewire/nosy.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/drivers/firewire/nosy.c b/drivers/firewire/nosy.c
index 225e64956823..8528b10763ed 100644
--- a/drivers/firewire/nosy.c
+++ b/drivers/firewire/nosy.c
@@ -17,6 +17,7 @@
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+#include <linux/device.h>
#include <linux/errno.h>
#include <linux/fs.h>
#include <linux/init.h>
@@ -45,10 +46,6 @@
#define TCODE_PHY_PACKET 0x10
#define PCI_DEVICE_ID_TI_PCILYNX 0x8000
-#define notify(s, args...) printk(KERN_NOTICE s, ## args)
-#define error(s, args...) printk(KERN_ERR s, ## args)
-#define debug(s, args...) printk(KERN_DEBUG s, ## args)
-
static char driver_name[] = KBUILD_MODNAME;
/* this is the physical layout of a PCL, its size is 128 bytes */
@@ -260,15 +257,15 @@ static int
set_phy_reg(struct pcilynx *lynx, int addr, int val)
{
if (addr > 15) {
- debug("PHY register address %d out of range\n", addr);
+ dev_err(&lynx->pci_device->dev,
+ "PHY register address %d out of range\n", addr);
return -1;
}
-
if (val > 0xff) {
- debug("PHY register value %d out of range\n", val);
+ dev_err(&lynx->pci_device->dev,
+ "PHY register value %d out of range\n", val);
return -1;
}
-
reg_write(lynx, LINK_PHY, LINK_PHY_WRITE |
LINK_PHY_ADDR(addr) | LINK_PHY_WDATA(val));
@@ -540,19 +537,19 @@ add_card(struct pci_dev *dev, const struct pci_device_id *unused)
int ret, i;
if (pci_set_dma_mask(dev, 0xffffffff)) {
- error("DMA address limits not supported "
- "for PCILynx hardware\n");
+ dev_err(&dev->dev,
+ "DMA address limits not supported for PCILynx hardware\n");
return -ENXIO;
}
if (pci_enable_device(dev)) {
- error("Failed to enable PCILynx hardware\n");
+ dev_err(&dev->dev, "Failed to enable PCILynx hardware\n");
return -ENXIO;
}
pci_set_master(dev);
lynx = kzalloc(sizeof *lynx, GFP_KERNEL);
if (lynx == NULL) {
- error("Failed to allocate control structure memory\n");
+ dev_err(&dev->dev, "Failed to allocate control structure\n");
ret = -ENOMEM;
goto fail_disable;
}
@@ -575,7 +572,7 @@ add_card(struct pci_dev *dev, const struct pci_device_id *unused)
if (lynx->rcv_start_pcl == NULL ||
lynx->rcv_pcl == NULL ||
lynx->rcv_buffer == NULL) {
- error("Failed to allocate receive buffer\n");
+ dev_err(&dev->dev, "Failed to allocate receive buffer\n");
ret = -ENOMEM;
goto fail_deallocate;
}
@@ -637,7 +634,8 @@ add_card(struct pci_dev *dev, const struct pci_device_id *unused)
if (request_irq(dev->irq, irq_handler, IRQF_SHARED,
driver_name, lynx)) {
- error("Failed to allocate shared interrupt %d\n", dev->irq);
+ dev_err(&dev->dev,
+ "Failed to allocate shared interrupt %d\n", dev->irq);
ret = -EIO;
goto fail_deallocate;
}
@@ -650,14 +648,15 @@ add_card(struct pci_dev *dev, const struct pci_device_id *unused)
mutex_lock(&card_mutex);
ret = misc_register(&lynx->misc);
if (ret) {
- error("Failed to register misc char device\n");
+ dev_err(&dev->dev, "Failed to register misc char device\n");
mutex_unlock(&card_mutex);
goto fail_free_irq;
}
list_add_tail(&lynx->link, &card_list);
mutex_unlock(&card_mutex);
- notify("Initialized PCILynx IEEE1394 card, irq=%d\n", dev->irq);
+ dev_info(&dev->dev,
+ "Initialized PCILynx IEEE1394 card, irq=%d\n", dev->irq);
return 0;
@@ -715,7 +714,7 @@ static void __exit nosy_cleanup(void)
{
pci_unregister_driver(&lynx_pci_driver);
- notify("Unloaded %s.\n", driver_name);
+ pr_info("Unloaded %s\n", driver_name);
}
module_init(nosy_init);