firmware: meson: Use device_get_match_data()

Message ID 20231006224644.445295-1-robh@kernel.org
State New
Headers
Series firmware: meson: Use device_get_match_data() |

Commit Message

Rob Herring Oct. 6, 2023, 10:46 p.m. UTC
  Use preferred device_get_match_data() instead of of_match_device() to
get the driver match data. With this, adjust the includes to explicitly
include the correct headers.

Signed-off-by: Rob Herring <robh@kernel.org>
---
 drivers/firmware/meson/meson_sm.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
  

Comments

Neil Armstrong Oct. 9, 2023, 6:08 a.m. UTC | #1
On 07/10/2023 00:46, Rob Herring wrote:
> Use preferred device_get_match_data() instead of of_match_device() to
> get the driver match data. With this, adjust the includes to explicitly
> include the correct headers.
> 
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>   drivers/firmware/meson/meson_sm.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/firmware/meson/meson_sm.c b/drivers/firmware/meson/meson_sm.c
> index 53bf56e18743..ed60f1103053 100644
> --- a/drivers/firmware/meson/meson_sm.c
> +++ b/drivers/firmware/meson/meson_sm.c
> @@ -13,9 +13,10 @@
>   #include <linux/io.h>
>   #include <linux/module.h>
>   #include <linux/of.h>
> -#include <linux/of_device.h>
> +#include <linux/of_platform.h>
>   #include <linux/platform_device.h>
>   #include <linux/printk.h>
> +#include <linux/property.h>
>   #include <linux/types.h>
>   #include <linux/sizes.h>
>    #include <linux/slab.h>
> @@ -297,7 +298,7 @@ static int __init meson_sm_probe(struct platform_device *pdev)
>   	if (!fw)
>   		return -ENOMEM;
>   
> -	chip = of_match_device(meson_sm_ids, dev)->data;
> +	chip = device_get_match_data(dev);
>   	if (!chip)
>   		return -EINVAL;
>   

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
  
Neil Armstrong Oct. 9, 2023, 8:49 a.m. UTC | #2
Hi,

On Fri, 06 Oct 2023 17:46:44 -0500, Rob Herring wrote:
> Use preferred device_get_match_data() instead of of_match_device() to
> get the driver match data. With this, adjust the includes to explicitly
> include the correct headers.
> 
> 

Thanks, Applied to https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux.git (v6.7/drivers)

[1/1] firmware: meson: Use device_get_match_data()
      https://git.kernel.org/amlogic/c/5d59b6a49bb8f6841acf53affc0c4720fe7450e5

These changes has been applied on the intermediate git tree [1].

The v6.7/drivers branch will then be sent via a formal Pull Request to the Linux SoC maintainers
for inclusion in their intermediate git branches in order to be sent to Linus during
the next merge window, or sooner if it's a set of fixes.

In the cases of fixes, those will be merged in the current release candidate
kernel and as soon they appear on the Linux master branch they will be
backported to the previous Stable and Long-Stable kernels [2].

The intermediate git branches are merged daily in the linux-next tree [3],
people are encouraged testing these pre-release kernels and report issues on the
relevant mailing-lists.

If problems are discovered on those changes, please submit a signed-off-by revert
patch followed by a corrective changeset.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux.git
[2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
[3] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
  

Patch

diff --git a/drivers/firmware/meson/meson_sm.c b/drivers/firmware/meson/meson_sm.c
index 53bf56e18743..ed60f1103053 100644
--- a/drivers/firmware/meson/meson_sm.c
+++ b/drivers/firmware/meson/meson_sm.c
@@ -13,9 +13,10 @@ 
 #include <linux/io.h>
 #include <linux/module.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
+#include <linux/of_platform.h>
 #include <linux/platform_device.h>
 #include <linux/printk.h>
+#include <linux/property.h>
 #include <linux/types.h>
 #include <linux/sizes.h>
  #include <linux/slab.h>
@@ -297,7 +298,7 @@  static int __init meson_sm_probe(struct platform_device *pdev)
 	if (!fw)
 		return -ENOMEM;
 
-	chip = of_match_device(meson_sm_ids, dev)->data;
+	chip = device_get_match_data(dev);
 	if (!chip)
 		return -EINVAL;