blob: 6872d46ea7167df4829d76299a8338ca0c2fd493 [file] [log] [blame]
From 3d9c71ca6f8c8c08b99758eba16f9749813b0748 Mon Sep 17 00:00:00 2001
From: "Gustavo A. R. Silva" <garsilva@embeddedor.com>
Date: Wed, 15 Nov 2017 16:33:10 -0600
Subject: [PATCH 1678/1795] fpga: fpga-mgr: remove unnecessary code in
__fpga_mgr_get
Notice that mgr = to_fpga_manager(dev); expands to:
mgr = container_of(dev, struct fpga_manager, dev);
and container_of is never null, so this null check is
unnecessary.
Addresses-Coverity-ID: 1397916
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Alan Tull <atull@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 5f76c6f313bffbf372c0722582e7bd509f0d3510)
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
drivers/fpga/fpga-mgr.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/fpga/fpga-mgr.c b/drivers/fpga/fpga-mgr.c
index 223f2401939b..9939d2cbc9a6 100644
--- a/drivers/fpga/fpga-mgr.c
+++ b/drivers/fpga/fpga-mgr.c
@@ -412,8 +412,6 @@ static struct fpga_manager *__fpga_mgr_get(struct device *dev)
struct fpga_manager *mgr;
mgr = to_fpga_manager(dev);
- if (!mgr)
- goto err_dev;
if (!try_module_get(dev->parent->driver->owner))
goto err_dev;
--
2.19.0