soc: apple: sart: Stop casting function pointer signatures

Message ID 20221104153902.78999-1-sven@svenpeter.dev
State New
Headers
Series soc: apple: sart: Stop casting function pointer signatures |

Commit Message

Sven Peter Nov. 4, 2022, 3:39 p.m. UTC
  Fixes: b170143ae111 ("soc: apple: Add SART driver")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Sven Peter <sven@svenpeter.dev>
---
 drivers/soc/apple/sart.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
  

Comments

Hector Martin Nov. 28, 2022, 11:35 a.m. UTC | #1
On 05/11/2022 00.39, Sven Peter wrote:
> Fixes: b170143ae111 ("soc: apple: Add SART driver")
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Sven Peter <sven@svenpeter.dev>
> ---
>  drivers/soc/apple/sart.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/soc/apple/sart.c b/drivers/soc/apple/sart.c
> index 83804b16ad03..afa111736899 100644
> --- a/drivers/soc/apple/sart.c
> +++ b/drivers/soc/apple/sart.c
> @@ -164,6 +164,11 @@ static int apple_sart_probe(struct platform_device *pdev)
>  	return 0;
>  }
>  
> +static void apple_sart_put_device(void *dev)
> +{
> +	put_device(dev);
> +}
> +
>  struct apple_sart *devm_apple_sart_get(struct device *dev)
>  {
>  	struct device_node *sart_node;
> @@ -187,7 +192,7 @@ struct apple_sart *devm_apple_sart_get(struct device *dev)
>  		return ERR_PTR(-EPROBE_DEFER);
>  	}
>  
> -	ret = devm_add_action_or_reset(dev, (void (*)(void *))put_device,
> +	ret = devm_add_action_or_reset(dev, apple_sart_put_device,
>  				       &sart_pdev->dev);
>  	if (ret)
>  		return ERR_PTR(ret);

Applied to asahi-soc/soc, thanks!

- Hector
  

Patch

diff --git a/drivers/soc/apple/sart.c b/drivers/soc/apple/sart.c
index 83804b16ad03..afa111736899 100644
--- a/drivers/soc/apple/sart.c
+++ b/drivers/soc/apple/sart.c
@@ -164,6 +164,11 @@  static int apple_sart_probe(struct platform_device *pdev)
 	return 0;
 }
 
+static void apple_sart_put_device(void *dev)
+{
+	put_device(dev);
+}
+
 struct apple_sart *devm_apple_sart_get(struct device *dev)
 {
 	struct device_node *sart_node;
@@ -187,7 +192,7 @@  struct apple_sart *devm_apple_sart_get(struct device *dev)
 		return ERR_PTR(-EPROBE_DEFER);
 	}
 
-	ret = devm_add_action_or_reset(dev, (void (*)(void *))put_device,
+	ret = devm_add_action_or_reset(dev, apple_sart_put_device,
 				       &sart_pdev->dev);
 	if (ret)
 		return ERR_PTR(ret);