Skip to contentSkip to conversation

i2c_gpio: keep probe resident for hotplugged devices.

PATCH In review Ben Dooks 3 participants 6 messages Jul 2, 2008 – Jul 15, 2008 6 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Ben Dooks

author
#1 lore raw

PATCH 1/1 i2c_gpio: keep probe resident for hotplugged devices.

Change the i2c_gpio driver to use platform_driver_register() instead of platform_driver_probe() to ensure that is can attach to any devices that may be loaded after it has initialised.

Cc Haavard Skinnemoen <[email protected]>
drivers/i2c/busses/i2c-gpio.c +5 -4
Index: linux-2.6.26-rc8-quilt3/drivers/i2c/busses/i2c-gpio.c
===================================================================
@@ -77,7 +77,7 @@ static int i2c_gpio_getscl(void *data)
 	return gpio_get_value(pdata->scl_pin);
 }
 
-static int __init i2c_gpio_probe(struct platform_device *pdev)
+static int __devinit i2c_gpio_probe(struct platform_device *pdev)
 {
 	struct i2c_gpio_platform_data *pdata;
 	struct i2c_algo_bit_data *bit_data;
@@ -174,7 +174,7 @@ err_alloc_adap:
 	return ret;
 }
 
-static int __exit i2c_gpio_remove(struct platform_device *pdev)
+static int __devexit i2c_gpio_remove(struct platform_device *pdev)
 {
 	struct i2c_gpio_platform_data *pdata;
 	struct i2c_adapter *adap;
@@ -196,14 +196,15 @@ static struct platform_driver i2c_gpio_d
 		.name	= "i2c-gpio",
 		.owner	= THIS_MODULE,
 	},
-	.remove		= __exit_p(i2c_gpio_remove),
+	.probe		= i2c_gpio_probe,
+	.remove		= __devexit_p(i2c_gpio_remove),
 };
 
 static int __init i2c_gpio_init(void)
 {
 	int ret;
 
-	ret = platform_driver_probe(&i2c_gpio_driver, i2c_gpio_probe);
+	ret = platform_driver_register(&i2c_gpio_driver);
 	if (ret)
 		printk(KERN_ERR "i2c-gpio: probe failed: %d\n", ret);
 
Signature · 4 lines
_______________________________________________
i2c mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/i2c

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): 20080702124406.2f3d1384-+1Ci8juu1zowFJ3MlZkdtq14KzY7BuZjUIXZgC+OUhs@public.gmane.org

author
#5 lore raw
Quoted 6 lines · Haavard Skinnemoen
Quoted 3 lines · Ben Dooks

Change the i2c_gpio driver to use platform_driver_register() instead of platform_driver_probe() to ensure that is can attach to any devices that may be loaded after it has initialised.

Does anyone actually do that?

At the moment our standard kernel configuration only builds in the SM501 which will work without this patch on.

However, we have clients that do build module kernels and I would like to replace i2c-simtec.c with the gpio driver and if the relevant module instantiating the gpio support is loaded post kernel init, then we will need to do this.

Signature · 8 lines
Ben ([email protected], http://www.fluff.org/)

  'a smiley only costs 4 bytes'

_______________________________________________
i2c mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/i2c

A message that is not in the archive (sent off-list or not yet received): [email protected]

#7 lore raw

Ben,

Quoted 12 lines · Ben Dooks
Quoted 6 lines · Haavard Skinnemoen
Quoted 3 lines · Ben Dooks

Change the i2c_gpio driver to use platform_driver_register() instead of platform_driver_probe() to ensure that is can attach to any devices that may be loaded after it has initialised.

Does anyone actually do that?

At the moment our standard kernel configuration only builds in the SM501 which will work without this patch on.

Quoted 5 lines

However, we have clients that do build module kernels and I would like to replace i2c-simtec.c with the gpio driver and if the relevant module instantiating the gpio support is loaded post kernel init, then we will need to do this.

Should I take this patch in my i2c tree, or will you take it in yours?

Signature · 6 lines
Jean Delvare

_______________________________________________
i2c mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/i2c

A message that is not in the archive (sent off-list or not yet received): [email protected]

author
#9 lore raw
Quoted 15 lines · Jean Delvare

Ben,

Quoted 12 lines · Ben Dooks
Quoted 6 lines · Haavard Skinnemoen
Quoted 3 lines · Ben Dooks

Change the i2c_gpio driver to use platform_driver_register() instead of platform_driver_probe() to ensure that is can attach to any devices that may be loaded after it has initialised.

Does anyone actually do that?

At the moment our standard kernel configuration only builds in the SM501 which will work without this patch on.

Quoted 7 lines
Quoted 5 lines

However, we have clients that do build module kernels and I would like to replace i2c-simtec.c with the gpio driver and if the relevant module instantiating the gpio support is loaded post kernel init, then we will need to do this.

Should I take this patch in my i2c tree, or will you take it in yours?

I'll take it, I was just waiting to see if there where any more objections from Haavard before applying this.

If i've not received an objection by 0900GMT 2008-07-16 then I will add it to my rather small git tree and ask linus to pull.

Signature · 8 lines
Ben ([email protected], http://www.fluff.org/)

  'a smiley only costs 4 bytes'

_______________________________________________
i2c mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/i2c

A message that is not in the archive (sent off-list or not yet received): [email protected]

#11 lore raw
Quoted 7 lines · On Tue, 15 Jul 2008 10:41:47 +0100 Ben Dooks…

I'll take it, I was just waiting to see if there where any more objections from Haavard before applying this.

If i've not received an objection by 0900GMT 2008-07-16 then I will add it to my rather small git tree and ask linus to pull.

Ok, you won't receive any, so feel free to do that right away :-)

I was just curious about the reason why you need to support hotplugging, and a bit slow to respond since I'm mostly offline these days.

Haavard

_______________________________________________
i2c mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/i2c