* [PATCH 00/14] scsci: Convert to platform remove callback returning void
@ 2023-12-03 16:05 Uwe Kleine-König
2023-12-03 16:05 ` [PATCH 01/14] scsi: a3000: " Uwe Kleine-König
` (15 more replies)
0 siblings, 16 replies; 17+ messages in thread
From: Uwe Kleine-König @ 2023-12-03 16:05 UTC (permalink / raw)
To: James E.J. Bottomley, Martin K. Petersen
Cc: linux-scsi, Finn Thain, Michael Schmitz, kernel
Hello,
this series converts all drivers below drivers/scsi to struct
platform_driver::remove_new(). See commit 5c5a7680e67b ("platform:
Provide a remove callback that returns no value") for an extended
explanation and the eventual goal.
All conversations are trivial, because all .remove() callbacks returned
zero unconditionally.
Best regards
Uwe
Uwe Kleine-König (14):
scsi: a3000: Convert to platform remove callback returning void
scsi: a4000t: Convert to platform remove callback returning void
scsi: atari: Convert to platform remove callback returning void
scsi: bvme6000: Convert to platform remove callback returning void
scsi: jazz_esp: Convert to platform remove callback returning void
scsi: mac_esp: Convert to platform remove callback returning void
scsi: mac: Convert to platform remove callback returning void
scsi: mvme16x: Convert to platform remove callback returning void
scsi: qlogicpti: Convert to platform remove callback returning void
scsi: sgiwd93: Convert to platform remove callback returning void
scsi: sni_53c710: Convert to platform remove callback returning void
scsi: sun3: Convert to platform remove callback returning void
scsi: sun3x_esp: Convert to platform remove callback returning void
scsi: sun_esp: Convert to platform remove callback returning void
drivers/scsi/a3000.c | 5 ++---
drivers/scsi/a4000t.c | 5 ++---
drivers/scsi/atari_scsi.c | 5 ++---
drivers/scsi/bvme6000_scsi.c | 6 ++----
drivers/scsi/jazz_esp.c | 6 ++----
drivers/scsi/mac_esp.c | 6 ++----
drivers/scsi/mac_scsi.c | 5 ++---
drivers/scsi/mvme16x_scsi.c | 6 ++----
drivers/scsi/qlogicpti.c | 6 ++----
drivers/scsi/sgiwd93.c | 5 ++---
drivers/scsi/sni_53c710.c | 6 ++----
drivers/scsi/sun3_scsi.c | 5 ++---
drivers/scsi/sun3x_esp.c | 6 ++----
drivers/scsi/sun_esp.c | 6 ++----
14 files changed, 28 insertions(+), 50 deletions(-)
base-commit: 5eda217cee887e595ba2265435862d585d399769
--
2.42.0
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 01/14] scsi: a3000: Convert to platform remove callback returning void
2023-12-03 16:05 [PATCH 00/14] scsci: Convert to platform remove callback returning void Uwe Kleine-König
@ 2023-12-03 16:05 ` Uwe Kleine-König
2023-12-03 16:05 ` [PATCH 02/14] scsi: a4000t: " Uwe Kleine-König
` (14 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: Uwe Kleine-König @ 2023-12-03 16:05 UTC (permalink / raw)
To: James E.J. Bottomley, Martin K. Petersen; +Cc: linux-scsi, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
In the error path emit an error message replacing the (less useful)
message by the core. Apart from the improved error message there is no
change in behaviour.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/scsi/a3000.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/a3000.c b/drivers/scsi/a3000.c
index c3028726bbe4..378906f77909 100644
--- a/drivers/scsi/a3000.c
+++ b/drivers/scsi/a3000.c
@@ -282,7 +282,7 @@ static int __init amiga_a3000_scsi_probe(struct platform_device *pdev)
return error;
}
-static int __exit amiga_a3000_scsi_remove(struct platform_device *pdev)
+static void __exit amiga_a3000_scsi_remove(struct platform_device *pdev)
{
struct Scsi_Host *instance = platform_get_drvdata(pdev);
struct a3000_hostdata *hdata = shost_priv(instance);
@@ -293,11 +293,10 @@ static int __exit amiga_a3000_scsi_remove(struct platform_device *pdev)
free_irq(IRQ_AMIGA_PORTS, instance);
scsi_host_put(instance);
release_mem_region(res->start, resource_size(res));
- return 0;
}
static struct platform_driver amiga_a3000_scsi_driver = {
- .remove = __exit_p(amiga_a3000_scsi_remove),
+ .remove_new = __exit_p(amiga_a3000_scsi_remove),
.driver = {
.name = "amiga-a3000-scsi",
},
--
2.42.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 02/14] scsi: a4000t: Convert to platform remove callback returning void
2023-12-03 16:05 [PATCH 00/14] scsci: Convert to platform remove callback returning void Uwe Kleine-König
2023-12-03 16:05 ` [PATCH 01/14] scsi: a3000: " Uwe Kleine-König
@ 2023-12-03 16:05 ` Uwe Kleine-König
2023-12-03 16:05 ` [PATCH 03/14] scsi: atari: " Uwe Kleine-König
` (13 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: Uwe Kleine-König @ 2023-12-03 16:05 UTC (permalink / raw)
To: James E.J. Bottomley, Martin K. Petersen; +Cc: linux-scsi, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
In the error path emit an error message replacing the (less useful)
message by the core. Apart from the improved error message there is no
change in behaviour.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/scsi/a4000t.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/a4000t.c b/drivers/scsi/a4000t.c
index 5e575afce134..e435fc06a624 100644
--- a/drivers/scsi/a4000t.c
+++ b/drivers/scsi/a4000t.c
@@ -95,7 +95,7 @@ static int __init amiga_a4000t_scsi_probe(struct platform_device *pdev)
return -ENODEV;
}
-static int __exit amiga_a4000t_scsi_remove(struct platform_device *pdev)
+static void __exit amiga_a4000t_scsi_remove(struct platform_device *pdev)
{
struct Scsi_Host *host = platform_get_drvdata(pdev);
struct NCR_700_Host_Parameters *hostdata = shost_priv(host);
@@ -106,11 +106,10 @@ static int __exit amiga_a4000t_scsi_remove(struct platform_device *pdev)
kfree(hostdata);
free_irq(host->irq, host);
release_mem_region(res->start, resource_size(res));
- return 0;
}
static struct platform_driver amiga_a4000t_scsi_driver = {
- .remove = __exit_p(amiga_a4000t_scsi_remove),
+ .remove_new = __exit_p(amiga_a4000t_scsi_remove),
.driver = {
.name = "amiga-a4000t-scsi",
},
--
2.42.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 03/14] scsi: atari: Convert to platform remove callback returning void
2023-12-03 16:05 [PATCH 00/14] scsci: Convert to platform remove callback returning void Uwe Kleine-König
2023-12-03 16:05 ` [PATCH 01/14] scsi: a3000: " Uwe Kleine-König
2023-12-03 16:05 ` [PATCH 02/14] scsi: a4000t: " Uwe Kleine-König
@ 2023-12-03 16:05 ` Uwe Kleine-König
2023-12-03 16:05 ` [PATCH 04/14] scsi: bvme6000: " Uwe Kleine-König
` (12 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: Uwe Kleine-König @ 2023-12-03 16:05 UTC (permalink / raw)
To: James E.J. Bottomley, Martin K. Petersen
Cc: Finn Thain, Michael Schmitz, linux-scsi, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
In the error path emit an error message replacing the (less useful)
message by the core. Apart from the improved error message there is no
change in behaviour.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/scsi/atari_scsi.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/atari_scsi.c b/drivers/scsi/atari_scsi.c
index d401cf27113a..d99e70914817 100644
--- a/drivers/scsi/atari_scsi.c
+++ b/drivers/scsi/atari_scsi.c
@@ -865,7 +865,7 @@ static int __init atari_scsi_probe(struct platform_device *pdev)
return error;
}
-static int __exit atari_scsi_remove(struct platform_device *pdev)
+static void __exit atari_scsi_remove(struct platform_device *pdev)
{
struct Scsi_Host *instance = platform_get_drvdata(pdev);
@@ -876,11 +876,10 @@ static int __exit atari_scsi_remove(struct platform_device *pdev)
scsi_host_put(instance);
if (atari_dma_buffer)
atari_stram_free(atari_dma_buffer);
- return 0;
}
static struct platform_driver atari_scsi_driver = {
- .remove = __exit_p(atari_scsi_remove),
+ .remove_new = __exit_p(atari_scsi_remove),
.driver = {
.name = DRV_MODULE_NAME,
},
--
2.42.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 04/14] scsi: bvme6000: Convert to platform remove callback returning void
2023-12-03 16:05 [PATCH 00/14] scsci: Convert to platform remove callback returning void Uwe Kleine-König
` (2 preceding siblings ...)
2023-12-03 16:05 ` [PATCH 03/14] scsi: atari: " Uwe Kleine-König
@ 2023-12-03 16:05 ` Uwe Kleine-König
2023-12-03 16:05 ` [PATCH 05/14] scsi: jazz_esp: " Uwe Kleine-König
` (11 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: Uwe Kleine-König @ 2023-12-03 16:05 UTC (permalink / raw)
To: James E.J. Bottomley, Martin K. Petersen; +Cc: linux-scsi, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
In the error path emit an error message replacing the (less useful)
message by the core. Apart from the improved error message there is no
change in behaviour.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/scsi/bvme6000_scsi.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/bvme6000_scsi.c b/drivers/scsi/bvme6000_scsi.c
index 8d72b25535c5..f893e9779e9d 100644
--- a/drivers/scsi/bvme6000_scsi.c
+++ b/drivers/scsi/bvme6000_scsi.c
@@ -89,7 +89,7 @@ bvme6000_probe(struct platform_device *dev)
return -ENODEV;
}
-static int
+static void
bvme6000_device_remove(struct platform_device *dev)
{
struct Scsi_Host *host = platform_get_drvdata(dev);
@@ -99,8 +99,6 @@ bvme6000_device_remove(struct platform_device *dev)
NCR_700_release(host);
kfree(hostdata);
free_irq(host->irq, host);
-
- return 0;
}
static struct platform_driver bvme6000_scsi_driver = {
@@ -108,7 +106,7 @@ static struct platform_driver bvme6000_scsi_driver = {
.name = "bvme6000-scsi",
},
.probe = bvme6000_probe,
- .remove = bvme6000_device_remove,
+ .remove_new = bvme6000_device_remove,
};
static int __init bvme6000_scsi_init(void)
--
2.42.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 05/14] scsi: jazz_esp: Convert to platform remove callback returning void
2023-12-03 16:05 [PATCH 00/14] scsci: Convert to platform remove callback returning void Uwe Kleine-König
` (3 preceding siblings ...)
2023-12-03 16:05 ` [PATCH 04/14] scsi: bvme6000: " Uwe Kleine-König
@ 2023-12-03 16:05 ` Uwe Kleine-König
2023-12-03 16:05 ` [PATCH 06/14] scsi: mac_esp: " Uwe Kleine-König
` (10 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: Uwe Kleine-König @ 2023-12-03 16:05 UTC (permalink / raw)
To: James E.J. Bottomley, Martin K. Petersen; +Cc: linux-scsi, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
In the error path emit an error message replacing the (less useful)
message by the core. Apart from the improved error message there is no
change in behaviour.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/scsi/jazz_esp.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/jazz_esp.c b/drivers/scsi/jazz_esp.c
index 0c842fb29aa0..494a671fb556 100644
--- a/drivers/scsi/jazz_esp.c
+++ b/drivers/scsi/jazz_esp.c
@@ -176,7 +176,7 @@ static int esp_jazz_probe(struct platform_device *dev)
return err;
}
-static int esp_jazz_remove(struct platform_device *dev)
+static void esp_jazz_remove(struct platform_device *dev)
{
struct esp *esp = dev_get_drvdata(&dev->dev);
unsigned int irq = esp->host->irq;
@@ -189,8 +189,6 @@ static int esp_jazz_remove(struct platform_device *dev)
esp->command_block_dma);
scsi_host_put(esp->host);
-
- return 0;
}
/* work with hotplug and coldplug */
@@ -198,7 +196,7 @@ MODULE_ALIAS("platform:jazz_esp");
static struct platform_driver esp_jazz_driver = {
.probe = esp_jazz_probe,
- .remove = esp_jazz_remove,
+ .remove_new = esp_jazz_remove,
.driver = {
.name = "jazz_esp",
},
--
2.42.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 06/14] scsi: mac_esp: Convert to platform remove callback returning void
2023-12-03 16:05 [PATCH 00/14] scsci: Convert to platform remove callback returning void Uwe Kleine-König
` (4 preceding siblings ...)
2023-12-03 16:05 ` [PATCH 05/14] scsi: jazz_esp: " Uwe Kleine-König
@ 2023-12-03 16:05 ` Uwe Kleine-König
2023-12-03 16:05 ` [PATCH 07/14] scsi: mac: " Uwe Kleine-König
` (9 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: Uwe Kleine-König @ 2023-12-03 16:05 UTC (permalink / raw)
To: James E.J. Bottomley, Martin K. Petersen; +Cc: linux-scsi, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
In the error path emit an error message replacing the (less useful)
message by the core. Apart from the improved error message there is no
change in behaviour.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/scsi/mac_esp.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/mac_esp.c b/drivers/scsi/mac_esp.c
index 3f0061b00494..187ae0a65d40 100644
--- a/drivers/scsi/mac_esp.c
+++ b/drivers/scsi/mac_esp.c
@@ -407,7 +407,7 @@ static int esp_mac_probe(struct platform_device *dev)
return err;
}
-static int esp_mac_remove(struct platform_device *dev)
+static void esp_mac_remove(struct platform_device *dev)
{
struct mac_esp_priv *mep = platform_get_drvdata(dev);
struct esp *esp = mep->esp;
@@ -428,13 +428,11 @@ static int esp_mac_remove(struct platform_device *dev)
kfree(esp->command_block);
scsi_host_put(esp->host);
-
- return 0;
}
static struct platform_driver esp_mac_driver = {
.probe = esp_mac_probe,
- .remove = esp_mac_remove,
+ .remove_new = esp_mac_remove,
.driver = {
.name = DRV_MODULE_NAME,
},
--
2.42.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 07/14] scsi: mac: Convert to platform remove callback returning void
2023-12-03 16:05 [PATCH 00/14] scsci: Convert to platform remove callback returning void Uwe Kleine-König
` (5 preceding siblings ...)
2023-12-03 16:05 ` [PATCH 06/14] scsi: mac_esp: " Uwe Kleine-König
@ 2023-12-03 16:05 ` Uwe Kleine-König
2023-12-03 16:05 ` [PATCH 08/14] scsi: mvme16x: " Uwe Kleine-König
` (8 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: Uwe Kleine-König @ 2023-12-03 16:05 UTC (permalink / raw)
To: James E.J. Bottomley, Martin K. Petersen
Cc: Finn Thain, Michael Schmitz, linux-scsi, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
In the error path emit an error message replacing the (less useful)
message by the core. Apart from the improved error message there is no
change in behaviour.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/scsi/mac_scsi.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/mac_scsi.c b/drivers/scsi/mac_scsi.c
index 2e511697fce3..181f16899fdc 100644
--- a/drivers/scsi/mac_scsi.c
+++ b/drivers/scsi/mac_scsi.c
@@ -523,7 +523,7 @@ static int __init mac_scsi_probe(struct platform_device *pdev)
return error;
}
-static int __exit mac_scsi_remove(struct platform_device *pdev)
+static void __exit mac_scsi_remove(struct platform_device *pdev)
{
struct Scsi_Host *instance = platform_get_drvdata(pdev);
@@ -532,11 +532,10 @@ static int __exit mac_scsi_remove(struct platform_device *pdev)
free_irq(instance->irq, instance);
NCR5380_exit(instance);
scsi_host_put(instance);
- return 0;
}
static struct platform_driver mac_scsi_driver = {
- .remove = __exit_p(mac_scsi_remove),
+ .remove_new = __exit_p(mac_scsi_remove),
.driver = {
.name = DRV_MODULE_NAME,
},
--
2.42.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 08/14] scsi: mvme16x: Convert to platform remove callback returning void
2023-12-03 16:05 [PATCH 00/14] scsci: Convert to platform remove callback returning void Uwe Kleine-König
` (6 preceding siblings ...)
2023-12-03 16:05 ` [PATCH 07/14] scsi: mac: " Uwe Kleine-König
@ 2023-12-03 16:05 ` Uwe Kleine-König
2023-12-03 16:05 ` [PATCH 09/14] scsi: qlogicpti: " Uwe Kleine-König
` (7 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: Uwe Kleine-König @ 2023-12-03 16:05 UTC (permalink / raw)
To: James E.J. Bottomley, Martin K. Petersen; +Cc: linux-scsi, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
In the error path emit an error message replacing the (less useful)
message by the core. Apart from the improved error message there is no
change in behaviour.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/scsi/mvme16x_scsi.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/mvme16x_scsi.c b/drivers/scsi/mvme16x_scsi.c
index 21d638299ab8..e08a38e2a442 100644
--- a/drivers/scsi/mvme16x_scsi.c
+++ b/drivers/scsi/mvme16x_scsi.c
@@ -103,7 +103,7 @@ static int mvme16x_probe(struct platform_device *dev)
return -ENODEV;
}
-static int mvme16x_device_remove(struct platform_device *dev)
+static void mvme16x_device_remove(struct platform_device *dev)
{
struct Scsi_Host *host = platform_get_drvdata(dev);
struct NCR_700_Host_Parameters *hostdata = shost_priv(host);
@@ -120,8 +120,6 @@ static int mvme16x_device_remove(struct platform_device *dev)
NCR_700_release(host);
kfree(hostdata);
free_irq(host->irq, host);
-
- return 0;
}
static struct platform_driver mvme16x_scsi_driver = {
@@ -129,7 +127,7 @@ static struct platform_driver mvme16x_scsi_driver = {
.name = "mvme16x-scsi",
},
.probe = mvme16x_probe,
- .remove = mvme16x_device_remove,
+ .remove_new = mvme16x_device_remove,
};
static int __init mvme16x_scsi_init(void)
--
2.42.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 09/14] scsi: qlogicpti: Convert to platform remove callback returning void
2023-12-03 16:05 [PATCH 00/14] scsci: Convert to platform remove callback returning void Uwe Kleine-König
` (7 preceding siblings ...)
2023-12-03 16:05 ` [PATCH 08/14] scsi: mvme16x: " Uwe Kleine-König
@ 2023-12-03 16:05 ` Uwe Kleine-König
2023-12-03 16:05 ` [PATCH 10/14] scsi: sgiwd93: " Uwe Kleine-König
` (6 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: Uwe Kleine-König @ 2023-12-03 16:05 UTC (permalink / raw)
To: James E.J. Bottomley, Martin K. Petersen; +Cc: linux-scsi, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
In the error path emit an error message replacing the (less useful)
message by the core. Apart from the improved error message there is no
change in behaviour.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/scsi/qlogicpti.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/qlogicpti.c b/drivers/scsi/qlogicpti.c
index 3b95f7a6216f..5d560d9b8944 100644
--- a/drivers/scsi/qlogicpti.c
+++ b/drivers/scsi/qlogicpti.c
@@ -1409,7 +1409,7 @@ static int qpti_sbus_probe(struct platform_device *op)
return -ENODEV;
}
-static int qpti_sbus_remove(struct platform_device *op)
+static void qpti_sbus_remove(struct platform_device *op)
{
struct qlogicpti *qpti = dev_get_drvdata(&op->dev);
@@ -1438,8 +1438,6 @@ static int qpti_sbus_remove(struct platform_device *op)
of_iounmap(&op->resource[0], qpti->sreg, sizeof(unsigned char));
scsi_host_put(qpti->qhost);
-
- return 0;
}
static const struct of_device_id qpti_match[] = {
@@ -1465,7 +1463,7 @@ static struct platform_driver qpti_sbus_driver = {
.of_match_table = qpti_match,
},
.probe = qpti_sbus_probe,
- .remove = qpti_sbus_remove,
+ .remove_new = qpti_sbus_remove,
};
module_platform_driver(qpti_sbus_driver);
--
2.42.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 10/14] scsi: sgiwd93: Convert to platform remove callback returning void
2023-12-03 16:05 [PATCH 00/14] scsci: Convert to platform remove callback returning void Uwe Kleine-König
` (8 preceding siblings ...)
2023-12-03 16:05 ` [PATCH 09/14] scsi: qlogicpti: " Uwe Kleine-König
@ 2023-12-03 16:05 ` Uwe Kleine-König
2023-12-03 16:05 ` [PATCH 11/14] scsi: sni_53c710: " Uwe Kleine-König
` (5 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: Uwe Kleine-König @ 2023-12-03 16:05 UTC (permalink / raw)
To: James E.J. Bottomley, Martin K. Petersen; +Cc: linux-scsi, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
In the error path emit an error message replacing the (less useful)
message by the core. Apart from the improved error message there is no
change in behaviour.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/scsi/sgiwd93.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/sgiwd93.c b/drivers/scsi/sgiwd93.c
index 88e2b5eb9caa..b0bef83db7b6 100644
--- a/drivers/scsi/sgiwd93.c
+++ b/drivers/scsi/sgiwd93.c
@@ -291,7 +291,7 @@ static int sgiwd93_probe(struct platform_device *pdev)
return err;
}
-static int sgiwd93_remove(struct platform_device *pdev)
+static void sgiwd93_remove(struct platform_device *pdev)
{
struct Scsi_Host *host = platform_get_drvdata(pdev);
struct ip22_hostdata *hdata = (struct ip22_hostdata *) host->hostdata;
@@ -302,12 +302,11 @@ static int sgiwd93_remove(struct platform_device *pdev)
dma_free_noncoherent(&pdev->dev, HPC_DMA_SIZE, hdata->cpu, hdata->dma,
DMA_TO_DEVICE);
scsi_host_put(host);
- return 0;
}
static struct platform_driver sgiwd93_driver = {
.probe = sgiwd93_probe,
- .remove = sgiwd93_remove,
+ .remove_new = sgiwd93_remove,
.driver = {
.name = "sgiwd93",
}
--
2.42.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 11/14] scsi: sni_53c710: Convert to platform remove callback returning void
2023-12-03 16:05 [PATCH 00/14] scsci: Convert to platform remove callback returning void Uwe Kleine-König
` (9 preceding siblings ...)
2023-12-03 16:05 ` [PATCH 10/14] scsi: sgiwd93: " Uwe Kleine-König
@ 2023-12-03 16:05 ` Uwe Kleine-König
2023-12-03 16:05 ` [PATCH 12/14] scsi: sun3: " Uwe Kleine-König
` (4 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: Uwe Kleine-König @ 2023-12-03 16:05 UTC (permalink / raw)
To: James E.J. Bottomley, Martin K. Petersen; +Cc: linux-scsi, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
In the error path emit an error message replacing the (less useful)
message by the core. Apart from the improved error message there is no
change in behaviour.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/scsi/sni_53c710.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/sni_53c710.c b/drivers/scsi/sni_53c710.c
index 678651b9b4dd..9df1c90a24c1 100644
--- a/drivers/scsi/sni_53c710.c
+++ b/drivers/scsi/sni_53c710.c
@@ -104,7 +104,7 @@ static int snirm710_probe(struct platform_device *dev)
return -ENODEV;
}
-static int snirm710_driver_remove(struct platform_device *dev)
+static void snirm710_driver_remove(struct platform_device *dev)
{
struct Scsi_Host *host = dev_get_drvdata(&dev->dev);
struct NCR_700_Host_Parameters *hostdata =
@@ -115,13 +115,11 @@ static int snirm710_driver_remove(struct platform_device *dev)
free_irq(host->irq, host);
iounmap(hostdata->base);
kfree(hostdata);
-
- return 0;
}
static struct platform_driver snirm710_driver = {
.probe = snirm710_probe,
- .remove = snirm710_driver_remove,
+ .remove_new = snirm710_driver_remove,
.driver = {
.name = "snirm_53c710",
},
--
2.42.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 12/14] scsi: sun3: Convert to platform remove callback returning void
2023-12-03 16:05 [PATCH 00/14] scsci: Convert to platform remove callback returning void Uwe Kleine-König
` (10 preceding siblings ...)
2023-12-03 16:05 ` [PATCH 11/14] scsi: sni_53c710: " Uwe Kleine-König
@ 2023-12-03 16:05 ` Uwe Kleine-König
2023-12-03 16:05 ` [PATCH 13/14] scsi: sun3x_esp: " Uwe Kleine-König
` (3 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: Uwe Kleine-König @ 2023-12-03 16:05 UTC (permalink / raw)
To: James E.J. Bottomley, Martin K. Petersen
Cc: Finn Thain, Michael Schmitz, linux-scsi, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
In the error path emit an error message replacing the (less useful)
message by the core. Apart from the improved error message there is no
change in behaviour.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/scsi/sun3_scsi.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/sun3_scsi.c b/drivers/scsi/sun3_scsi.c
index abf229b847a1..4a8cc2e8238e 100644
--- a/drivers/scsi/sun3_scsi.c
+++ b/drivers/scsi/sun3_scsi.c
@@ -641,7 +641,7 @@ static int __init sun3_scsi_probe(struct platform_device *pdev)
return error;
}
-static int __exit sun3_scsi_remove(struct platform_device *pdev)
+static void __exit sun3_scsi_remove(struct platform_device *pdev)
{
struct Scsi_Host *instance = platform_get_drvdata(pdev);
struct NCR5380_hostdata *hostdata = shost_priv(instance);
@@ -654,11 +654,10 @@ static int __exit sun3_scsi_remove(struct platform_device *pdev)
if (udc_regs)
dvma_free(udc_regs);
iounmap(ioaddr);
- return 0;
}
static struct platform_driver sun3_scsi_driver = {
- .remove = __exit_p(sun3_scsi_remove),
+ .remove_new = __exit_p(sun3_scsi_remove),
.driver = {
.name = DRV_MODULE_NAME,
},
--
2.42.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 13/14] scsi: sun3x_esp: Convert to platform remove callback returning void
2023-12-03 16:05 [PATCH 00/14] scsci: Convert to platform remove callback returning void Uwe Kleine-König
` (11 preceding siblings ...)
2023-12-03 16:05 ` [PATCH 12/14] scsi: sun3: " Uwe Kleine-König
@ 2023-12-03 16:05 ` Uwe Kleine-König
2023-12-03 16:05 ` [PATCH 14/14] scsi: sun_esp: " Uwe Kleine-König
` (2 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: Uwe Kleine-König @ 2023-12-03 16:05 UTC (permalink / raw)
To: James E.J. Bottomley, Martin K. Petersen; +Cc: linux-scsi, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
In the error path emit an error message replacing the (less useful)
message by the core. Apart from the improved error message there is no
change in behaviour.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/scsi/sun3x_esp.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/sun3x_esp.c b/drivers/scsi/sun3x_esp.c
index 30f67cbf4a7a..09219c362acc 100644
--- a/drivers/scsi/sun3x_esp.c
+++ b/drivers/scsi/sun3x_esp.c
@@ -243,7 +243,7 @@ static int esp_sun3x_probe(struct platform_device *dev)
return err;
}
-static int esp_sun3x_remove(struct platform_device *dev)
+static void esp_sun3x_remove(struct platform_device *dev)
{
struct esp *esp = dev_get_drvdata(&dev->dev);
unsigned int irq = esp->host->irq;
@@ -261,13 +261,11 @@ static int esp_sun3x_remove(struct platform_device *dev)
esp->command_block_dma);
scsi_host_put(esp->host);
-
- return 0;
}
static struct platform_driver esp_sun3x_driver = {
.probe = esp_sun3x_probe,
- .remove = esp_sun3x_remove,
+ .remove_new = esp_sun3x_remove,
.driver = {
.name = "sun3x_esp",
},
--
2.42.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 14/14] scsi: sun_esp: Convert to platform remove callback returning void
2023-12-03 16:05 [PATCH 00/14] scsci: Convert to platform remove callback returning void Uwe Kleine-König
` (12 preceding siblings ...)
2023-12-03 16:05 ` [PATCH 13/14] scsi: sun3x_esp: " Uwe Kleine-König
@ 2023-12-03 16:05 ` Uwe Kleine-König
2023-12-06 2:54 ` [PATCH 00/14] scsci: " Martin K. Petersen
2023-12-14 4:29 ` Martin K. Petersen
15 siblings, 0 replies; 17+ messages in thread
From: Uwe Kleine-König @ 2023-12-03 16:05 UTC (permalink / raw)
To: James E.J. Bottomley, Martin K. Petersen; +Cc: linux-scsi, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
In the error path emit an error message replacing the (less useful)
message by the core. Apart from the improved error message there is no
change in behaviour.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/scsi/sun_esp.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/sun_esp.c b/drivers/scsi/sun_esp.c
index afa9d02a33ec..64a7c2c6c5ff 100644
--- a/drivers/scsi/sun_esp.c
+++ b/drivers/scsi/sun_esp.c
@@ -550,7 +550,7 @@ static int esp_sbus_probe(struct platform_device *op)
return ret;
}
-static int esp_sbus_remove(struct platform_device *op)
+static void esp_sbus_remove(struct platform_device *op)
{
struct esp *esp = dev_get_drvdata(&op->dev);
struct platform_device *dma_of = esp->dma;
@@ -581,8 +581,6 @@ static int esp_sbus_remove(struct platform_device *op)
dev_set_drvdata(&op->dev, NULL);
put_device(&dma_of->dev);
-
- return 0;
}
static const struct of_device_id esp_match[] = {
@@ -605,7 +603,7 @@ static struct platform_driver esp_sbus_driver = {
.of_match_table = esp_match,
},
.probe = esp_sbus_probe,
- .remove = esp_sbus_remove,
+ .remove_new = esp_sbus_remove,
};
module_platform_driver(esp_sbus_driver);
--
2.42.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH 00/14] scsci: Convert to platform remove callback returning void
2023-12-03 16:05 [PATCH 00/14] scsci: Convert to platform remove callback returning void Uwe Kleine-König
` (13 preceding siblings ...)
2023-12-03 16:05 ` [PATCH 14/14] scsi: sun_esp: " Uwe Kleine-König
@ 2023-12-06 2:54 ` Martin K. Petersen
2023-12-14 4:29 ` Martin K. Petersen
15 siblings, 0 replies; 17+ messages in thread
From: Martin K. Petersen @ 2023-12-06 2:54 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: James E.J. Bottomley, Martin K. Petersen, linux-scsi, Finn Thain,
Michael Schmitz, kernel
Uwe,
> this series converts all drivers below drivers/scsi to struct
> platform_driver::remove_new(). See commit 5c5a7680e67b ("platform:
> Provide a remove callback that returns no value") for an extended
> explanation and the eventual goal.
>
> All conversations are trivial, because all .remove() callbacks returned
> zero unconditionally.
Applied to 6.8/scsi-staging, thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 00/14] scsci: Convert to platform remove callback returning void
2023-12-03 16:05 [PATCH 00/14] scsci: Convert to platform remove callback returning void Uwe Kleine-König
` (14 preceding siblings ...)
2023-12-06 2:54 ` [PATCH 00/14] scsci: " Martin K. Petersen
@ 2023-12-14 4:29 ` Martin K. Petersen
15 siblings, 0 replies; 17+ messages in thread
From: Martin K. Petersen @ 2023-12-14 4:29 UTC (permalink / raw)
To: James E.J. Bottomley, Uwe Kleine-König
Cc: Martin K . Petersen, linux-scsi, Finn Thain, Michael Schmitz,
kernel
On Sun, 03 Dec 2023 17:05:45 +0100, Uwe Kleine-König wrote:
> this series converts all drivers below drivers/scsi to struct
> platform_driver::remove_new(). See commit 5c5a7680e67b ("platform:
> Provide a remove callback that returns no value") for an extended
> explanation and the eventual goal.
>
> All conversations are trivial, because all .remove() callbacks returned
> zero unconditionally.
>
> [...]
Applied to 6.8/scsi-queue, thanks!
[01/14] scsi: a3000: Convert to platform remove callback returning void
https://git.kernel.org/mkp/scsi/c/5854cdd04163
[02/14] scsi: a4000t: Convert to platform remove callback returning void
https://git.kernel.org/mkp/scsi/c/688bbe398ca6
[03/14] scsi: atari: Convert to platform remove callback returning void
https://git.kernel.org/mkp/scsi/c/3becb4cdf1c1
[04/14] scsi: bvme6000: Convert to platform remove callback returning void
https://git.kernel.org/mkp/scsi/c/51a41ec6d36e
[05/14] scsi: jazz_esp: Convert to platform remove callback returning void
https://git.kernel.org/mkp/scsi/c/c71ef3d1fb39
[06/14] scsi: mac_esp: Convert to platform remove callback returning void
https://git.kernel.org/mkp/scsi/c/0b649224f712
[07/14] scsi: mac: Convert to platform remove callback returning void
https://git.kernel.org/mkp/scsi/c/69b43bf38b11
[08/14] scsi: mvme16x: Convert to platform remove callback returning void
https://git.kernel.org/mkp/scsi/c/f0baf76a2204
[09/14] scsi: qlogicpti: Convert to platform remove callback returning void
https://git.kernel.org/mkp/scsi/c/e26eec9a4d25
[10/14] scsi: sgiwd93: Convert to platform remove callback returning void
https://git.kernel.org/mkp/scsi/c/358987af1bda
[11/14] scsi: sni_53c710: Convert to platform remove callback returning void
https://git.kernel.org/mkp/scsi/c/357a7fd2434e
[12/14] scsi: sun3: Convert to platform remove callback returning void
https://git.kernel.org/mkp/scsi/c/15b016b2d023
[13/14] scsi: sun3x_esp: Convert to platform remove callback returning void
https://git.kernel.org/mkp/scsi/c/e84bd0bb3068
[14/14] scsi: sun_esp: Convert to platform remove callback returning void
https://git.kernel.org/mkp/scsi/c/6ff482eeebe5
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2023-12-14 4:29 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-03 16:05 [PATCH 00/14] scsci: Convert to platform remove callback returning void Uwe Kleine-König
2023-12-03 16:05 ` [PATCH 01/14] scsi: a3000: " Uwe Kleine-König
2023-12-03 16:05 ` [PATCH 02/14] scsi: a4000t: " Uwe Kleine-König
2023-12-03 16:05 ` [PATCH 03/14] scsi: atari: " Uwe Kleine-König
2023-12-03 16:05 ` [PATCH 04/14] scsi: bvme6000: " Uwe Kleine-König
2023-12-03 16:05 ` [PATCH 05/14] scsi: jazz_esp: " Uwe Kleine-König
2023-12-03 16:05 ` [PATCH 06/14] scsi: mac_esp: " Uwe Kleine-König
2023-12-03 16:05 ` [PATCH 07/14] scsi: mac: " Uwe Kleine-König
2023-12-03 16:05 ` [PATCH 08/14] scsi: mvme16x: " Uwe Kleine-König
2023-12-03 16:05 ` [PATCH 09/14] scsi: qlogicpti: " Uwe Kleine-König
2023-12-03 16:05 ` [PATCH 10/14] scsi: sgiwd93: " Uwe Kleine-König
2023-12-03 16:05 ` [PATCH 11/14] scsi: sni_53c710: " Uwe Kleine-König
2023-12-03 16:05 ` [PATCH 12/14] scsi: sun3: " Uwe Kleine-König
2023-12-03 16:05 ` [PATCH 13/14] scsi: sun3x_esp: " Uwe Kleine-König
2023-12-03 16:05 ` [PATCH 14/14] scsi: sun_esp: " Uwe Kleine-König
2023-12-06 2:54 ` [PATCH 00/14] scsci: " Martin K. Petersen
2023-12-14 4:29 ` Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox