Skip to contentSkip to conversation

atmel/spi: fix missing probe during the switch to module_platform_driver

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

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 atmel/spi: fix missing probe during the switch to module_platform_driver

in commit 940ab889

Cc Greg Kroah-Hartman <[email protected]>
Cc Grant Likely <[email protected]>
Cc Nicolas Ferre <[email protected]>
---
 arch/arm/mach-at91/include/mach/at91_aic.h |    2 +-
 drivers/spi/spi-atmel.c                    |    1 +
 2 files changed, 2 insertions(+), 1 deletions(-)
arch/arm/mach-at91/include/mach/at91_aic.h +1 -1
index 4b0a57e..f163bb6 100644
@@ -20,7 +20,7 @@
 extern void __iomem *at91_aic_base;
 
 #define at91_aic_read(field) \
-	__raw_read(at91_aic_base + field)
+	__raw_readl(at91_aic_base + field)
 
 #define at91_aic_write(field, value) \
 	__raw_writel(value, at91_aic_base + field);
drivers/spi/spi-atmel.c +1 -0
index 79665e2..a691240 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
#1 lore raw

PATCH 1/1 atmel/spi: fix missing probe during the switch to module_platform_driver

Quoted 29 lines · Jean-Christophe PLAGNIOL-VILLARD

in commit 940ab889

Cc Greg Kroah-Hartman <[email protected]>
Cc Grant Likely <[email protected]>
Cc Nicolas Ferre <[email protected]>

---
?arch/arm/mach-at91/include/mach/at91_aic.h | ? ?2 +- ?drivers/spi/spi-atmel.c ? ? ? ? ? ? ? ? ? ?| ? ?1 + ?2 files changed, 2 insertions(+), 1 deletions(-)

arch/arm/mach-at91/include/mach/at91_aic.h +1 -1
index 4b0a57e..f163bb6 100644
@@ -20,7 +20,7 @@
 ?extern void __iomem *at91_aic_base;
 
 ?#define at91_aic_read(field) \
- ? ? ? __raw_read(at91_aic_base + field)
+ ? ? ? __raw_readl(at91_aic_base + field)
 
 ?#define at91_aic_write(field, value) \
 ? ? ? ?__raw_writel(value, at91_aic_base + field);
drivers/spi/spi-atmel.c +0 -0
index 79665e2..a691240 100644

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

Quoted 7 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,
+ ? ? ? .probe ? ? ? ? ?= atmel_spi_probe,
 ? ? ? ?.remove ? ? ? ? = __exit_p(atmel_spi_remove),
 ?};
 ?module_platform_driver(atmel_spi_driver);

Jean,

This looks it should be two separate patches, one for the missing probe, one for the raw_read -> raw_readl.

Thanks,
~Deepak

#2 lore raw

PATCH 1/1 atmel/spi: fix missing probe during the switch to module_platform_driver

Quoted 41 lines · Deepak Saxena
Quoted 29 lines · Jean-Christophe PLAGNIOL-VILLARD

in commit 940ab889

Cc Greg Kroah-Hartman <[email protected]>
Cc Grant Likely <[email protected]>
Cc Nicolas Ferre <[email protected]>

---
?arch/arm/mach-at91/include/mach/at91_aic.h | ? ?2 +- ?drivers/spi/spi-atmel.c ? ? ? ? ? ? ? ? ? ?| ? ?1 + ?2 files changed, 2 insertions(+), 1 deletions(-)

arch/arm/mach-at91/include/mach/at91_aic.h +1 -1
index 4b0a57e..f163bb6 100644
@@ -20,7 +20,7 @@
 ?extern void __iomem *at91_aic_base;
 
 ?#define at91_aic_read(field) \
- ? ? ? __raw_read(at91_aic_base + field)
+ ? ? ? __raw_readl(at91_aic_base + field)
 
 ?#define at91_aic_write(field, value) \
 ? ? ? ?__raw_writel(value, at91_aic_base + field);
drivers/spi/spi-atmel.c +0 -0
index 79665e2..a691240 100644

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

Quoted 7 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,
+ ? ? ? .probe ? ? ? ? ?= atmel_spi_probe,
 ? ? ? ?.remove ? ? ? ? = __exit_p(atmel_spi_remove),
 ?};
 ?module_platform_driver(atmel_spi_driver);

Jean,

Quoted 2 lines

This looks it should be two separate patches, one for the missing probe, one for the raw_read -> raw_readl.

Yes I found when I receive the e-mail and already send the v2

Best Regards,
J.

#3 lore raw

