Skip to contentSkip to conversation

iio: adc: sun4i-gpadc-iio: Fix module autoload when PLATFORM devices are registered

PATCH Applied Eduardo Molinas 3 participants 6 messages May 1, 2017 – May 7, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 iio: adc: sun4i-gpadc-iio: Fix module autoload when PLATFORM devices are registered

If the driver is built as a module, it won't be autloaded if the devices are registered via PLATFORM code because the PLATFORM device table entries are not exported as aliases

Before the patch:

$ modinfo drivers/iio/adc/sun4i-gpadc-iio.ko | grep alias
$

After th patch:

$ modinfo drivers/iio/adc/sun4i-gpadc-iio.ko | grep alias
alias:          platform:sun6i-a31-gpadc-iio
alias:          platform:sun5i-a13-gpadc-iio
alias:          platform:sun4i-a10-gpadc-iio

---

---
 drivers/iio/adc/sun4i-gpadc-iio.c | 1 +
 1 file changed, 1 insertion(+)
drivers/iio/adc/sun4i-gpadc-iio.c +1 -0
index b23527309088..c3d7ba100a48 100644
@@ -700,6 +700,7 @@ static const struct platform_device_id sun4i_gpadc_id[] = {
 	{ "sun6i-a31-gpadc-iio", (kernel_ulong_t)&sun6i_gpadc_data },
 	{ /* sentinel */ },
 };
+MODULE_DEVICE_TABLE(platform, sun4i_gpadc_id);
 
 static struct platform_driver sun4i_gpadc_driver = {
 	.driver = {
Signature · 1 line
2.11.0
#1 lore raw

PATCH 2/2 iio: adc: sun4i-gpadc-iio: Fix module autoload when OF devices are registered

If the driver is built as a module, it won't be autloaded if the devices are registered via OF code because the OF device table entries are not exported as aliases

Before the patch:

$ modinfo drivers/iio/adc/sun4i-gpadc-iio.ko | grep alias
alias:          platform:sun6i-a31-gpadc-iio
alias:          platform:sun5i-a13-gpadc-iio
alias:          platform:sun4i-a10-gpadc-iio

After the patch:

$ modinfo drivers/iio/adc/sun4i-gpadc-iio.ko | grep alias
alias:          of:N*T*Callwinner,sun8i-a33-thsC*
alias:          of:N*T*Callwinner,sun8i-a33-ths
alias:          platform:sun6i-a31-gpadc-iio
alias:          platform:sun5i-a13-gpadc-iio
alias:          platform:sun4i-a10-gpadc-iio

---

---
 drivers/iio/adc/sun4i-gpadc-iio.c | 1 +
 1 file changed, 1 insertion(+)
drivers/iio/adc/sun4i-gpadc-iio.c +1 -0
index c3d7ba100a48..1c83b45043bf 100644
@@ -712,6 +712,7 @@ static struct platform_driver sun4i_gpadc_driver = {
 	.probe = sun4i_gpadc_probe,
 	.remove = sun4i_gpadc_remove,
 };
+MODULE_DEVICE_TABLE(of, sun4i_gpadc_of_id);
 
 module_platform_driver(sun4i_gpadc_driver);
 
Signature · 1 line
2.11.0
Acked-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] [PATCH 2/2] iio: adc: sun4i-gpadc-iio: Fix module autoload when OF devices are registered

Quoted 11 lines · Eduardo Molinas

If the driver is built as a module, it won't be autloaded if the devices are registered via OF code because the OF device table entries are not exported as aliases

Before the patch:

$ modinfo drivers/iio/adc/sun4i-gpadc-iio.ko | grep alias
alias:          platform:sun6i-a31-gpadc-iio
alias:          platform:sun5i-a13-gpadc-iio
alias:          platform:sun4i-a10-gpadc-iio

After the patch:

Quoted 8 lines
$ modinfo drivers/iio/adc/sun4i-gpadc-iio.ko | grep alias
alias:          of:N*T*Callwinner,sun8i-a33-thsC*
alias:          of:N*T*Callwinner,sun8i-a33-ths
alias:          platform:sun6i-a31-gpadc-iio
alias:          platform:sun5i-a13-gpadc-iio
alias:          platform:sun4i-a10-gpadc-iio

Can we merge this as a fix for 4.12?

Acked-by on v1 1/2
#4 lore raw
In reply to Eduardo Molinas
Quoted 9 lines · Eduardo Molinas

If the driver is built as a module, it won't be autloaded if the devices are registered via PLATFORM code because the PLATFORM device table entries are not exported as aliases

Before the patch:

$ modinfo drivers/iio/adc/sun4i-gpadc-iio.ko | grep alias
$

After th patch:

        ^^ the
Quoted 6 lines
$ modinfo drivers/iio/adc/sun4i-gpadc-iio.ko | grep alias
alias:          platform:sun6i-a31-gpadc-iio
alias:          platform:sun5i-a13-gpadc-iio
alias:          platform:sun4i-a10-gpadc-iio

Can we merge this as a fix for 4.12?

maintainer Applied
#5 lore raw
Quoted 18 lines · Chen-Yu Tsai
Quoted 9 lines · Eduardo Molinas

If the driver is built as a module, it won't be autloaded if the devices are registered via PLATFORM code because the PLATFORM device table entries are not exported as aliases

Before the patch:

$ modinfo drivers/iio/adc/sun4i-gpadc-iio.ko | grep alias
$

After th patch:

        ^^ the
Quoted 5 lines
$ modinfo drivers/iio/adc/sun4i-gpadc-iio.ko | grep alias
alias:          platform:sun6i-a31-gpadc-iio
alias:          platform:sun5i-a13-gpadc-iio
alias:          platform:sun4i-a10-gpadc-iio
Quoted 5 lines
Quoted 1 line

Can we merge this as a fix for 4.12?

Applied to fixes-togreg branch of iio.git.

Thanks,

Jonathan

Quoted 1 line
maintainer Applied
#3 lore raw

Re: [PATCH 2/2] [PATCH 2/2] iio: adc: sun4i-gpadc-iio: Fix module autoload when OF devices are registered

In reply to Chen-Yu Tsai
Quoted 19 lines · Chen-Yu Tsai
Quoted 18 lines · Eduardo Molinas

If the driver is built as a module, it won't be autloaded if the devices are registered via OF code because the OF device table entries are not exported as aliases

Before the patch:

$ modinfo drivers/iio/adc/sun4i-gpadc-iio.ko | grep alias
alias:          platform:sun6i-a31-gpadc-iio
alias:          platform:sun5i-a13-gpadc-iio
alias:          platform:sun4i-a10-gpadc-iio

After the patch:

$ modinfo drivers/iio/adc/sun4i-gpadc-iio.ko | grep alias
alias:          of:N*T*Callwinner,sun8i-a33-thsC*
alias:          of:N*T*Callwinner,sun8i-a33-ths
alias:          platform:sun6i-a31-gpadc-iio
alias:          platform:sun5i-a13-gpadc-iio
alias:          platform:sun4i-a10-gpadc-iio
Quoted 5 lines
Quoted 1 line

Can we merge this as a fix for 4.12?

Applied to the fixes-togreg branch of iio.git.

Thanks,

Jonathan

Quoted 5 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html