Skip to contentSkip to conversation

atmel/spi: fix missing probe

PATCH Superseded Jean-Christophe PLAGNIOL-VILLARD 3 participants 6 messages Nov 3, 2011

Subsystems (3)

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 atmel/spi: fix missing probe

Commit 940ab889 "drivercore: Add helper macro for platform_driver boilerplate" converted this driver to use module_platform_driver, but due to the use of platform_driver_probe(), this resulted in the call to atmel_spi_probe being lost. Place the call to this function into the driver structure.

Cc Greg Kroah-Hartman <[email protected]>
Cc Grant Likely <[email protected]>
Cc Russell King - ARM Linux <[email protected]>

---
v3:

update commit message

 drivers/spi/spi-atmel.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/spi/spi-atmel.c +1 -0
index 79665e2..3cd4f49 100644
@@ -1072,6 +1072,7 @@ static struct platform_driver atmel_spi_driver = {
 	},
 	.suspend	= atmel_spi_suspend,
 	.resume		= atmel_spi_resume,
+	.prove		= atmel_spi_probe,
 	.remove		= __exit_p(atmel_spi_remove),
 };
 module_platform_driver(atmel_spi_driver);
Signature · 1 line
1.7.7
#1 lore raw

PATCH 2/2 atmel/spi: fix section missmatch

atmel_spi_probe is marked __init where it's supposed to be __devinit

---
 drivers/spi/spi-atmel.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/spi/spi-atmel.c +1 -1
index 3cd4f49..1525262 100644
@@ -907,7 +907,7 @@ static void atmel_spi_cleanup(struct spi_device *spi)
 
 /*-------------------------------------------------------------------------*/
 
-static int __init atmel_spi_probe(struct platform_device *pdev)
+static int __devinit atmel_spi_probe(struct platform_device *pdev)
 {
 	struct resource		*regs;
 	int			irq;
Signature · 1 line
1.7.7
#2 lore raw

PATCH 1/2 atmel/spi: fix missing probe

In reply to Jean-Christophe PLAGNIOL-VILLARD
Quoted 21 lines · Jean-Christophe PLAGNIOL-VILLARD

Commit 940ab889 "drivercore: Add helper macro for platform_driver boilerplate" converted this driver to use module_platform_driver, but due to the use of platform_driver_probe(), this resulted in the call to atmel_spi_probe being lost. Place the call to this function into the driver structure.

Cc Greg Kroah-Hartman<[email protected]>
Cc Grant Likely<[email protected]>
Cc Russell King - ARM Linux<[email protected]>

---
v3:

update commit message

  drivers/spi/spi-atmel.c |    1 +
  1 files changed, 1 insertions(+), 0 deletions(-)
drivers/spi/spi-atmel.c +0 -0
index 79665e2..3cd4f49 100644

drivers/spi/spi-atmel.c static struct platform_driver atmel_spi_driver = { · line 1075

Quoted 4 lines
drivers/spi/spi-atmel.c +1 -0
@@ -1072,6 +1072,7 @@ static struct platform_driver atmel_spi_driver = {
  	},
  	.suspend	= atmel_spi_suspend,
  	.resume		= atmel_spi_resume,
+	.prove		= atmel_spi_probe,
          ^^^^^

This is certainly a typo. Didn't you even compile-test this?

Daniel

#3 lore raw

PATCH 1/2 atmel/spi: fix missing probe

Quoted 28 lines · Daniel Mack
Quoted 21 lines · Jean-Christophe PLAGNIOL-VILLARD

Commit 940ab889 "drivercore: Add helper macro for platform_driver boilerplate" converted this driver to use module_platform_driver, but due to the use of platform_driver_probe(), this resulted in the call to atmel_spi_probe being lost. Place the call to this function into the driver structure.

Cc Greg Kroah-Hartman<[email protected]>
Cc Grant Likely<[email protected]>
Cc Russell King - ARM Linux<[email protected]>

---
v3:

update commit message

 drivers/spi/spi-atmel.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/spi/spi-atmel.c +0 -0
index 79665e2..3cd4f49 100644

drivers/spi/spi-atmel.c static struct platform_driver atmel_spi_driver = { · line 1075

Quoted 4 lines
drivers/spi/spi-atmel.c +1 -0
@@ -1072,6 +1072,7 @@ static struct platform_driver atmel_spi_driver = {
 	},
 	.suspend	= atmel_spi_suspend,
 	.resume		= atmel_spi_resume,
+	.prove		= atmel_spi_probe,
         ^^^^^
Quoted 1 line

This is certainly a typo. Didn't you even compile-test this?

I did I make the typo when editing the commit message before sending the patch
Dame

Best Regards,
J.

#4 lore raw

PATCH v4 1/2 atmel/spi: fix missing probe

In reply to Jean-Christophe PLAGNIOL-VILLARD

Commit 940ab889 "drivercore: Add helper macro for platform_driver boilerplate" converted this driver to use module_platform_driver, but due to the use of platform_driver_probe(), this resulted in the call to atmel_spi_probe being lost. Place the call to this function into the driver structure.

Cc Greg Kroah-Hartman <[email protected]>
Cc Grant Likely <[email protected]>
Cc Russell King - ARM Linux <[email protected]>

---
v4:

fix typo when editing commit message

 drivers/spi/spi-atmel.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/spi/spi-atmel.c +1 -0
index 79665e2..3cd4f49 100644
@@ -1072,6 +1072,7 @@ static struct platform_driver atmel_spi_driver = {
 	},
 	.suspend	= atmel_spi_suspend,
 	.resume		= atmel_spi_resume,
+	.probe		= atmel_spi_probe,
 	.remove		= __exit_p(atmel_spi_remove),
 };
 module_platform_driver(atmel_spi_driver);
Signature · 1 line
1.7.7
#5 lore raw

PATCH v4 1/2 atmel/spi: fix missing probe

Quoted 4 lines · Jean-Christophe PLAGNIOL-VILLARD

Commit 940ab889 "drivercore: Add helper macro for platform_driver boilerplate" converted this driver to use module_platform_driver, but due to the use of platform_driver_probe(), this resulted in the call to atmel_spi_probe being lost. Place the call to this function into the driver structure.

Let me say again, this should not be the first patch in the series. If you're trying to fix a bug don't introduce a new bug by fixing another bug.

If you did this with, say, the VM or FS subsystem, you'll have this patch reverted.

Moreover, it's bad practice to do "fixes" in this way, especially when it's trivial to do it _right_ as I've already mentioned several times.

I still maintain that it should be _one_ patch fixing these issues, not two.