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.

mtd: rawnand: denali: Use managed device resources

All of the resources used by this driver has managed interfaces, so use
them. Otherwise we will get the following splat:

[ 4.472703] denali-nand-pci 0000:00:05.0: timeout while waiting for irq 0x1000
[ 4.474071] denali-nand-pci: probe of 0000:00:05.0 failed with error -5
[ 4.473538] nand: No NAND device found
[ 4.474068] BUG: unable to handle page fault for address: ffffc90005000410
[ 4.475169] #PF: supervisor write access in kernel mode
[ 4.475579] #PF: error_code(0x0002) - not-present page
[ 4.478362] RIP: 0010:iowrite32+0x9/0x50
[ 4.486068] Call Trace:
[ 4.486269] <IRQ>
[ 4.486443] denali_isr+0x15b/0x300 [denali]
[ 4.486788] ? denali_direct_write+0x50/0x50 [denali]
[ 4.487189] __handle_irq_event_percpu+0x161/0x3b0
[ 4.487571] handle_irq_event+0x7d/0x1b0
[ 4.487884] handle_fasteoi_irq+0x2b0/0x770
[ 4.488219] __common_interrupt+0xc8/0x1b0
[ 4.488549] common_interrupt+0x9a/0xc0

Fixes: 93db446a424c ("mtd: nand: move raw NAND related code to the raw/ subdir")
Signed-off-by: Zheyu Ma <zheyuma97@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20220411125808.958276-1-zheyuma97@gmail.com

authored by

Zheyu Ma and committed by
Miquel Raynal
3a745b51 51a4a71d

+4 -11
+4 -11
drivers/mtd/nand/raw/denali_pci.c
··· 74 74 return ret; 75 75 } 76 76 77 - denali->reg = ioremap(csr_base, csr_len); 77 + denali->reg = devm_ioremap(denali->dev, csr_base, csr_len); 78 78 if (!denali->reg) { 79 79 dev_err(&dev->dev, "Spectra: Unable to remap memory region\n"); 80 80 return -ENOMEM; 81 81 } 82 82 83 - denali->host = ioremap(mem_base, mem_len); 83 + denali->host = devm_ioremap(denali->dev, mem_base, mem_len); 84 84 if (!denali->host) { 85 85 dev_err(&dev->dev, "Spectra: ioremap failed!"); 86 - ret = -ENOMEM; 87 - goto out_unmap_reg; 86 + return -ENOMEM; 88 87 } 89 88 90 89 ret = denali_init(denali); 91 90 if (ret) 92 - goto out_unmap_host; 91 + return ret; 93 92 94 93 nsels = denali->nbanks; 95 94 ··· 116 117 117 118 out_remove_denali: 118 119 denali_remove(denali); 119 - out_unmap_host: 120 - iounmap(denali->host); 121 - out_unmap_reg: 122 - iounmap(denali->reg); 123 120 return ret; 124 121 } 125 122 ··· 124 129 struct denali_controller *denali = pci_get_drvdata(dev); 125 130 126 131 denali_remove(denali); 127 - iounmap(denali->reg); 128 - iounmap(denali->host); 129 132 } 130 133 131 134 static struct pci_driver denali_pci_driver = {