mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-22 06:57:57 +00:00
00e2b1d997
SVN-Revision: 16242
149 lines
4.2 KiB
Diff
149 lines
4.2 KiB
Diff
--- a/drivers/vlynq/vlynq.c 2009-05-31 20:41:57.000000000 +0200
|
|
+++ b/drivers/vlynq/vlynq.c 2009-05-31 22:06:36.000000000 +0200
|
|
@@ -82,6 +82,7 @@
|
|
static void vlynq_dump_regs(struct vlynq_device *dev)
|
|
{
|
|
int i;
|
|
+
|
|
printk(KERN_DEBUG "VLYNQ local=%p remote=%p\n",
|
|
dev->local, dev->remote);
|
|
for (i = 0; i < 32; i++) {
|
|
@@ -95,6 +96,7 @@
|
|
static void vlynq_dump_mem(u32 *base, int count)
|
|
{
|
|
int i;
|
|
+
|
|
for (i = 0; i < (count + 3) / 4; i++) {
|
|
if (i % 4 == 0) printk(KERN_DEBUG "\nMEM[0x%04x]:", i * 4);
|
|
printk(KERN_DEBUG " 0x%08x", *(base + i));
|
|
@@ -194,20 +196,24 @@
|
|
static void vlynq_local_ack(unsigned int irq)
|
|
{
|
|
struct vlynq_device *dev = get_irq_chip_data(irq);
|
|
+
|
|
u32 status = vlynq_reg_read(dev->local->status);
|
|
+
|
|
if (printk_ratelimit())
|
|
printk(KERN_DEBUG "%s: local status: 0x%08x\n",
|
|
- dev->dev.bus_id, status);
|
|
+ dev_name(&dev->dev), status);
|
|
vlynq_reg_write(dev->local->status, status);
|
|
}
|
|
|
|
static void vlynq_remote_ack(unsigned int irq)
|
|
{
|
|
struct vlynq_device *dev = get_irq_chip_data(irq);
|
|
+
|
|
u32 status = vlynq_reg_read(dev->remote->status);
|
|
+
|
|
if (printk_ratelimit())
|
|
printk(KERN_DEBUG "%s: remote status: 0x%08x\n",
|
|
- dev->dev.bus_id, status);
|
|
+ dev_name(&dev->dev), status);
|
|
vlynq_reg_write(dev->remote->status, status);
|
|
}
|
|
|
|
@@ -262,7 +268,7 @@
|
|
if (dev->local_irq == dev->remote_irq) {
|
|
printk(KERN_ERR
|
|
"%s: local vlynq irq should be different from remote\n",
|
|
- dev->dev.bus_id);
|
|
+ dev_name(&dev->dev));
|
|
return -EINVAL;
|
|
}
|
|
|
|
@@ -304,7 +310,7 @@
|
|
}
|
|
|
|
if (request_irq(dev->irq, vlynq_irq, IRQF_SHARED, "vlynq", dev)) {
|
|
- printk(KERN_ERR "%s: request_irq failed\n", dev->dev.bus_id);
|
|
+ printk(KERN_ERR "%s: request_irq failed\n", dev_name(&dev->dev));
|
|
return -EAGAIN;
|
|
}
|
|
|
|
@@ -403,7 +409,7 @@
|
|
if (vlynq_linked(dev)) {
|
|
printk(KERN_DEBUG
|
|
"%s: using remote clock divisor %d\n",
|
|
- dev->dev.bus_id, i - vlynq_rdiv1 + 1);
|
|
+ dev_name(&dev->dev), i - vlynq_rdiv1 + 1);
|
|
dev->divisor = i;
|
|
return 0;
|
|
} else {
|
|
@@ -433,7 +439,7 @@
|
|
if (vlynq_linked(dev)) {
|
|
printk(KERN_DEBUG
|
|
"%s: using local clock divisor %d\n",
|
|
- dev->dev.bus_id, i - vlynq_ldiv1 + 1);
|
|
+ dev_name(&dev->dev), i - vlynq_ldiv1 + 1);
|
|
dev->divisor = i;
|
|
return 0;
|
|
} else {
|
|
@@ -460,7 +466,7 @@
|
|
|
|
if (vlynq_linked(dev)) {
|
|
printk(KERN_DEBUG "%s: using external clock\n",
|
|
- dev->dev.bus_id);
|
|
+ dev_name(&dev->dev));
|
|
dev->divisor = vlynq_div_external;
|
|
return 0;
|
|
}
|
|
@@ -507,7 +513,7 @@
|
|
if (vlynq_linked(dev)) {
|
|
printk(KERN_DEBUG
|
|
"%s: using local clock divisor %d\n",
|
|
- dev->dev.bus_id, dev->divisor - vlynq_ldiv1 + 1);
|
|
+ dev_name(&dev->dev), dev->divisor - vlynq_ldiv1 + 1);
|
|
return 0;
|
|
}
|
|
break;
|
|
@@ -521,7 +527,7 @@
|
|
if (vlynq_linked(dev)) {
|
|
printk(KERN_DEBUG
|
|
"%s: using remote clock divisor %d\n",
|
|
- dev->dev.bus_id, dev->divisor - vlynq_rdiv1 + 1);
|
|
+ dev_name(&dev->dev), dev->divisor - vlynq_rdiv1 + 1);
|
|
return 0;
|
|
}
|
|
break;
|
|
@@ -662,8 +668,7 @@
|
|
dev->id = pdev->id;
|
|
dev->dev.bus = &vlynq_bus_type;
|
|
dev->dev.parent = &pdev->dev;
|
|
- snprintf(dev->dev.bus_id, BUS_ID_SIZE, "vlynq%d", dev->id);
|
|
- dev->dev.bus_id[BUS_ID_SIZE - 1] = 0;
|
|
+ dev_set_name(&dev->dev, "vlynq%d", dev->id);
|
|
dev->dev.platform_data = pdev->dev.platform_data;
|
|
dev->dev.release = vlynq_device_release;
|
|
|
|
@@ -673,9 +678,9 @@
|
|
dev->mem_end = mem_res->end;
|
|
|
|
len = regs_res->end - regs_res->start;
|
|
- if (!request_mem_region(regs_res->start, len, dev->dev.bus_id)) {
|
|
+ if (!request_mem_region(regs_res->start, len, dev_name(&dev->dev))) {
|
|
printk(KERN_ERR "%s: Can't request vlynq registers\n",
|
|
- dev->dev.bus_id);
|
|
+ dev_name(&dev->dev));
|
|
result = -ENXIO;
|
|
goto fail_request;
|
|
}
|
|
@@ -683,7 +688,7 @@
|
|
dev->local = ioremap(regs_res->start, len);
|
|
if (!dev->local) {
|
|
printk(KERN_ERR "%s: Can't remap vlynq registers\n",
|
|
- dev->dev.bus_id);
|
|
+ dev_name(&dev->dev));
|
|
result = -ENXIO;
|
|
goto fail_remap;
|
|
}
|
|
@@ -702,7 +707,7 @@
|
|
platform_set_drvdata(pdev, dev);
|
|
|
|
printk(KERN_INFO "%s: regs 0x%p, irq %d, mem 0x%p\n",
|
|
- dev->dev.bus_id, (void *)dev->regs_start, dev->irq,
|
|
+ dev_name(&dev->dev), (void *)dev->regs_start, dev->irq,
|
|
(void *)dev->mem_start);
|
|
|
|
dev->dev_id = 0;
|