summaryrefslogtreecommitdiff
path: root/target/linux/ar7/patches/160-vlynq-bus_id_removal.patch
blob: c40837030d5525261c2690aa641df34ed88c6172 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
--- 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;