i2c: i2c_gpio: keep probe resident for hotplugged devices.

Previous thread: i2c: Documentation: upgrading clients HOWTO by Linux Kernel Mailing List on Monday, July 28, 2008 - 9:59 am. (1 message)

Next thread: i2c: S3C2410: Pass the I2C bus number via drivers platform data by Linux Kernel Mailing List on Monday, July 28, 2008 - 9:59 am. (1 message)
From: Linux Kernel Mailing List
Date: Monday, July 28, 2008 - 9:59 am

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1efe7c...
Commit:     1efe7c55d2c4acc6c1d1c1a68bd9070f13815272
Parent:     399dee2371787825a1845de87c0cbee7b7c30ad6
Author:     Ben Dooks <ben-linux@fluff.org>
AuthorDate: Mon Jul 28 12:04:09 2008 +0100
Committer:  Ben Dooks <ben-linux@fluff.org>
CommitDate: Mon Jul 28 12:40:44 2008 +0100

    i2c: 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.
    
    Acked-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
    Signed-off-by: Ben Dooks <ben-linux@fluff.org>
---
 drivers/i2c/busses/i2c-gpio.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/i2c/busses/i2c-gpio.c b/drivers/i2c/busses/i2c-gpio.c
index 79b455a..32104ea 100644
--- a/drivers/i2c/busses/i2c-gpio.c
+++ b/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_driver = {
 		.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 = ...
Previous thread: i2c: Documentation: upgrading clients HOWTO by Linux Kernel Mailing List on Monday, July 28, 2008 - 9:59 am. (1 message)

Next thread: i2c: S3C2410: Pass the I2C bus number via drivers platform data by Linux Kernel Mailing List on Monday, July 28, 2008 - 9:59 am. (1 message)