aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-10-08 10:25:01 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-10-08 10:25:01 -0400
commit0854ba5ff5c938307cd783e996b62c83f1ce923b (patch)
tree039e3eaa4fa6e979a281c535017424016366f23c
parent0238df646e6224016a45505d2c111a24669ebe21 (diff)
parentb7dc10b64f6190a008f05baf697d4d8fa9b8ed51 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc
David writes: "Sparc fixes: 1) Minor fallthru comment tweaks from Gustavo A. R. Silva. 2) VLA removal from Kees Cook. 3) Make sparc vdso Makefile match x86, from Masahiro Yamada. 4) Fix clock divider programming in mach64 driver, from Mikulas Patocka." * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc: sparc64: fix fall-through annotation sparc32: fix fall-through annotation sparc: vdso: clean-up vdso Makefile oradax: remove redundant null check before kfree sparc64: viohs: Remove VLA usage sbus: Use of_get_child_by_name helper sparc: Convert to using %pOFn instead of device_node.name mach64: detect the dot clock divider correctly on sparc
-rw-r--r--arch/sparc/kernel/auxio_64.c4
-rw-r--r--arch/sparc/kernel/kgdb_32.c2
-rw-r--r--arch/sparc/kernel/kgdb_64.c2
-rw-r--r--arch/sparc/kernel/power.c4
-rw-r--r--arch/sparc/kernel/prom_32.c26
-rw-r--r--arch/sparc/kernel/prom_64.c68
-rw-r--r--arch/sparc/kernel/viohs.c12
-rw-r--r--arch/sparc/vdso/Makefile8
-rw-r--r--drivers/sbus/char/openprom.c11
-rw-r--r--drivers/sbus/char/oradax.c3
-rw-r--r--drivers/video/fbdev/aty/atyfb.h3
-rw-r--r--drivers/video/fbdev/aty/atyfb_base.c7
-rw-r--r--drivers/video/fbdev/aty/mach64_ct.c10
13 files changed, 78 insertions, 82 deletions
diff --git a/arch/sparc/kernel/auxio_64.c b/arch/sparc/kernel/auxio_64.c
index 4e8f56c3793c..cc42225c20f3 100644
--- a/arch/sparc/kernel/auxio_64.c
+++ b/arch/sparc/kernel/auxio_64.c
@@ -115,8 +115,8 @@ static int auxio_probe(struct platform_device *dev)
115 auxio_devtype = AUXIO_TYPE_SBUS; 115 auxio_devtype = AUXIO_TYPE_SBUS;
116 size = 1; 116 size = 1;
117 } else { 117 } else {
118 printk("auxio: Unknown parent bus type [%s]\n", 118 printk("auxio: Unknown parent bus type [%pOFn]\n",
119 dp->parent->name); 119 dp->parent);
120 return -ENODEV; 120 return -ENODEV;
121 } 121 }
122 auxio_register = of_ioremap(&dev->resource[0], 0, size, "auxio"); 122 auxio_register = of_ioremap(&dev->resource[0], 0, size, "auxio");
diff --git a/arch/sparc/kernel/kgdb_32.c b/arch/sparc/kernel/kgdb_32.c
index 5868fc333ea8..639c8e54530a 100644
--- a/arch/sparc/kernel/kgdb_32.c
+++ b/arch/sparc/kernel/kgdb_32.c
@@ -122,7 +122,7 @@ int kgdb_arch_handle_exception(int e_vector, int signo, int err_code,
122 linux_regs->pc = addr; 122 linux_regs->pc = addr;
123 linux_regs->npc = addr + 4; 123 linux_regs->npc = addr + 4;
124 } 124 }
125 /* fallthru */ 125 /* fall through */
126 126
127 case 'D': 127 case 'D':
128 case 'k': 128 case 'k':
diff --git a/arch/sparc/kernel/kgdb_64.c b/arch/sparc/kernel/kgdb_64.c
index d5f7dc6323d5..a68bbddbdba4 100644
--- a/arch/sparc/kernel/kgdb_64.c
+++ b/arch/sparc/kernel/kgdb_64.c
@@ -148,7 +148,7 @@ int kgdb_arch_handle_exception(int e_vector, int signo, int err_code,
148 linux_regs->tpc = addr; 148 linux_regs->tpc = addr;
149 linux_regs->tnpc = addr + 4; 149 linux_regs->tnpc = addr + 4;
150 } 150 }
151 /* fallthru */ 151 /* fall through */
152 152
153 case 'D': 153 case 'D':
154 case 'k': 154 case 'k':
diff --git a/arch/sparc/kernel/power.c b/arch/sparc/kernel/power.c
index 92627abce311..d941875dd718 100644
--- a/arch/sparc/kernel/power.c
+++ b/arch/sparc/kernel/power.c
@@ -41,8 +41,8 @@ static int power_probe(struct platform_device *op)
41 41
42 power_reg = of_ioremap(res, 0, 0x4, "power"); 42 power_reg = of_ioremap(res, 0, 0x4, "power");
43 43
44 printk(KERN_INFO "%s: Control reg at %llx\n", 44 printk(KERN_INFO "%pOFn: Control reg at %llx\n",
45 op->dev.of_node->name, res->start); 45 op->dev.of_node, res->start);
46 46
47 if (has_button_interrupt(irq, op->dev.of_node)) { 47 if (has_button_interrupt(irq, op->dev.of_node)) {
48 if (request_irq(irq, 48 if (request_irq(irq,
diff --git a/arch/sparc/kernel/prom_32.c b/arch/sparc/kernel/prom_32.c
index b51cbb9e87dc..17c87d29ff20 100644
--- a/arch/sparc/kernel/prom_32.c
+++ b/arch/sparc/kernel/prom_32.c
@@ -68,8 +68,8 @@ static void __init sparc32_path_component(struct device_node *dp, char *tmp_buf)
68 return; 68 return;
69 69
70 regs = rprop->value; 70 regs = rprop->value;
71 sprintf(tmp_buf, "%s@%x,%x", 71 sprintf(tmp_buf, "%pOFn@%x,%x",
72 dp->name, 72 dp,
73 regs->which_io, regs->phys_addr); 73 regs->which_io, regs->phys_addr);
74} 74}
75 75
@@ -84,8 +84,8 @@ static void __init sbus_path_component(struct device_node *dp, char *tmp_buf)
84 return; 84 return;
85 85
86 regs = prop->value; 86 regs = prop->value;
87 sprintf(tmp_buf, "%s@%x,%x", 87 sprintf(tmp_buf, "%pOFn@%x,%x",
88 dp->name, 88 dp,
89 regs->which_io, 89 regs->which_io,
90 regs->phys_addr); 90 regs->phys_addr);
91} 91}
@@ -104,13 +104,13 @@ static void __init pci_path_component(struct device_node *dp, char *tmp_buf)
104 regs = prop->value; 104 regs = prop->value;
105 devfn = (regs->phys_hi >> 8) & 0xff; 105 devfn = (regs->phys_hi >> 8) & 0xff;
106 if (devfn & 0x07) { 106 if (devfn & 0x07) {
107 sprintf(tmp_buf, "%s@%x,%x", 107 sprintf(tmp_buf, "%pOFn@%x,%x",
108 dp->name, 108 dp,
109 devfn >> 3, 109 devfn >> 3,
110 devfn & 0x07); 110 devfn & 0x07);
111 } else { 111 } else {
112 sprintf(tmp_buf, "%s@%x", 112 sprintf(tmp_buf, "%pOFn@%x",
113 dp->name, 113 dp,
114 devfn >> 3); 114 devfn >> 3);
115 } 115 }
116} 116}
@@ -127,8 +127,8 @@ static void __init ebus_path_component(struct device_node *dp, char *tmp_buf)
127 127
128 regs = prop->value; 128 regs = prop->value;
129 129
130 sprintf(tmp_buf, "%s@%x,%x", 130 sprintf(tmp_buf, "%pOFn@%x,%x",
131 dp->name, 131 dp,
132 regs->which_io, regs->phys_addr); 132 regs->which_io, regs->phys_addr);
133} 133}
134 134
@@ -167,8 +167,8 @@ static void __init ambapp_path_component(struct device_node *dp, char *tmp_buf)
167 return; 167 return;
168 device = prop->value; 168 device = prop->value;
169 169
170 sprintf(tmp_buf, "%s:%d:%d@%x,%x", 170 sprintf(tmp_buf, "%pOFn:%d:%d@%x,%x",
171 dp->name, *vendor, *device, 171 dp, *vendor, *device,
172 *intr, reg0); 172 *intr, reg0);
173} 173}
174 174
@@ -201,7 +201,7 @@ char * __init build_path_component(struct device_node *dp)
201 tmp_buf[0] = '\0'; 201 tmp_buf[0] = '\0';
202 __build_path_component(dp, tmp_buf); 202 __build_path_component(dp, tmp_buf);
203 if (tmp_buf[0] == '\0') 203 if (tmp_buf[0] == '\0')
204 strcpy(tmp_buf, dp->name); 204 snprintf(tmp_buf, sizeof(tmp_buf), "%pOFn", dp);
205 205
206 n = prom_early_alloc(strlen(tmp_buf) + 1); 206 n = prom_early_alloc(strlen(tmp_buf) + 1);
207 strcpy(n, tmp_buf); 207 strcpy(n, tmp_buf);
diff --git a/arch/sparc/kernel/prom_64.c b/arch/sparc/kernel/prom_64.c
index baeaeed64993..6220411ce8fc 100644
--- a/arch/sparc/kernel/prom_64.c
+++ b/arch/sparc/kernel/prom_64.c
@@ -82,8 +82,8 @@ static void __init sun4v_path_component(struct device_node *dp, char *tmp_buf)
82 82
83 regs = rprop->value; 83 regs = rprop->value;
84 if (!of_node_is_root(dp->parent)) { 84 if (!of_node_is_root(dp->parent)) {
85 sprintf(tmp_buf, "%s@%x,%x", 85 sprintf(tmp_buf, "%pOFn@%x,%x",
86 dp->name, 86 dp,
87 (unsigned int) (regs->phys_addr >> 32UL), 87 (unsigned int) (regs->phys_addr >> 32UL),
88 (unsigned int) (regs->phys_addr & 0xffffffffUL)); 88 (unsigned int) (regs->phys_addr & 0xffffffffUL));
89 return; 89 return;
@@ -97,17 +97,17 @@ static void __init sun4v_path_component(struct device_node *dp, char *tmp_buf)
97 const char *prefix = (type == 0) ? "m" : "i"; 97 const char *prefix = (type == 0) ? "m" : "i";
98 98
99 if (low_bits) 99 if (low_bits)
100 sprintf(tmp_buf, "%s@%s%x,%x", 100 sprintf(tmp_buf, "%pOFn@%s%x,%x",
101 dp->name, prefix, 101 dp, prefix,
102 high_bits, low_bits); 102 high_bits, low_bits);
103 else 103 else
104 sprintf(tmp_buf, "%s@%s%x", 104 sprintf(tmp_buf, "%pOFn@%s%x",
105 dp->name, 105 dp,
106 prefix, 106 prefix,
107 high_bits); 107 high_bits);
108 } else if (type == 12) { 108 } else if (type == 12) {
109 sprintf(tmp_buf, "%s@%x", 109 sprintf(tmp_buf, "%pOFn@%x",
110 dp->name, high_bits); 110 dp, high_bits);
111 } 111 }
112} 112}
113 113
@@ -122,8 +122,8 @@ static void __init sun4u_path_component(struct device_node *dp, char *tmp_buf)
122 122
123 regs = prop->value; 123 regs = prop->value;
124 if (!of_node_is_root(dp->parent)) { 124 if (!of_node_is_root(dp->parent)) {
125 sprintf(tmp_buf, "%s@%x,%x", 125 sprintf(tmp_buf, "%pOFn@%x,%x",
126 dp->name, 126 dp,
127 (unsigned int) (regs->phys_addr >> 32UL), 127 (unsigned int) (regs->phys_addr >> 32UL),
128 (unsigned int) (regs->phys_addr & 0xffffffffUL)); 128 (unsigned int) (regs->phys_addr & 0xffffffffUL));
129 return; 129 return;
@@ -138,8 +138,8 @@ static void __init sun4u_path_component(struct device_node *dp, char *tmp_buf)
138 if (tlb_type >= cheetah) 138 if (tlb_type >= cheetah)
139 mask = 0x7fffff; 139 mask = 0x7fffff;
140 140
141 sprintf(tmp_buf, "%s@%x,%x", 141 sprintf(tmp_buf, "%pOFn@%x,%x",
142 dp->name, 142 dp,
143 *(u32 *)prop->value, 143 *(u32 *)prop->value,
144 (unsigned int) (regs->phys_addr & mask)); 144 (unsigned int) (regs->phys_addr & mask));
145 } 145 }
@@ -156,8 +156,8 @@ static void __init sbus_path_component(struct device_node *dp, char *tmp_buf)
156 return; 156 return;
157 157
158 regs = prop->value; 158 regs = prop->value;
159 sprintf(tmp_buf, "%s@%x,%x", 159 sprintf(tmp_buf, "%pOFn@%x,%x",
160 dp->name, 160 dp,
161 regs->which_io, 161 regs->which_io,
162 regs->phys_addr); 162 regs->phys_addr);
163} 163}
@@ -176,13 +176,13 @@ static void __init pci_path_component(struct device_node *dp, char *tmp_buf)
176 regs = prop->value; 176 regs = prop->value;
177 devfn = (regs->phys_hi >> 8) & 0xff; 177 devfn = (regs->phys_hi >> 8) & 0xff;
178 if (devfn & 0x07) { 178 if (devfn & 0x07) {
179 sprintf(tmp_buf, "%s@%x,%x", 179 sprintf(tmp_buf, "%pOFn@%x,%x",
180 dp->name, 180 dp,
181 devfn >> 3, 181 devfn >> 3,
182 devfn & 0x07); 182 devfn & 0x07);
183 } else { 183 } else {
184 sprintf(tmp_buf, "%s@%x", 184 sprintf(tmp_buf, "%pOFn@%x",
185 dp->name, 185 dp,
186 devfn >> 3); 186 devfn >> 3);
187 } 187 }
188} 188}
@@ -203,8 +203,8 @@ static void __init upa_path_component(struct device_node *dp, char *tmp_buf)
203 if (!prop) 203 if (!prop)
204 return; 204 return;
205 205
206 sprintf(tmp_buf, "%s@%x,%x", 206 sprintf(tmp_buf, "%pOFn@%x,%x",
207 dp->name, 207 dp,
208 *(u32 *) prop->value, 208 *(u32 *) prop->value,
209 (unsigned int) (regs->phys_addr & 0xffffffffUL)); 209 (unsigned int) (regs->phys_addr & 0xffffffffUL));
210} 210}
@@ -221,7 +221,7 @@ static void __init vdev_path_component(struct device_node *dp, char *tmp_buf)
221 221
222 regs = prop->value; 222 regs = prop->value;
223 223
224 sprintf(tmp_buf, "%s@%x", dp->name, *regs); 224 sprintf(tmp_buf, "%pOFn@%x", dp, *regs);
225} 225}
226 226
227/* "name@addrhi,addrlo" */ 227/* "name@addrhi,addrlo" */
@@ -236,8 +236,8 @@ static void __init ebus_path_component(struct device_node *dp, char *tmp_buf)
236 236
237 regs = prop->value; 237 regs = prop->value;
238 238
239 sprintf(tmp_buf, "%s@%x,%x", 239 sprintf(tmp_buf, "%pOFn@%x,%x",
240 dp->name, 240 dp,
241 (unsigned int) (regs->phys_addr >> 32UL), 241 (unsigned int) (regs->phys_addr >> 32UL),
242 (unsigned int) (regs->phys_addr & 0xffffffffUL)); 242 (unsigned int) (regs->phys_addr & 0xffffffffUL));
243} 243}
@@ -257,8 +257,8 @@ static void __init i2c_path_component(struct device_node *dp, char *tmp_buf)
257 /* This actually isn't right... should look at the #address-cells 257 /* This actually isn't right... should look at the #address-cells
258 * property of the i2c bus node etc. etc. 258 * property of the i2c bus node etc. etc.
259 */ 259 */
260 sprintf(tmp_buf, "%s@%x,%x", 260 sprintf(tmp_buf, "%pOFn@%x,%x",
261 dp->name, regs[0], regs[1]); 261 dp, regs[0], regs[1]);
262} 262}
263 263
264/* "name@reg0[,reg1]" */ 264/* "name@reg0[,reg1]" */
@@ -274,11 +274,11 @@ static void __init usb_path_component(struct device_node *dp, char *tmp_buf)
274 regs = prop->value; 274 regs = prop->value;
275 275
276 if (prop->length == sizeof(u32) || regs[1] == 1) { 276 if (prop->length == sizeof(u32) || regs[1] == 1) {
277 sprintf(tmp_buf, "%s@%x", 277 sprintf(tmp_buf, "%pOFn@%x",
278 dp->name, regs[0]); 278 dp, regs[0]);
279 } else { 279 } else {
280 sprintf(tmp_buf, "%s@%x,%x", 280 sprintf(tmp_buf, "%pOFn@%x,%x",
281 dp->name, regs[0], regs[1]); 281 dp, regs[0], regs[1]);
282 } 282 }
283} 283}
284 284
@@ -295,11 +295,11 @@ static void __init ieee1394_path_component(struct device_node *dp, char *tmp_buf
295 regs = prop->value; 295 regs = prop->value;
296 296
297 if (regs[2] || regs[3]) { 297 if (regs[2] || regs[3]) {
298 sprintf(tmp_buf, "%s@%08x%08x,%04x%08x", 298 sprintf(tmp_buf, "%pOFn@%08x%08x,%04x%08x",
299 dp->name, regs[0], regs[1], regs[2], regs[3]); 299 dp, regs[0], regs[1], regs[2], regs[3]);
300 } else { 300 } else {
301 sprintf(tmp_buf, "%s@%08x%08x", 301 sprintf(tmp_buf, "%pOFn@%08x%08x",
302 dp->name, regs[0], regs[1]); 302 dp, regs[0], regs[1]);
303 } 303 }
304} 304}
305 305
@@ -361,7 +361,7 @@ char * __init build_path_component(struct device_node *dp)
361 tmp_buf[0] = '\0'; 361 tmp_buf[0] = '\0';
362 __build_path_component(dp, tmp_buf); 362 __build_path_component(dp, tmp_buf);
363 if (tmp_buf[0] == '\0') 363 if (tmp_buf[0] == '\0')
364 strcpy(tmp_buf, dp->name); 364 snprintf(tmp_buf, sizeof(tmp_buf), "%pOFn", dp);
365 365
366 n = prom_early_alloc(strlen(tmp_buf) + 1); 366 n = prom_early_alloc(strlen(tmp_buf) + 1);
367 strcpy(n, tmp_buf); 367 strcpy(n, tmp_buf);
diff --git a/arch/sparc/kernel/viohs.c b/arch/sparc/kernel/viohs.c
index 635d67ffc9a3..7db5aabe9708 100644
--- a/arch/sparc/kernel/viohs.c
+++ b/arch/sparc/kernel/viohs.c
@@ -180,11 +180,17 @@ static int send_dreg(struct vio_driver_state *vio)
180 struct vio_dring_register pkt; 180 struct vio_dring_register pkt;
181 char all[sizeof(struct vio_dring_register) + 181 char all[sizeof(struct vio_dring_register) +
182 (sizeof(struct ldc_trans_cookie) * 182 (sizeof(struct ldc_trans_cookie) *
183 dr->ncookies)]; 183 VIO_MAX_RING_COOKIES)];
184 } u; 184 } u;
185 size_t bytes = sizeof(struct vio_dring_register) +
186 (sizeof(struct ldc_trans_cookie) *
187 dr->ncookies);
185 int i; 188 int i;
186 189
187 memset(&u, 0, sizeof(u)); 190 if (WARN_ON(bytes > sizeof(u)))
191 return -EINVAL;
192
193 memset(&u, 0, bytes);
188 init_tag(&u.pkt.tag, VIO_TYPE_CTRL, VIO_SUBTYPE_INFO, VIO_DRING_REG); 194 init_tag(&u.pkt.tag, VIO_TYPE_CTRL, VIO_SUBTYPE_INFO, VIO_DRING_REG);
189 u.pkt.dring_ident = 0; 195 u.pkt.dring_ident = 0;
190 u.pkt.num_descr = dr->num_entries; 196 u.pkt.num_descr = dr->num_entries;
@@ -206,7 +212,7 @@ static int send_dreg(struct vio_driver_state *vio)
206 (unsigned long long) u.pkt.cookies[i].cookie_size); 212 (unsigned long long) u.pkt.cookies[i].cookie_size);
207 } 213 }
208 214
209 return send_ctrl(vio, &u.pkt.tag, sizeof(u)); 215 return send_ctrl(vio, &u.pkt.tag, bytes);
210} 216}
211 217
212static int send_rdx(struct vio_driver_state *vio) 218static int send_rdx(struct vio_driver_state *vio)
diff --git a/arch/sparc/vdso/Makefile b/arch/sparc/vdso/Makefile
index dd0b5a92ffd0..dc85570d8839 100644
--- a/arch/sparc/vdso/Makefile
+++ b/arch/sparc/vdso/Makefile
@@ -31,23 +31,21 @@ obj-y += $(vdso_img_objs)
31targets += $(vdso_img_cfiles) 31targets += $(vdso_img_cfiles)
32targets += $(vdso_img_sodbg) $(vdso_img-y:%=vdso%.so) 32targets += $(vdso_img_sodbg) $(vdso_img-y:%=vdso%.so)
33 33
34export CPPFLAGS_vdso.lds += -P -C 34CPPFLAGS_vdso.lds += -P -C
35 35
36VDSO_LDFLAGS_vdso.lds = -m64 -Wl,-soname=linux-vdso.so.1 \ 36VDSO_LDFLAGS_vdso.lds = -m64 -Wl,-soname=linux-vdso.so.1 \
37 -Wl,--no-undefined \ 37 -Wl,--no-undefined \
38 -Wl,-z,max-page-size=8192 -Wl,-z,common-page-size=8192 \ 38 -Wl,-z,max-page-size=8192 -Wl,-z,common-page-size=8192 \
39 $(DISABLE_LTO) 39 $(DISABLE_LTO)
40 40
41$(obj)/vdso64.so.dbg: $(src)/vdso.lds $(vobjs) FORCE 41$(obj)/vdso64.so.dbg: $(obj)/vdso.lds $(vobjs) FORCE
42 $(call if_changed,vdso) 42 $(call if_changed,vdso)
43 43
44HOST_EXTRACFLAGS += -I$(srctree)/tools/include 44HOST_EXTRACFLAGS += -I$(srctree)/tools/include
45hostprogs-y += vdso2c 45hostprogs-y += vdso2c
46 46
47quiet_cmd_vdso2c = VDSO2C $@ 47quiet_cmd_vdso2c = VDSO2C $@
48define cmd_vdso2c 48 cmd_vdso2c = $(obj)/vdso2c $< $(<:%.dbg=%) $@
49 $(obj)/vdso2c $< $(<:%.dbg=%) $@
50endef
51 49
52$(obj)/vdso-image-%.c: $(obj)/vdso%.so.dbg $(obj)/vdso%.so $(obj)/vdso2c FORCE 50$(obj)/vdso-image-%.c: $(obj)/vdso%.so.dbg $(obj)/vdso%.so $(obj)/vdso2c FORCE
53 $(call if_changed,vdso2c) 51 $(call if_changed,vdso2c)
diff --git a/drivers/sbus/char/openprom.c b/drivers/sbus/char/openprom.c
index 7b31f19ade83..050879a2ddef 100644
--- a/drivers/sbus/char/openprom.c
+++ b/drivers/sbus/char/openprom.c
@@ -715,22 +715,13 @@ static struct miscdevice openprom_dev = {
715 715
716static int __init openprom_init(void) 716static int __init openprom_init(void)
717{ 717{
718 struct device_node *dp;
719 int err; 718 int err;
720 719
721 err = misc_register(&openprom_dev); 720 err = misc_register(&openprom_dev);
722 if (err) 721 if (err)
723 return err; 722 return err;
724 723
725 dp = of_find_node_by_path("/"); 724 options_node = of_get_child_by_name(of_find_node_by_path("/"), "options");
726 dp = dp->child;
727 while (dp) {
728 if (!strcmp(dp->name, "options"))
729 break;
730 dp = dp->sibling;
731 }
732 options_node = dp;
733
734 if (!options_node) { 725 if (!options_node) {
735 misc_deregister(&openprom_dev); 726 misc_deregister(&openprom_dev);
736 return -EIO; 727 return -EIO;
diff --git a/drivers/sbus/char/oradax.c b/drivers/sbus/char/oradax.c
index 524f9ea62e52..6516bc3cb58b 100644
--- a/drivers/sbus/char/oradax.c
+++ b/drivers/sbus/char/oradax.c
@@ -689,8 +689,7 @@ static int dax_open(struct inode *inode, struct file *f)
689alloc_error: 689alloc_error:
690 kfree(ctx->ccb_buf); 690 kfree(ctx->ccb_buf);
691done: 691done:
692 if (ctx != NULL) 692 kfree(ctx);
693 kfree(ctx);
694 return -ENOMEM; 693 return -ENOMEM;
695} 694}
696 695
diff --git a/drivers/video/fbdev/aty/atyfb.h b/drivers/video/fbdev/aty/atyfb.h
index 8235b285dbb2..d09bab3bf224 100644
--- a/drivers/video/fbdev/aty/atyfb.h
+++ b/drivers/video/fbdev/aty/atyfb.h
@@ -333,6 +333,8 @@ extern const struct aty_pll_ops aty_pll_ct; /* Integrated */
333extern void aty_set_pll_ct(const struct fb_info *info, const union aty_pll *pll); 333extern void aty_set_pll_ct(const struct fb_info *info, const union aty_pll *pll);
334extern u8 aty_ld_pll_ct(int offset, const struct atyfb_par *par); 334extern u8 aty_ld_pll_ct(int offset, const struct atyfb_par *par);
335 335
336extern const u8 aty_postdividers[8];
337
336 338
337 /* 339 /*
338 * Hardware cursor support 340 * Hardware cursor support
@@ -359,7 +361,6 @@ static inline void wait_for_idle(struct atyfb_par *par)
359 361
360extern void aty_reset_engine(const struct atyfb_par *par); 362extern void aty_reset_engine(const struct atyfb_par *par);
361extern void aty_init_engine(struct atyfb_par *par, struct fb_info *info); 363extern void aty_init_engine(struct atyfb_par *par, struct fb_info *info);
362extern u8 aty_ld_pll_ct(int offset, const struct atyfb_par *par);
363 364
364void atyfb_copyarea(struct fb_info *info, const struct fb_copyarea *area); 365void atyfb_copyarea(struct fb_info *info, const struct fb_copyarea *area);
365void atyfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect); 366void atyfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect);
diff --git a/drivers/video/fbdev/aty/atyfb_base.c b/drivers/video/fbdev/aty/atyfb_base.c
index a9a8272f7a6e..05111e90f168 100644
--- a/drivers/video/fbdev/aty/atyfb_base.c
+++ b/drivers/video/fbdev/aty/atyfb_base.c
@@ -3087,17 +3087,18 @@ static int atyfb_setup_sparc(struct pci_dev *pdev, struct fb_info *info,
3087 /* 3087 /*
3088 * PLL Reference Divider M: 3088 * PLL Reference Divider M:
3089 */ 3089 */
3090 M = pll_regs[2]; 3090 M = pll_regs[PLL_REF_DIV];
3091 3091
3092 /* 3092 /*
3093 * PLL Feedback Divider N (Dependent on CLOCK_CNTL): 3093 * PLL Feedback Divider N (Dependent on CLOCK_CNTL):
3094 */ 3094 */
3095 N = pll_regs[7 + (clock_cntl & 3)]; 3095 N = pll_regs[VCLK0_FB_DIV + (clock_cntl & 3)];
3096 3096
3097 /* 3097 /*
3098 * PLL Post Divider P (Dependent on CLOCK_CNTL): 3098 * PLL Post Divider P (Dependent on CLOCK_CNTL):
3099 */ 3099 */
3100 P = 1 << (pll_regs[6] >> ((clock_cntl & 3) << 1)); 3100 P = aty_postdividers[((pll_regs[VCLK_POST_DIV] >> ((clock_cntl & 3) << 1)) & 3) |
3101 ((pll_regs[PLL_EXT_CNTL] >> (2 + (clock_cntl & 3))) & 4)];
3101 3102
3102 /* 3103 /*
3103 * PLL Divider Q: 3104 * PLL Divider Q:
diff --git a/drivers/video/fbdev/aty/mach64_ct.c b/drivers/video/fbdev/aty/mach64_ct.c
index 74a62aa193c0..f87cc81f4fa2 100644
--- a/drivers/video/fbdev/aty/mach64_ct.c
+++ b/drivers/video/fbdev/aty/mach64_ct.c
@@ -115,7 +115,7 @@ static void aty_st_pll_ct(int offset, u8 val, const struct atyfb_par *par)
115 */ 115 */
116 116
117#define Maximum_DSP_PRECISION 7 117#define Maximum_DSP_PRECISION 7
118static u8 postdividers[] = {1,2,4,8,3}; 118const u8 aty_postdividers[8] = {1,2,4,8,3,5,6,12};
119 119
120static int aty_dsp_gt(const struct fb_info *info, u32 bpp, struct pll_ct *pll) 120static int aty_dsp_gt(const struct fb_info *info, u32 bpp, struct pll_ct *pll)
121{ 121{
@@ -222,7 +222,7 @@ static int aty_valid_pll_ct(const struct fb_info *info, u32 vclk_per, struct pll
222 pll->vclk_post_div += (q < 64*8); 222 pll->vclk_post_div += (q < 64*8);
223 pll->vclk_post_div += (q < 32*8); 223 pll->vclk_post_div += (q < 32*8);
224 } 224 }
225 pll->vclk_post_div_real = postdividers[pll->vclk_post_div]; 225 pll->vclk_post_div_real = aty_postdividers[pll->vclk_post_div];
226 // pll->vclk_post_div <<= 6; 226 // pll->vclk_post_div <<= 6;
227 pll->vclk_fb_div = q * pll->vclk_post_div_real / 8; 227 pll->vclk_fb_div = q * pll->vclk_post_div_real / 8;
228 pllvclk = (1000000 * 2 * pll->vclk_fb_div) / 228 pllvclk = (1000000 * 2 * pll->vclk_fb_div) /
@@ -513,7 +513,7 @@ static int aty_init_pll_ct(const struct fb_info *info, union aty_pll *pll)
513 u8 mclk_fb_div, pll_ext_cntl; 513 u8 mclk_fb_div, pll_ext_cntl;
514 pll->ct.pll_ref_div = aty_ld_pll_ct(PLL_REF_DIV, par); 514 pll->ct.pll_ref_div = aty_ld_pll_ct(PLL_REF_DIV, par);
515 pll_ext_cntl = aty_ld_pll_ct(PLL_EXT_CNTL, par); 515 pll_ext_cntl = aty_ld_pll_ct(PLL_EXT_CNTL, par);
516 pll->ct.xclk_post_div_real = postdividers[pll_ext_cntl & 0x07]; 516 pll->ct.xclk_post_div_real = aty_postdividers[pll_ext_cntl & 0x07];
517 mclk_fb_div = aty_ld_pll_ct(MCLK_FB_DIV, par); 517 mclk_fb_div = aty_ld_pll_ct(MCLK_FB_DIV, par);
518 if (pll_ext_cntl & PLL_MFB_TIMES_4_2B) 518 if (pll_ext_cntl & PLL_MFB_TIMES_4_2B)
519 mclk_fb_div <<= 1; 519 mclk_fb_div <<= 1;
@@ -535,7 +535,7 @@ static int aty_init_pll_ct(const struct fb_info *info, union aty_pll *pll)
535 xpost_div += (q < 64*8); 535 xpost_div += (q < 64*8);
536 xpost_div += (q < 32*8); 536 xpost_div += (q < 32*8);
537 } 537 }
538 pll->ct.xclk_post_div_real = postdividers[xpost_div]; 538 pll->ct.xclk_post_div_real = aty_postdividers[xpost_div];
539 pll->ct.mclk_fb_div = q * pll->ct.xclk_post_div_real / 8; 539 pll->ct.mclk_fb_div = q * pll->ct.xclk_post_div_real / 8;
540 540
541#ifdef CONFIG_PPC 541#ifdef CONFIG_PPC
@@ -584,7 +584,7 @@ static int aty_init_pll_ct(const struct fb_info *info, union aty_pll *pll)
584 mpost_div += (q < 64*8); 584 mpost_div += (q < 64*8);
585 mpost_div += (q < 32*8); 585 mpost_div += (q < 32*8);
586 } 586 }
587 sclk_post_div_real = postdividers[mpost_div]; 587 sclk_post_div_real = aty_postdividers[mpost_div];
588 pll->ct.sclk_fb_div = q * sclk_post_div_real / 8; 588 pll->ct.sclk_fb_div = q * sclk_post_div_real / 8;
589 pll->ct.spll_cntl2 = mpost_div << 4; 589 pll->ct.spll_cntl2 = mpost_div << 4;
590#ifdef DEBUG 590#ifdef DEBUG