Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/ast: Retrieve I/O-memory ranges without ast device

Read the I/O-memory ranges into local variables before setting
them in the ast device instanace. We'll later need this to split
detecting the device type from the creation of the ast device
instance.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231116100240.22975-4-tzimmermann@suse.de

+11 -6
+11 -6
drivers/gpu/drm/ast/ast_main.c
··· 432 432 struct ast_device *ast; 433 433 bool need_post = false; 434 434 int ret = 0; 435 + void __iomem *regs; 436 + void __iomem *ioregs; 435 437 436 438 ast = devm_drm_dev_alloc(&pdev->dev, drv, struct ast_device, base); 437 439 if (IS_ERR(ast)) ··· 442 440 443 441 pci_set_drvdata(pdev, dev); 444 442 445 - ast->regs = pcim_iomap(pdev, 1, 0); 446 - if (!ast->regs) 443 + regs = pcim_iomap(pdev, 1, 0); 444 + if (!regs) 447 445 return ERR_PTR(-EIO); 448 446 449 447 if (pdev->revision >= 0x40) { ··· 457 455 return ERR_PTR(-EIO); 458 456 if ((len - AST_IO_MM_OFFSET) < AST_IO_MM_LENGTH) 459 457 return ERR_PTR(-EIO); 460 - ast->ioregs = ast->regs + AST_IO_MM_OFFSET; 458 + ioregs = regs + AST_IO_MM_OFFSET; 461 459 } else if (pci_resource_flags(pdev, 2) & IORESOURCE_IO) { 462 460 /* 463 461 * Map I/O registers if we have a PCI BAR for I/O. ··· 466 464 467 465 if (len < AST_IO_MM_LENGTH) 468 466 return -EIO; 469 - ast->ioregs = pcim_iomap(pdev, 2, 0); 470 - if (!ast->ioregs) 467 + ioregs = pcim_iomap(pdev, 2, 0); 468 + if (!ioregs) 471 469 return ERR_PTR(-EIO); 472 470 } else { 473 471 /* ··· 479 477 return ERR_PTR(-EIO); 480 478 if ((len - AST_IO_MM_OFFSET) < AST_IO_MM_LENGTH) 481 479 return ERR_PTR(-EIO); 482 - ast->ioregs = ast->regs + AST_IO_MM_OFFSET; 480 + ioregs = regs + AST_IO_MM_OFFSET; 483 481 484 482 drm_info(dev, "Platform has no I/O space, using MMIO\n"); 485 483 } 484 + 485 + ast->regs = regs; 486 + ast->ioregs = ioregs; 486 487 487 488 if (!ast_is_vga_enabled(dev)) { 488 489 drm_info(dev, "VGA not enabled on entry, requesting chip POST\n");