Commit 1efe7c55 authored by Ben Dooks's avatar Ben Dooks

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: default avatarHaavard Skinnemoen <haavard.skinnemoen@atmel.com>
Signed-off-by: default avatarBen Dooks <ben-linux@fluff.org>
parent 399dee23
...@@ -77,7 +77,7 @@ static int i2c_gpio_getscl(void *data) ...@@ -77,7 +77,7 @@ static int i2c_gpio_getscl(void *data)
return gpio_get_value(pdata->scl_pin); 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_gpio_platform_data *pdata;
struct i2c_algo_bit_data *bit_data; struct i2c_algo_bit_data *bit_data;
...@@ -174,7 +174,7 @@ err_alloc_adap: ...@@ -174,7 +174,7 @@ err_alloc_adap:
return ret; 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_gpio_platform_data *pdata;
struct i2c_adapter *adap; struct i2c_adapter *adap;
...@@ -196,14 +196,15 @@ static struct platform_driver i2c_gpio_driver = { ...@@ -196,14 +196,15 @@ static struct platform_driver i2c_gpio_driver = {
.name = "i2c-gpio", .name = "i2c-gpio",
.owner = THIS_MODULE, .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) static int __init i2c_gpio_init(void)
{ {
int ret; int ret;
ret = platform_driver_probe(&i2c_gpio_driver, i2c_gpio_probe); ret = platform_driver_register(&i2c_gpio_driver);
if (ret) if (ret)
printk(KERN_ERR "i2c-gpio: probe failed: %d\n", ret); printk(KERN_ERR "i2c-gpio: probe failed: %d\n", ret);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment