Skip to content

Commit f3cbfa5

Browse files
shcgitgregkh
authored andcommitted
Misc: sram: Remove unneeded check
Patch removes unneeded check for resource since devm_ioremap_resource do all for us. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent ea6add0 commit f3cbfa5

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

‎drivers/misc/sram.c‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,11 @@ static int sram_probe(struct platform_device *pdev)
4545
int ret;
4646

4747
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
48-
if (!res)
49-
return -EINVAL;
50-
51-
size = resource_size(res);
52-
5348
virt_base = devm_ioremap_resource(&pdev->dev, res);
5449
if (IS_ERR(virt_base))
5550
return PTR_ERR(virt_base);
5651

52+
size = resource_size(res);
5753

5854
sram = devm_kzalloc(&pdev->dev, sizeof(*sram), GFP_KERNEL);
5955
if (!sram)

0 commit comments

Comments
 (0)