linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] spi: spi-gpio: Make probe function __init_or_module
@ 2019-06-07 15:56 Paul Cercueil
  2019-06-07 15:59 ` Mark Brown
  0 siblings, 1 reply; 5+ messages in thread
From: Paul Cercueil @ 2019-06-07 15:56 UTC (permalink / raw)
  To: Mark Brown; +Cc: od, linux-spi, linux-kernel, Paul Cercueil

This allows the probe function to be dropped after the kernel finished
its initialization, in the case where the driver was not compiled as a
module.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
 drivers/spi/spi-gpio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-gpio.c b/drivers/spi/spi-gpio.c
index eca9d52ecf65..c242c962772d 100644
--- a/drivers/spi/spi-gpio.c
+++ b/drivers/spi/spi-gpio.c
@@ -358,7 +358,7 @@ static void spi_gpio_put(void *data)
 	spi_master_put(data);
 }
 
-static int spi_gpio_probe(struct platform_device *pdev)
+static int __init_or_module spi_gpio_probe(struct platform_device *pdev)
 {
 	int				status;
 	struct spi_master		*master;
-- 
2.21.0.593.g511ec345e18


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] spi: spi-gpio: Make probe function __init_or_module
  2019-06-07 15:56 [PATCH] spi: spi-gpio: Make probe function __init_or_module Paul Cercueil
@ 2019-06-07 15:59 ` Mark Brown
  2019-06-07 16:02   ` Paul Cercueil
  2019-06-24 18:42   ` Enrico Weigelt, metux IT consult
  0 siblings, 2 replies; 5+ messages in thread
From: Mark Brown @ 2019-06-07 15:59 UTC (permalink / raw)
  To: Paul Cercueil; +Cc: od, linux-spi, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 303 bytes --]

On Fri, Jun 07, 2019 at 05:56:31PM +0200, Paul Cercueil wrote:
> This allows the probe function to be dropped after the kernel finished
> its initialization, in the case where the driver was not compiled as a
> module.

Hopefully not since we might probe later on if something registers a new
device...

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] spi: spi-gpio: Make probe function __init_or_module
  2019-06-07 15:59 ` Mark Brown
@ 2019-06-07 16:02   ` Paul Cercueil
  2019-06-07 16:05     ` Mark Brown
  2019-06-24 18:42   ` Enrico Weigelt, metux IT consult
  1 sibling, 1 reply; 5+ messages in thread
From: Paul Cercueil @ 2019-06-07 16:02 UTC (permalink / raw)
  To: Mark Brown; +Cc: od, linux-spi, linux-kernel



Le ven. 7 juin 2019 à 17:59, Mark Brown <broonie@kernel.org> a écrit :
> On Fri, Jun 07, 2019 at 05:56:31PM +0200, Paul Cercueil wrote:
>>  This allows the probe function to be dropped after the kernel 
>> finished
>>  its initialization, in the case where the driver was not compiled 
>> as a
>>  module.
> 
> Hopefully not since we might probe later on if something registers a 
> new
> device...

Makes sense. Sorry for the noise.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] spi: spi-gpio: Make probe function __init_or_module
  2019-06-07 16:02   ` Paul Cercueil
@ 2019-06-07 16:05     ` Mark Brown
  0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2019-06-07 16:05 UTC (permalink / raw)
  To: Paul Cercueil; +Cc: od, linux-spi, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 472 bytes --]

On Fri, Jun 07, 2019 at 06:02:20PM +0200, Paul Cercueil wrote:
> Le ven. 7 juin 2019 à 17:59, Mark Brown <broonie@kernel.org> a écrit :

> > Hopefully not since we might probe later on if something registers a new
> > device...

> Makes sense. Sorry for the noise.

No problem.  There used to be an annotation for probe() and remove()
functions but it got removed since hotplug and deferred probe made it
very difficult to ever practically take advanage of it.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] spi: spi-gpio: Make probe function __init_or_module
  2019-06-07 15:59 ` Mark Brown
  2019-06-07 16:02   ` Paul Cercueil
@ 2019-06-24 18:42   ` Enrico Weigelt, metux IT consult
  1 sibling, 0 replies; 5+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-06-24 18:42 UTC (permalink / raw)
  To: Mark Brown, Paul Cercueil; +Cc: od, linux-spi, linux-kernel

On 07.06.19 17:59, Mark Brown wrote:
> On Fri, Jun 07, 2019 at 05:56:31PM +0200, Paul Cercueil wrote:
>> This allows the probe function to be dropped after the kernel finished
>> its initialization, in the case where the driver was not compiled as a
>> module.
> 
> Hopefully not since we might probe later on if something registers a new
> device...
> 

Common pitfall. Also fallen into this myself and wondered why
it oops'd :o.


--mtx

-- 
Enrico Weigelt, metux IT consult
Free software and Linux embedded engineering
info@metux.net -- +49-151-27565287

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-06-24 18:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-07 15:56 [PATCH] spi: spi-gpio: Make probe function __init_or_module Paul Cercueil
2019-06-07 15:59 ` Mark Brown
2019-06-07 16:02   ` Paul Cercueil
2019-06-07 16:05     ` Mark Brown
2019-06-24 18:42   ` Enrico Weigelt, metux IT consult

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).