[1/3] spi: s3c64xx: simplify getting of_device_id match data

Message ID 20210414203343.203119-1-krzysztof.kozlowski@canonical.com
State New
Headers show
Series
  • [1/3] spi: s3c64xx: simplify getting of_device_id match data
Related show

Commit Message

Krzysztof Kozlowski April 14, 2021, 8:33 p.m.
Use of_device_get_match_data() to make the code slightly smaller and to
remove the of_device_id table forward declaration.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
---
 drivers/spi/spi-s3c64xx.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

Comments

Sylwester Nawrocki April 15, 2021, 9:53 a.m. | #1
On 14.04.2021 22:33, Krzysztof Kozlowski wrote:
> Correct the name of s3c64xx_spi_port_config structure in kerneldoc:
> 
>    drivers/spi/spi-s3c64xx.c:154: warning:
>      expecting prototype for struct s3c64xx_spi_info. Prototype was for struct s3c64xx_spi_port_config instead
> 
> Signed-off-by: Krzysztof Kozlowski<krzysztof.kozlowski@canonical.com>


Reviewed-by: Sylwester Nawrocki <snawrocki@kernel.org>
Mark Brown April 15, 2021, 6:33 p.m. | #2
On Wed, 14 Apr 2021 22:33:41 +0200, Krzysztof Kozlowski wrote:
> Use of_device_get_match_data() to make the code slightly smaller and to

> remove the of_device_id table forward declaration.


Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/3] spi: s3c64xx: simplify getting of_device_id match data
      commit: 609a2f9529d3d3e627776614b6cff34b21f64144
[2/3] spi: s3c64xx: correct kerneldoc of s3c64xx_spi_port_config
      commit: 7d712f799a938b37d24359ea836f58866be5e0bb
[3/3] spi: s3c64xx: constify driver/match data
      commit: d6371415517700ae225dd1aaa8a35a86a659ada6

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

Patch

diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index dfa7c91e13aa..c6d7641ea342 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -15,6 +15,7 @@ 
 #include <linux/spi/spi.h>
 #include <linux/gpio.h>
 #include <linux/of.h>
+#include <linux/of_device.h>
 #include <linux/of_gpio.h>
 
 #include <linux/platform_data/spi-s3c64xx.h>
@@ -1048,17 +1049,12 @@  static struct s3c64xx_spi_info *s3c64xx_spi_parse_dt(struct device *dev)
 }
 #endif
 
-static const struct of_device_id s3c64xx_spi_dt_match[];
-
 static inline struct s3c64xx_spi_port_config *s3c64xx_spi_get_port_config(
 						struct platform_device *pdev)
 {
 #ifdef CONFIG_OF
-	if (pdev->dev.of_node) {
-		const struct of_device_id *match;
-		match = of_match_node(s3c64xx_spi_dt_match, pdev->dev.of_node);
-		return (struct s3c64xx_spi_port_config *)match->data;
-	}
+	if (pdev->dev.of_node)
+		return (struct s3c64xx_spi_port_config *)of_device_get_match_data(&pdev->dev);
 #endif
 	return (struct s3c64xx_spi_port_config *)
 			 platform_get_device_id(pdev)->driver_data;