All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Misc: sram: Remove unneeded check
@ 2013-06-10 14:43 Alexander Shiyan
  2013-06-10 15:38 ` Arnd Bergmann
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Shiyan @ 2013-06-10 14:43 UTC (permalink / raw)
  To: linux-kernel; +Cc: Arnd Bergmann, Greg Kroah-Hartman, Alexander Shiyan

Patch removes unneeded check for resource since
devm_ioremap_resource do all for us.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 drivers/misc/sram.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/misc/sram.c b/drivers/misc/sram.c
index 4a93886..d87cc91 100644
--- a/drivers/misc/sram.c
+++ b/drivers/misc/sram.c
@@ -45,15 +45,11 @@ static int sram_probe(struct platform_device *pdev)
 	int ret;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res)
-		return -EINVAL;
-
-	size = resource_size(res);
-
 	virt_base = devm_ioremap_resource(&pdev->dev, res);
 	if (IS_ERR(virt_base))
 		return PTR_ERR(virt_base);
 
+	size = resource_size(res);
 
 	sram = devm_kzalloc(&pdev->dev, sizeof(*sram), GFP_KERNEL);
 	if (!sram)
-- 
1.8.1.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Misc: sram: Remove unneeded check
  2013-06-10 14:43 [PATCH] Misc: sram: Remove unneeded check Alexander Shiyan
@ 2013-06-10 15:38 ` Arnd Bergmann
  0 siblings, 0 replies; 2+ messages in thread
From: Arnd Bergmann @ 2013-06-10 15:38 UTC (permalink / raw)
  To: Alexander Shiyan; +Cc: linux-kernel, Greg Kroah-Hartman

On Monday 10 June 2013, Alexander Shiyan wrote:
> 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>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-06-10 15:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-10 14:43 [PATCH] Misc: sram: Remove unneeded check Alexander Shiyan
2013-06-10 15:38 ` Arnd Bergmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.