patches for FPGA
cover patches for FPGA
Hi Greg,
Please take these patches for fpga. They have been reviewed on the mailing list and apply cleanly on current linux-next.
The "fpga: stratix10-soc: fix wrong of_node_put() in init function" is a bug fix, sorry it's late. It will only affect the Stratix10 platform.
The other two can go in whenever is appropriate.
Thanks,
Alan
Alan Tull (1):
fpga: altera_freeze_bridge: remove restriction to socfpga
Colin Ian King (1):
fpga: mgr: altera-ps-spi: make array dummy static, shrinks object size
Nicolas Saenz Julienne (1):
fpga: stratix10-soc: fix wrong of_node_put() in init function
drivers/fpga/Kconfig | 2 +- drivers/fpga/altera-ps-spi.c | 2 +- drivers/fpga/stratix10-soc.c | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-)
Signature · 1 line
2.7.4
PATCH 1/3 fpga: stratix10-soc: fix wrong of_node_put() in init function
From: Nicolas Saenz Julienne <[email protected]>
After finding a "firmware" dt node stratix10 tries to match it's compatible string with it. To do so it's calling of_find_matching_node() which already takes care of decreasing the refcount on the "firmware" node. We are then incorrectly decreasing the refcount on that node again.
This patch removes the unwarranted call to of_node_put().
--- drivers/fpga/stratix10-soc.c | 2 -- 1 file changed, 2 deletions(-)
drivers/fpga/stratix10-soc.c +0 -2
@@ -509,13 +509,11 @@ static int __init s10_init(void) np =of_find_matching_node (fw_np, s10_of_match);if (!np) { -of_node_put (fw_np);return -ENODEV ; }of_node_put (np); ret =of_platform_populate (fw_np, s10_of_match,NULL ,NULL ); -of_node_put (fw_np);if (ret)return ret;
Signature · 1 line
2.7.4
Re: [PATCH 1/3] fpga: stratix10-soc: fix wrong of_node_put() in init function
Quoted 24 lines · Alan Tull
From: Nicolas Saenz Julienne <[email protected]>
After finding a "firmware" dt node stratix10 tries to match it's compatible string with it. To do so it's calling
of_find_matching_node()which already takes care of decreasing the refcount on the "firmware" node. We are then incorrectly decreasing the refcount on that node again.This patch removes the unwarranted call to
of_node_put().Fixes e7eef1d7633a ("fpga: add intel stratix10 soc fpga manager driver")Signed-off-by Nicolas Saenz Julienne <[email protected]>Acked-by Alan Tull <[email protected]>Acked-by Moritz Fischer <[email protected]>--- drivers/fpga/stratix10-soc.c | 2 -- 1 file changed, 2 deletions(-)drivers/fpga/stratix10-soc.c +0
-0
drivers/fpga/stratix10-soc.c static int __init s10_init(void) · line 513
Quoted 6 lines
drivers/fpga/stratix10-soc.c +0
-1@@ -509,13 +509,11 @@ static int __init s10_init(void) np =of_find_matching_node (fw_np, s10_of_match);if (!np) { -of_node_put (fw_np);return -ENODEV ; }
This leaves unnecessary braces around a single statement. I had said in the code review that I was going to clean that up. Arg! I'll resubmit this patch.
Alan
Quoted 10 lines
drivers/fpga/stratix10-soc.c +0
-2of_node_put (np); ret =of_platform_populate (fw_np, s10_of_match,NULL ,NULL ); -of_node_put (fw_np);if (ret)return ret; --2.7.4
PATCH 2/3 fpga: altera_freeze_bridge: remove restriction to socfpga
In reply to Alan TullThe Altera Freeze Bridge should not be restricted to ARCH_SOCFPGA since it can be used on other platforms such as Stratix10.
--- drivers/fpga/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/fpga/Kconfig +1 -1
@@ -104,7 +104,7 @@ config SOCFPGA_FPGA_BRIDGE config ALTERA_FREEZE_BRIDGE tristate "Altera FPGA Freeze Bridge" - depends on ARCH_SOCFPGA && FPGA_BRIDGE + depends on FPGA_BRIDGE && HAS_IOMEM help Say Y to enable drivers for Altera FPGA Freeze bridges. A freeze bridge is a bridge that exists in the FPGA fabric to
Signature · 1 line
2.7.4
PATCH 3/3 fpga: mgr: altera-ps-spi: make array dummy static, shrinks object size
In reply to Alan TullFrom: Colin Ian King <[email protected]>
Don't populate the const array dummy on the stack but instead make it static. Makes the object code smaller by 26 bytes:
Before:
text data bss dec hex filename
7371 2032 0 9403 24bb drivers/fpga/altera-ps-spi.o
After:
text data bss dec hex filename
7281 2096 0 9377 24a1 drivers/fpga/altera-ps-spi.o
(gcc version 8.2.0 x86_64)
--- drivers/fpga/altera-ps-spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/fpga/altera-ps-spi.c +1 -1
@@ -205,7 +205,7 @@ static int altera_ps_write_complete(struct fpga_manager *mgr, struct fpga_image_info *info) {struct altera_ps_conf *conf = mgr->priv; -const char dummy[] = {0 }; +static const char dummy[] = {0 };int ret;if (gpiod_get_value_cansleep (conf->status)) {
Signature · 1 line
2.7.4