| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* cg14.c: CGFOURTEEN frame buffer driver |
|---|
| 2 | 3 | * |
|---|
| 3 | 4 | * Copyright (C) 2003, 2006 David S. Miller (davem@davemloft.net) |
|---|
| .. | .. |
|---|
| 38 | 39 | * Frame buffer operations |
|---|
| 39 | 40 | */ |
|---|
| 40 | 41 | |
|---|
| 41 | | -static struct fb_ops cg14_ops = { |
|---|
| 42 | +static const struct fb_ops cg14_ops = { |
|---|
| 42 | 43 | .owner = THIS_MODULE, |
|---|
| 43 | 44 | .fb_setcolreg = cg14_setcolreg, |
|---|
| 44 | 45 | .fb_pan_display = cg14_pan_display, |
|---|
| .. | .. |
|---|
| 355 | 356 | static void cg14_init_fix(struct fb_info *info, int linebytes, |
|---|
| 356 | 357 | struct device_node *dp) |
|---|
| 357 | 358 | { |
|---|
| 358 | | - const char *name = dp->name; |
|---|
| 359 | | - |
|---|
| 360 | | - strlcpy(info->fix.id, name, sizeof(info->fix.id)); |
|---|
| 359 | + snprintf(info->fix.id, sizeof(info->fix.id), "%pOFn", dp); |
|---|
| 361 | 360 | |
|---|
| 362 | 361 | info->fix.type = FB_TYPE_PACKED_PIXELS; |
|---|
| 363 | 362 | info->fix.visual = FB_VISUAL_PSEUDOCOLOR; |
|---|
| .. | .. |
|---|
| 488 | 487 | info->var.xres); |
|---|
| 489 | 488 | info->fix.smem_len = PAGE_ALIGN(linebytes * info->var.yres); |
|---|
| 490 | 489 | |
|---|
| 491 | | - if (!strcmp(dp->parent->name, "sbus") || |
|---|
| 492 | | - !strcmp(dp->parent->name, "sbi")) { |
|---|
| 490 | + if (of_node_name_eq(dp->parent, "sbus") || |
|---|
| 491 | + of_node_name_eq(dp->parent, "sbi")) { |
|---|
| 493 | 492 | info->fix.smem_start = op->resource[0].start; |
|---|
| 494 | 493 | par->iospace = op->resource[0].flags & IORESOURCE_BITS; |
|---|
| 495 | 494 | } else { |
|---|
| .. | .. |
|---|
| 510 | 509 | if (!par->regs || !par->clut || !par->cursor || !info->screen_base) |
|---|
| 511 | 510 | goto out_unmap_regs; |
|---|
| 512 | 511 | |
|---|
| 513 | | - is_8mb = (((op->resource[1].end - op->resource[1].start) + 1) == |
|---|
| 514 | | - (8 * 1024 * 1024)); |
|---|
| 512 | + is_8mb = (resource_size(&op->resource[1]) == (8 * 1024 * 1024)); |
|---|
| 515 | 513 | |
|---|
| 516 | 514 | BUILD_BUG_ON(sizeof(par->mmap_map) != sizeof(__cg14_mmap_map)); |
|---|
| 517 | 515 | |
|---|