* [patch 1/1] i2c_gpio: keep probe resident for hotplugged devices.
[not found] <20080625145943.941439236@fluff.org>
@ 2008-06-25 14:59 ` Ben Dooks
[not found] ` <20080625145944.012741187-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>
0 siblings, 1 reply; 8+ messages in thread
From: Ben Dooks @ 2008-06-25 14:59 UTC (permalink / raw)
To: i2c-GZX6beZjE8VD60Wz+7aTrA; +Cc: Ben Dooks
[-- Attachment #1: simtec/simtec-drivers-i2c-gpio-fixprobe.patch --]
[-- Type: text/plain, Size: 1385 bytes --]
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.
Signed-off-by: Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>
--- linux-2.6.26-rc5-quilt1.orig/drivers/i2c/busses/i2c-gpio.c 2008-06-11 00:17:08.000000000 +0100
+++ linux-2.6.26-rc5-quilt1/drivers/i2c/busses/i2c-gpio.c 2008-06-11 00:18:00.000000000 +0100
@@ -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;
@@ -196,6 +196,7 @@ static struct platform_driver i2c_gpio_d
.name = "i2c-gpio",
.owner = THIS_MODULE,
},
+ .probe = i2c_gpio_probe,
.remove = __exit_p(i2c_gpio_remove),
};
@@ -203,7 +204,7 @@ 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);
--
_______________________________________________
i2c mailing list
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [patch 1/1] i2c_gpio: keep probe resident for hotplugged devices.
[not found] ` <20080625145944.012741187-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>
@ 2008-06-28 9:40 ` Jean Delvare
0 siblings, 0 replies; 8+ messages in thread
From: Jean Delvare @ 2008-06-28 9:40 UTC (permalink / raw)
To: Ben Dooks; +Cc: i2c-GZX6beZjE8VD60Wz+7aTrA
Hi Ben,
On Wed, 25 Jun 2008 15:59:44 +0100, Ben Dooks wrote:
> 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.
>
> Signed-off-by: Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>
>
> --- linux-2.6.26-rc5-quilt1.orig/drivers/i2c/busses/i2c-gpio.c 2008-06-11 00:17:08.000000000 +0100
> +++ linux-2.6.26-rc5-quilt1/drivers/i2c/busses/i2c-gpio.c 2008-06-11 00:18:00.000000000 +0100
> @@ -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;
> @@ -196,6 +196,7 @@ static struct platform_driver i2c_gpio_d
> .name = "i2c-gpio",
> .owner = THIS_MODULE,
> },
> + .probe = i2c_gpio_probe,
> .remove = __exit_p(i2c_gpio_remove),
> };
>
> @@ -203,7 +204,7 @@ 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);
>
>
This patch looks incomplete to me. If the device can be hot-plugged, I
guess it can be hot-unplugged as well? Then i2c_gpio_remove should be
__devexit, not __exit.
Thanks,
--
Jean Delvare
_______________________________________________
i2c mailing list
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c
^ permalink raw reply [flat|nested] 8+ messages in thread
* [patch 1/1] i2c_gpio: keep probe resident for hotplugged devices.
[not found] <20080702101611.757880819@fluff.org>
@ 2008-07-02 10:16 ` Ben Dooks
[not found] ` <20080702101611.858837181-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>
0 siblings, 1 reply; 8+ messages in thread
From: Ben Dooks @ 2008-07-02 10:16 UTC (permalink / raw)
To: i2c-GZX6beZjE8VD60Wz+7aTrA; +Cc: Ben Dooks, Haavard Skinnemoen
[-- Attachment #1: simtec/simtec-drivers-i2c-gpio-fixprobe.patch --]
[-- Type: text/plain, Size: 1876 bytes --]
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 <hskinnemoen-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>
Index: linux-2.6.26-rc8-quilt3/drivers/i2c/busses/i2c-gpio.c
===================================================================
--- linux-2.6.26-rc8-quilt3.orig/drivers/i2c/busses/i2c-gpio.c 2008-06-25 09:46:48.000000000 +0100
+++ linux-2.6.26-rc8-quilt3/drivers/i2c/busses/i2c-gpio.c 2008-07-02 11:12:05.000000000 +0100
@@ -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);
--
_______________________________________________
i2c mailing list
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [patch 1/1] i2c_gpio: keep probe resident for hotplugged devices.
[not found] ` <20080702101611.858837181-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>
@ 2008-07-02 10:44 ` Haavard Skinnemoen
[not found] ` <20080702124406.2f3d1384-+1Ci8juu1zowFJ3MlZkdtq14KzY7BuZjUIXZgC+OUhs@public.gmane.org>
0 siblings, 1 reply; 8+ messages in thread
From: Haavard Skinnemoen @ 2008-07-02 10:44 UTC (permalink / raw)
Cc: Dooks, Ben-cy1Wll9GaHOsTnJN9+BGXg, i2c-GZX6beZjE8VD60Wz+7aTrA,
Haavard Skinnemoen
Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org> wrote:
> 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?
Haavard
_______________________________________________
i2c mailing list
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [patch 1/1] i2c_gpio: keep probe resident for hotplugged devices.
[not found] ` <20080702124406.2f3d1384-+1Ci8juu1zowFJ3MlZkdtq14KzY7BuZjUIXZgC+OUhs@public.gmane.org>
@ 2008-07-10 13:29 ` Ben Dooks
[not found] ` <20080710132917.GF30539-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org>
0 siblings, 1 reply; 8+ messages in thread
From: Ben Dooks @ 2008-07-10 13:29 UTC (permalink / raw)
To: Haavard Skinnemoen
Cc: Haavard Skinnemoen, Ben-cy1Wll9GaHOsTnJN9+BGXg, Ben Dooks,
i2c-GZX6beZjE8VD60Wz+7aTrA
On Wed, Jul 02, 2008 at 12:44:06PM +0200, Haavard Skinnemoen wrote:
> Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org> wrote:
> > 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.
--
Ben (ben-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org, http://www.fluff.org/)
'a smiley only costs 4 bytes'
_______________________________________________
i2c mailing list
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [patch 1/1] i2c_gpio: keep probe resident for hotplugged devices.
[not found] ` <20080710132917.GF30539-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org>
@ 2008-07-12 7:06 ` Jean Delvare
[not found] ` <20080712090600.680f3c2e-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
0 siblings, 1 reply; 8+ messages in thread
From: Jean Delvare @ 2008-07-12 7:06 UTC (permalink / raw)
To: Ben Dooks; +Cc: Haavard Skinnemoen, i2c-GZX6beZjE8VD60Wz+7aTrA
Ben,
On Thu, 10 Jul 2008 14:29:17 +0100, Ben Dooks wrote:
> On Wed, Jul 02, 2008 at 12:44:06PM +0200, Haavard Skinnemoen wrote:
> > Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org> wrote:
> > > 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.
Should I take this patch in my i2c tree, or will you take it in yours?
--
Jean Delvare
_______________________________________________
i2c mailing list
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [patch 1/1] i2c_gpio: keep probe resident for hotplugged devices.
[not found] ` <20080712090600.680f3c2e-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
@ 2008-07-15 9:41 ` Ben Dooks
[not found] ` <20080715094147.GI30539-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org>
0 siblings, 1 reply; 8+ messages in thread
From: Ben Dooks @ 2008-07-15 9:41 UTC (permalink / raw)
To: Jean Delvare; +Cc: Haavard Skinnemoen, i2c-GZX6beZjE8VD60Wz+7aTrA, Ben Dooks
On Sat, Jul 12, 2008 at 09:06:00AM +0200, Jean Delvare wrote:
> Ben,
>
> On Thu, 10 Jul 2008 14:29:17 +0100, Ben Dooks wrote:
> > On Wed, Jul 02, 2008 at 12:44:06PM +0200, Haavard Skinnemoen wrote:
> > > Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org> wrote:
> > > > 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.
>
> 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.
--
Ben (ben-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org, http://www.fluff.org/)
'a smiley only costs 4 bytes'
_______________________________________________
i2c mailing list
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [patch 1/1] i2c_gpio: keep probe resident for hotplugged devices.
[not found] ` <20080715094147.GI30539-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org>
@ 2008-07-15 11:36 ` Haavard Skinnemoen
0 siblings, 0 replies; 8+ messages in thread
From: Haavard Skinnemoen @ 2008-07-15 11:36 UTC (permalink / raw)
Cc: i2c-GZX6beZjE8VD60Wz+7aTrA, Ben Dooks
On Tue, 15 Jul 2008 10:41:47 +0100
Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org> wrote:
> 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
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2008-07-15 11:36 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20080625145943.941439236@fluff.org>
2008-06-25 14:59 ` [patch 1/1] i2c_gpio: keep probe resident for hotplugged devices Ben Dooks
[not found] ` <20080625145944.012741187-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>
2008-06-28 9:40 ` Jean Delvare
[not found] <20080702101611.757880819@fluff.org>
2008-07-02 10:16 ` Ben Dooks
[not found] ` <20080702101611.858837181-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>
2008-07-02 10:44 ` Haavard Skinnemoen
[not found] ` <20080702124406.2f3d1384-+1Ci8juu1zowFJ3MlZkdtq14KzY7BuZjUIXZgC+OUhs@public.gmane.org>
2008-07-10 13:29 ` Ben Dooks
[not found] ` <20080710132917.GF30539-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org>
2008-07-12 7:06 ` Jean Delvare
[not found] ` <20080712090600.680f3c2e-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-07-15 9:41 ` Ben Dooks
[not found] ` <20080715094147.GI30539-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org>
2008-07-15 11:36 ` Haavard Skinnemoen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox