| .. | .. |
|---|
| 141 | 141 | /* Clear PALETTE_ACCESS_CNTL in DAC_CNTL */ |
|---|
| 142 | 142 | out_le32(par->cmap_adr + 0x58, |
|---|
| 143 | 143 | in_le32(par->cmap_adr + 0x58) & ~0x20); |
|---|
| 144 | + fallthrough; |
|---|
| 144 | 145 | case cmap_r128: |
|---|
| 145 | 146 | /* Set palette index & data */ |
|---|
| 146 | 147 | out_8(par->cmap_adr + 0xb0, regno); |
|---|
| .. | .. |
|---|
| 210 | 211 | /* Clear PALETTE_ACCESS_CNTL in DAC_CNTL */ |
|---|
| 211 | 212 | out_le32(par->cmap_adr + 0x58, |
|---|
| 212 | 213 | in_le32(par->cmap_adr + 0x58) & ~0x20); |
|---|
| 214 | + fallthrough; |
|---|
| 213 | 215 | case cmap_r128: |
|---|
| 214 | 216 | /* Set palette index & data */ |
|---|
| 215 | 217 | out_8(par->cmap_adr + 0xb0, i); |
|---|
| .. | .. |
|---|
| 284 | 286 | framebuffer_release(info); |
|---|
| 285 | 287 | } |
|---|
| 286 | 288 | |
|---|
| 287 | | -static struct fb_ops offb_ops = { |
|---|
| 289 | +static const struct fb_ops offb_ops = { |
|---|
| 288 | 290 | .owner = THIS_MODULE, |
|---|
| 289 | 291 | .fb_destroy = offb_destroy, |
|---|
| 290 | 292 | .fb_setcolreg = offb_setcolreg, |
|---|
| .. | .. |
|---|
| 318 | 320 | } |
|---|
| 319 | 321 | |
|---|
| 320 | 322 | static void offb_init_palette_hacks(struct fb_info *info, struct device_node *dp, |
|---|
| 321 | | - const char *name, unsigned long address) |
|---|
| 323 | + unsigned long address) |
|---|
| 322 | 324 | { |
|---|
| 323 | 325 | struct offb_par *par = (struct offb_par *) info->par; |
|---|
| 324 | 326 | |
|---|
| 325 | | - if (dp && !strncmp(name, "ATY,Rage128", 11)) { |
|---|
| 327 | + if (of_node_name_prefix(dp, "ATY,Rage128")) { |
|---|
| 326 | 328 | par->cmap_adr = offb_map_reg(dp, 2, 0, 0x1fff); |
|---|
| 327 | 329 | if (par->cmap_adr) |
|---|
| 328 | 330 | par->cmap_type = cmap_r128; |
|---|
| 329 | | - } else if (dp && (!strncmp(name, "ATY,RageM3pA", 12) |
|---|
| 330 | | - || !strncmp(name, "ATY,RageM3p12A", 14))) { |
|---|
| 331 | + } else if (of_node_name_prefix(dp, "ATY,RageM3pA") || |
|---|
| 332 | + of_node_name_prefix(dp, "ATY,RageM3p12A")) { |
|---|
| 331 | 333 | par->cmap_adr = offb_map_reg(dp, 2, 0, 0x1fff); |
|---|
| 332 | 334 | if (par->cmap_adr) |
|---|
| 333 | 335 | par->cmap_type = cmap_M3A; |
|---|
| 334 | | - } else if (dp && !strncmp(name, "ATY,RageM3pB", 12)) { |
|---|
| 336 | + } else if (of_node_name_prefix(dp, "ATY,RageM3pB")) { |
|---|
| 335 | 337 | par->cmap_adr = offb_map_reg(dp, 2, 0, 0x1fff); |
|---|
| 336 | 338 | if (par->cmap_adr) |
|---|
| 337 | 339 | par->cmap_type = cmap_M3B; |
|---|
| 338 | | - } else if (dp && !strncmp(name, "ATY,Rage6", 9)) { |
|---|
| 340 | + } else if (of_node_name_prefix(dp, "ATY,Rage6")) { |
|---|
| 339 | 341 | par->cmap_adr = offb_map_reg(dp, 1, 0, 0x1fff); |
|---|
| 340 | 342 | if (par->cmap_adr) |
|---|
| 341 | 343 | par->cmap_type = cmap_radeon; |
|---|
| 342 | | - } else if (!strncmp(name, "ATY,", 4)) { |
|---|
| 344 | + } else if (of_node_name_prefix(dp, "ATY,")) { |
|---|
| 343 | 345 | unsigned long base = address & 0xff000000UL; |
|---|
| 344 | 346 | par->cmap_adr = |
|---|
| 345 | 347 | ioremap(base + 0x7ff000, 0x1000) + 0xcc0; |
|---|
| .. | .. |
|---|
| 350 | 352 | par->cmap_adr = offb_map_reg(dp, 0, 0x6000, 0x1000); |
|---|
| 351 | 353 | if (par->cmap_adr) |
|---|
| 352 | 354 | par->cmap_type = cmap_gxt2000; |
|---|
| 353 | | - } else if (dp && !strncmp(name, "vga,Display-", 12)) { |
|---|
| 355 | + } else if (of_node_name_prefix(dp, "vga,Display-")) { |
|---|
| 354 | 356 | /* Look for AVIVO initialized by SLOF */ |
|---|
| 355 | 357 | struct device_node *pciparent = of_get_parent(dp); |
|---|
| 356 | 358 | const u32 *vid, *did; |
|---|
| .. | .. |
|---|
| 419 | 421 | var = &info->var; |
|---|
| 420 | 422 | info->par = par; |
|---|
| 421 | 423 | |
|---|
| 422 | | - strcpy(fix->id, "OFfb "); |
|---|
| 423 | | - strncat(fix->id, name, sizeof(fix->id) - sizeof("OFfb ")); |
|---|
| 424 | | - fix->id[sizeof(fix->id) - 1] = '\0'; |
|---|
| 424 | + if (name) { |
|---|
| 425 | + strcpy(fix->id, "OFfb "); |
|---|
| 426 | + strncat(fix->id, name, sizeof(fix->id) - sizeof("OFfb ")); |
|---|
| 427 | + fix->id[sizeof(fix->id) - 1] = '\0'; |
|---|
| 428 | + } else |
|---|
| 429 | + snprintf(fix->id, sizeof(fix->id), "OFfb %pOFn", dp); |
|---|
| 430 | + |
|---|
| 425 | 431 | |
|---|
| 426 | 432 | var->xres = var->xres_virtual = width; |
|---|
| 427 | 433 | var->yres = var->yres_virtual = height; |
|---|
| .. | .. |
|---|
| 434 | 440 | |
|---|
| 435 | 441 | par->cmap_type = cmap_unknown; |
|---|
| 436 | 442 | if (depth == 8) |
|---|
| 437 | | - offb_init_palette_hacks(info, dp, name, address); |
|---|
| 443 | + offb_init_palette_hacks(info, dp, address); |
|---|
| 438 | 444 | else |
|---|
| 439 | 445 | fix->visual = FB_VISUAL_TRUECOLOR; |
|---|
| 440 | 446 | |
|---|
| .. | .. |
|---|
| 642 | 648 | } |
|---|
| 643 | 649 | #endif |
|---|
| 644 | 650 | /* kludge for valkyrie */ |
|---|
| 645 | | - if (strcmp(dp->name, "valkyrie") == 0) |
|---|
| 651 | + if (of_node_name_eq(dp, "valkyrie")) |
|---|
| 646 | 652 | address += 0x1000; |
|---|
| 647 | | - offb_init_fb(no_real_node ? "bootx" : dp->name, |
|---|
| 653 | + offb_init_fb(no_real_node ? "bootx" : NULL, |
|---|
| 648 | 654 | width, height, depth, pitch, address, |
|---|
| 649 | 655 | foreign_endian, no_real_node ? NULL : dp); |
|---|
| 650 | 656 | } |
|---|