[PATCH 04/10] mei: vsc: Use vsc_tp_remove() as shutdown handler

Hans de Goede posted 10 patches 3 months, 2 weeks ago
[PATCH 04/10] mei: vsc: Use vsc_tp_remove() as shutdown handler
Posted by Hans de Goede 3 months, 2 weeks ago
After removing the vsc_tp_reset() call from vsc_tp_shutdown() it is now
identical to vsc_tp_remove().

Use vsc_tp_remove() as shutdown handler and remove vsc_tp_shutdown().

Signed-off-by: Hans de Goede <hansg@kernel.org>
---
 drivers/misc/mei/vsc-tp.c | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/drivers/misc/mei/vsc-tp.c b/drivers/misc/mei/vsc-tp.c
index 4a262e2117e4..f5438a600430 100644
--- a/drivers/misc/mei/vsc-tp.c
+++ b/drivers/misc/mei/vsc-tp.c
@@ -528,6 +528,7 @@ static int vsc_tp_probe(struct spi_device *spi)
 	return ret;
 }
 
+/* Note this is also used for shutdown */
 static void vsc_tp_remove(struct spi_device *spi)
 {
 	struct vsc_tp *tp = spi_get_drvdata(spi);
@@ -539,17 +540,6 @@ static void vsc_tp_remove(struct spi_device *spi)
 	free_irq(spi->irq, tp);
 }
 
-static void vsc_tp_shutdown(struct spi_device *spi)
-{
-	struct vsc_tp *tp = spi_get_drvdata(spi);
-
-	platform_device_unregister(tp->pdev);
-
-	mutex_destroy(&tp->mutex);
-
-	free_irq(spi->irq, tp);
-}
-
 static const struct acpi_device_id vsc_tp_acpi_ids[] = {
 	{ "INTC1009" }, /* Raptor Lake */
 	{ "INTC1058" }, /* Tiger Lake */
@@ -562,7 +552,7 @@ MODULE_DEVICE_TABLE(acpi, vsc_tp_acpi_ids);
 static struct spi_driver vsc_tp_driver = {
 	.probe = vsc_tp_probe,
 	.remove = vsc_tp_remove,
-	.shutdown = vsc_tp_shutdown,
+	.shutdown = vsc_tp_remove,
 	.driver = {
 		.name = "vsc-tp",
 		.acpi_match_table = vsc_tp_acpi_ids,
-- 
2.49.0
RE: [PATCH 04/10] mei: vsc: Use vsc_tp_remove() as shutdown handler
Posted by Usyskin, Alexander 3 months, 2 weeks ago
> Subject: [PATCH 04/10] mei: vsc: Use vsc_tp_remove() as shutdown handler
> 
> After removing the vsc_tp_reset() call from vsc_tp_shutdown() it is now
> identical to vsc_tp_remove().
> 
> Use vsc_tp_remove() as shutdown handler and remove vsc_tp_shutdown().
> 

Reviewed-by: Alexander Usyskin <alexander.usyskin@intel.com>

> Signed-off-by: Hans de Goede <hansg@kernel.org>
> ---
>  drivers/misc/mei/vsc-tp.c | 14 ++------------
>  1 file changed, 2 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/misc/mei/vsc-tp.c b/drivers/misc/mei/vsc-tp.c
> index 4a262e2117e4..f5438a600430 100644
> --- a/drivers/misc/mei/vsc-tp.c
> +++ b/drivers/misc/mei/vsc-tp.c
> @@ -528,6 +528,7 @@ static int vsc_tp_probe(struct spi_device *spi)
>  	return ret;
>  }
> 
> +/* Note this is also used for shutdown */
>  static void vsc_tp_remove(struct spi_device *spi)
>  {
>  	struct vsc_tp *tp = spi_get_drvdata(spi);
> @@ -539,17 +540,6 @@ static void vsc_tp_remove(struct spi_device *spi)
>  	free_irq(spi->irq, tp);
>  }
> 
> -static void vsc_tp_shutdown(struct spi_device *spi)
> -{
> -	struct vsc_tp *tp = spi_get_drvdata(spi);
> -
> -	platform_device_unregister(tp->pdev);
> -
> -	mutex_destroy(&tp->mutex);
> -
> -	free_irq(spi->irq, tp);
> -}
> -
>  static const struct acpi_device_id vsc_tp_acpi_ids[] = {
>  	{ "INTC1009" }, /* Raptor Lake */
>  	{ "INTC1058" }, /* Tiger Lake */
> @@ -562,7 +552,7 @@ MODULE_DEVICE_TABLE(acpi, vsc_tp_acpi_ids);
>  static struct spi_driver vsc_tp_driver = {
>  	.probe = vsc_tp_probe,
>  	.remove = vsc_tp_remove,
> -	.shutdown = vsc_tp_shutdown,
> +	.shutdown = vsc_tp_remove,
>  	.driver = {
>  		.name = "vsc-tp",
>  		.acpi_match_table = vsc_tp_acpi_ids,
> --
> 2.49.0