diff mbox series

media: rc: ir-spi: Drop empty spi_driver remove callback

Message ID 20211020125932.23335-1-u.kleine-koenig@pengutronix.de (mailing list archive)
State New, archived
Headers show
Series media: rc: ir-spi: Drop empty spi_driver remove callback | expand

Commit Message

Uwe Kleine-König Oct. 20, 2021, 12:59 p.m. UTC
A driver with a remove callback that just returns 0 behaves identically
to a driver with no remove callback at all. So simplify accordingly.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/media/rc/ir-spi.c | 6 ------
 1 file changed, 6 deletions(-)

Comments

Kieran Bingham Oct. 20, 2021, 1:15 p.m. UTC | #1
Quoting Uwe Kleine-König (2021-10-20 13:59:32)
> A driver with a remove callback that just returns 0 behaves identically
> to a driver with no remove callback at all. So simplify accordingly.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Sounds like the sort of thing that could have a coccinelle type check.
But yes, looks reasonable to me.

Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>

> ---
>  drivers/media/rc/ir-spi.c | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/drivers/media/rc/ir-spi.c b/drivers/media/rc/ir-spi.c
> index c58f2d38a458..51aa55a84bb5 100644
> --- a/drivers/media/rc/ir-spi.c
> +++ b/drivers/media/rc/ir-spi.c
> @@ -152,11 +152,6 @@ static int ir_spi_probe(struct spi_device *spi)
>         return devm_rc_register_device(&spi->dev, idata->rc);
>  }
>  
> -static int ir_spi_remove(struct spi_device *spi)
> -{
> -       return 0;
> -}
> -
>  static const struct of_device_id ir_spi_of_match[] = {
>         { .compatible = "ir-spi-led" },
>         {},
> @@ -165,7 +160,6 @@ MODULE_DEVICE_TABLE(of, ir_spi_of_match);
>  
>  static struct spi_driver ir_spi_driver = {
>         .probe = ir_spi_probe,
> -       .remove = ir_spi_remove,
>         .driver = {
>                 .name = IR_SPI_DRIVER_NAME,
>                 .of_match_table = ir_spi_of_match,
> -- 
> 2.30.2
>
diff mbox series

Patch

diff --git a/drivers/media/rc/ir-spi.c b/drivers/media/rc/ir-spi.c
index c58f2d38a458..51aa55a84bb5 100644
--- a/drivers/media/rc/ir-spi.c
+++ b/drivers/media/rc/ir-spi.c
@@ -152,11 +152,6 @@  static int ir_spi_probe(struct spi_device *spi)
 	return devm_rc_register_device(&spi->dev, idata->rc);
 }
 
-static int ir_spi_remove(struct spi_device *spi)
-{
-	return 0;
-}
-
 static const struct of_device_id ir_spi_of_match[] = {
 	{ .compatible = "ir-spi-led" },
 	{},
@@ -165,7 +160,6 @@  MODULE_DEVICE_TABLE(of, ir_spi_of_match);
 
 static struct spi_driver ir_spi_driver = {
 	.probe = ir_spi_probe,
-	.remove = ir_spi_remove,
 	.driver = {
 		.name = IR_SPI_DRIVER_NAME,
 		.of_match_table = ir_spi_of_match,