fpga: lattice-sysconfig-spi: Ad-hoc cleanups
cover fpga: lattice-sysconfig-spi: Ad-hoc cleanups
While converting the driver to use modern SPI APIs, I have noticed more things to improve, hence this mini-series. Note, it's independent to the above mentioned conversion patch and may be applied before or after (separately).
Andy Shevchenko (3):
fpga: lattice-sysconfig-spi: Fix the terminator entries in ID tables
fpga: lattice-sysconfig-spi: Drop of_match_ptr() protection
fpga: lattice-sysconfig-spi: Don't use "proxy" headers
drivers/fpga/lattice-sysconfig-spi.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-)
Signature · 1 line
2.50.1
PATCH 1/3 fpga: lattice-sysconfig-spi: Fix the terminator entries in ID tables
The whole purpose of the terminator entry is to be the last one. The trailing comma makes this statement prone to failure. On top of that the style is used for the entries is unusual. Standardize this all by moving terminator entries to their own lines and drop trailing commas.
--- drivers/fpga/lattice-sysconfig-spi.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/fpga/lattice-sysconfig-spi.c +4 -2
@@ -116,7 +116,8 @@ static const struct spi_device_id sysconfig_spi_ids[] = { { .name = "sysconfig-ecp5", .driver_data = (kernel_ulong_t)&ecp5_spi_max_speed_hz, - }, {}, + }, + {} };MODULE_DEVICE_TABLE (spi, sysconfig_spi_ids);
@@ -125,7 +126,8 @@ static const struct of_device_id sysconfig_of_ids[] = { { .compatible = "lattice,sysconfig-ecp5", .data = &ecp5_spi_max_speed_hz, - }, {}, + }, + {} };MODULE_DEVICE_TABLE (of, sysconfig_of_ids);#endif /* IS_ENABLED(CONFIG_OF) */
Signature · 1 line
2.50.1
PATCH 2/3 fpga: lattice-sysconfig-spi: Drop of_match_ptr() protection
In reply to Andy ShevchenkoLimiting the scope of devicetree support to CONFIG_OF prevents use of this driver with ACPI via PRP0001. Drop the dependency.
--- drivers/fpga/lattice-sysconfig-spi.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/fpga/lattice-sysconfig-spi.c +1 -3
@@ -121,7 +121,6 @@ static const struct spi_device_id sysconfig_spi_ids[] = { };MODULE_DEVICE_TABLE (spi, sysconfig_spi_ids); -#if IS_ENABLED(CONFIG_OF)static const struct of_device_id sysconfig_of_ids[] = { { .compatible ="lattice,sysconfig-ecp5" ,
@@ -130,14 +129,13 @@ static const struct of_device_id sysconfig_of_ids[] = { {} };MODULE_DEVICE_TABLE (of, sysconfig_of_ids); -#endif /* IS_ENABLED(CONFIG_OF) */ static struct spi_driver lattice_sysconfig_driver = { .probe = sysconfig_spi_probe, .id_table = sysconfig_spi_ids, .driver = { .name ="lattice_sysconfig_spi_fpga_mgr" , - .of_match_table =of_match_ptr (sysconfig_of_ids), + .of_match_table = sysconfig_of_ids, }, };module_spi_driver (lattice_sysconfig_driver);
Signature · 1 line
2.50.1
PATCH 3/3 fpga: lattice-sysconfig-spi: Don't use "proxy" headers
In reply to Andy ShevchenkoUpdate header inclusions to follow IWYU (Include What You Use) principle.
--- drivers/fpga/lattice-sysconfig-spi.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/fpga/lattice-sysconfig-spi.c +7 -1
@@ -3,8 +3,14 @@* Lattice FPGA programming over slave SPI sysCONFIG interface. */ -#include <linux/of.h> +#include <linux/dev_printk.h> +#include <linux/device/devres.h> +#include <linux/errno.h> +#include <linux/mod_devicetable.h> +#include <linux/module.h> +#include <linux/slab.h> #include <linux/spi/spi.h> +#include <linux/types.h> #include "lattice-sysconfig.h"
Signature · 1 line
2.50.1
Quoted 5 lines · Andy Shevchenko
While converting the driver to use modern SPI APIs, I have noticed more things to improve, hence this mini-series. Note, it's independent to the above mentioned conversion patch and may be applied before or after (separately).
Quoted 7 lines
Andy Shevchenko (3):
fpga: lattice-sysconfig-spi: Fix the terminator entries in ID tables
fpga: lattice-sysconfig-spi: Dropof_match_ptr()protection
fpga: lattice-sysconfig-spi: Don't use "proxy" headersdrivers/fpga/lattice-sysconfig-spi.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-)
Applied to for-next.
Quoted 5 lines
Signature · 2 lines
-- 2.50.1