PATCH v2 1/1 atmel/spi: fix missing probe during the switch to module_platform_driver

In reply to Jean-Christophe PLAGNIOL-VILLARD

in commit 940ab889

---
v2:

remove local work

Best Regards,
J.

 drivers/spi/spi-atmel.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/spi/spi-atmel.c +1 -0
index 79665e2..a691240 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
#4 lore raw

PATCH v2 1/1 atmel/spi: fix missing probe during the switch to module_platform_driver

Quoted 1 line · Jean-Christophe PLAGNIOL-VILLARD

in commit 940ab889

This kind of commit message is, frankly, utter crap.

With all the complaints that have been on this mailing list about raw commit IDs without saying what the commit was, it completely astounds me that someone in your position (allegedly a co-maintainer of a SoC) would make such an error.

Please generate a much better commit message. Maybe something like:

----
Commit 940ab889 (blah blah blah) 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.

As atmel_spi_probe is marked __init, this will cause a section mismatch error, so ... <fill this in for the point below>
----

And, you're forgetting to fix this properly (maybe you don't care about section mismatch errors - are you going to create another patch for that as well?) Did you even build-test this patch and pay attention to any warnings issued, or were you just pleased to get a zImage at the end?

static int __init atmel_spi_probe(struct platform_device *pdev)

__init is not compatible with having a pointer in the platform driver structure. It needs to be __devinit.

#5 lore raw

PATCH v2 1/1 atmel/spi: fix missing probe during the switch to module_platform_driver

Quoted 27 lines · Russell King - ARM Linux
Quoted 1 line · Jean-Christophe PLAGNIOL-VILLARD

in commit 940ab889

This kind of commit message is, frankly, utter crap.

With all the complaints that have been on this mailing list about raw commit IDs without saying what the commit was, it completely astounds me that someone in your position (allegedly a co-maintainer of a SoC) would make such an error.

Please generate a much better commit message. Maybe something like:

----
Commit 940ab889 (blah blah blah) 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.

As atmel_spi_probe is marked __init, this will cause a section mismatch error, so ... <fill this in for the point below>
----

And, you're forgetting to fix this properly (maybe you don't care about section mismatch errors - are you going to create another patch for that as well?) Did you even build-test this patch and pay attention to any warnings issued, or were you just pleased to get a zImage at the end?

Quoted 4 lines

static int __init atmel_spi_probe(struct platform_device *pdev)

__init is not compatible with having a pointer in the platform driver structure. It needs to be __devinit.

this is an other fix I do not want to fix 2 issue in one commit and I do care of mismatch erros I fix them all the time I send patch for some rm9200 few weeks ago

Best Regards,
J.

#6 lore raw

PATCH v2 1/1 atmel/spi: fix missing probe during the switch to module_platform_driver

Quoted 3 lines · Jean-Christophe PLAGNIOL-VILLARD

this is an other fix I do not want to fix 2 issue in one commit and I do care of mismatch erros I fix them all the time I send patch for some rm9200 few weeks ago

It should not be a separate patch - it's all to do with fixing the original problem.

#7 lore raw

PATCH v2 1/1 atmel/spi: fix missing probe during the switch to module_platform_driver

Quoted 7 lines · Russell King - ARM Linux
Quoted 3 lines · Jean-Christophe PLAGNIOL-VILLARD

this is an other fix I do not want to fix 2 issue in one commit and I do care of mismatch erros I fix them all the time I send patch for some rm9200 few weeks ago

It should not be a separate patch - it's all to do with fixing the original problem.

yes when we was supposed to swtch to module_platform_driver we use the .probe which is suposed to be __devinit in this case but I was prefering to do it in 2 steps

as you wish and I found that the remove is __exit and supposed to be __devexit

Best Regards,
J.

#8 lore raw

PATCH v2 1/1 atmel/spi: fix missing probe during the switch to module_platform_driver

Quoted 6 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 5 lines · Russell King - ARM Linux
Quoted 3 lines · Jean-Christophe PLAGNIOL-VILLARD

this is an other fix I do not want to fix 2 issue in one commit and I do care of mismatch erros I fix them all the time I send patch for some rm9200 few weeks ago

Quoted 6 lines
Quoted 2 lines

It should not be a separate patch - it's all to do with fixing the original problem.

yes when we was supposed to swtch to module_platform_driver we use the .probe which is suposed to be __devinit in this case but I was prefering to do it in 2 steps

Then do the __devinit transformation _first_ so you don't introduce a new bug in the middle of your 'fix'.

But I personally think you're just creating needless churn by splitting this one logical change.