* [PATCH] bus: imx-weim: Fix deferred probing
@ 2015-10-18 20:13 Heiner Kallweit
2015-11-23 5:09 ` Shawn Guo
0 siblings, 1 reply; 3+ messages in thread
From: Heiner Kallweit @ 2015-10-18 20:13 UTC (permalink / raw)
To: linux-arm-kernel
With CONFIG_DELAY_DEVICE_PROBES being set the weim driver
isn't loadad because module_platform_driver_probe is
incompatible with deferred probing.
Fix this by using builtin_platform_driver instead.
Going with deferred probing also means we have to drop
the __init annotations.
Successfully tested on a I.MX6-based system.
I send the patch to linux-arm-kernel as the kernel MAINTAINERS
file doesn't list a dedicated maintainer.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
drivers/bus/imx-weim.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/bus/imx-weim.c b/drivers/bus/imx-weim.c
index e98d15e..7c425d3 100644
--- a/drivers/bus/imx-weim.c
+++ b/drivers/bus/imx-weim.c
@@ -59,7 +59,7 @@ static const struct of_device_id weim_id_table[] = {
};
MODULE_DEVICE_TABLE(of, weim_id_table);
-static int __init imx_weim_gpr_setup(struct platform_device *pdev)
+static int imx_weim_gpr_setup(struct platform_device *pdev)
{
struct device_node *np = pdev->dev.of_node;
struct property *prop;
@@ -109,7 +109,7 @@ err:
}
/* Parse and set the timing for this device. */
-static int __init weim_timing_setup(struct device_node *np, void __iomem *base,
+static int weim_timing_setup(struct device_node *np, void __iomem *base,
const struct imx_weim_devtype *devtype)
{
u32 cs_idx, value[devtype->cs_regs_count];
@@ -135,7 +135,7 @@ static int __init weim_timing_setup(struct device_node *np, void __iomem *base,
return 0;
}
-static int __init weim_parse_dt(struct platform_device *pdev,
+static int weim_parse_dt(struct platform_device *pdev,
void __iomem *base)
{
const struct of_device_id *of_id = of_match_device(weim_id_table,
@@ -172,7 +172,7 @@ static int __init weim_parse_dt(struct platform_device *pdev,
return ret;
}
-static int __init weim_probe(struct platform_device *pdev)
+static int weim_probe(struct platform_device *pdev)
{
struct resource *res;
struct clk *clk;
@@ -209,8 +209,9 @@ static struct platform_driver weim_driver = {
.name = "imx-weim",
.of_match_table = weim_id_table,
},
+ .probe = weim_probe,
};
-module_platform_driver_probe(weim_driver, weim_probe);
+builtin_platform_driver(weim_driver);
MODULE_AUTHOR("Freescale Semiconductor Inc.");
MODULE_DESCRIPTION("i.MX EIM Controller Driver");
--
2.6.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] bus: imx-weim: Fix deferred probing
2015-10-18 20:13 [PATCH] bus: imx-weim: Fix deferred probing Heiner Kallweit
@ 2015-11-23 5:09 ` Shawn Guo
2015-11-23 6:41 ` Heiner Kallweit
0 siblings, 1 reply; 3+ messages in thread
From: Shawn Guo @ 2015-11-23 5:09 UTC (permalink / raw)
To: linux-arm-kernel
On Sun, Oct 18, 2015 at 10:13:28PM +0200, Heiner Kallweit wrote:
> With CONFIG_DELAY_DEVICE_PROBES being set the weim driver
> isn't loadad because module_platform_driver_probe is
> incompatible with deferred probing.
It seems that DELAY_DEVICE_PROBES did not make its way to mainline?
Shawn
>
> Fix this by using builtin_platform_driver instead.
> Going with deferred probing also means we have to drop
> the __init annotations.
>
> Successfully tested on a I.MX6-based system.
>
> I send the patch to linux-arm-kernel as the kernel MAINTAINERS
> file doesn't list a dedicated maintainer.
>
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> ---
> drivers/bus/imx-weim.c | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/bus/imx-weim.c b/drivers/bus/imx-weim.c
> index e98d15e..7c425d3 100644
> --- a/drivers/bus/imx-weim.c
> +++ b/drivers/bus/imx-weim.c
> @@ -59,7 +59,7 @@ static const struct of_device_id weim_id_table[] = {
> };
> MODULE_DEVICE_TABLE(of, weim_id_table);
>
> -static int __init imx_weim_gpr_setup(struct platform_device *pdev)
> +static int imx_weim_gpr_setup(struct platform_device *pdev)
> {
> struct device_node *np = pdev->dev.of_node;
> struct property *prop;
> @@ -109,7 +109,7 @@ err:
> }
>
> /* Parse and set the timing for this device. */
> -static int __init weim_timing_setup(struct device_node *np, void __iomem *base,
> +static int weim_timing_setup(struct device_node *np, void __iomem *base,
> const struct imx_weim_devtype *devtype)
> {
> u32 cs_idx, value[devtype->cs_regs_count];
> @@ -135,7 +135,7 @@ static int __init weim_timing_setup(struct device_node *np, void __iomem *base,
> return 0;
> }
>
> -static int __init weim_parse_dt(struct platform_device *pdev,
> +static int weim_parse_dt(struct platform_device *pdev,
> void __iomem *base)
> {
> const struct of_device_id *of_id = of_match_device(weim_id_table,
> @@ -172,7 +172,7 @@ static int __init weim_parse_dt(struct platform_device *pdev,
> return ret;
> }
>
> -static int __init weim_probe(struct platform_device *pdev)
> +static int weim_probe(struct platform_device *pdev)
> {
> struct resource *res;
> struct clk *clk;
> @@ -209,8 +209,9 @@ static struct platform_driver weim_driver = {
> .name = "imx-weim",
> .of_match_table = weim_id_table,
> },
> + .probe = weim_probe,
> };
> -module_platform_driver_probe(weim_driver, weim_probe);
> +builtin_platform_driver(weim_driver);
>
> MODULE_AUTHOR("Freescale Semiconductor Inc.");
> MODULE_DESCRIPTION("i.MX EIM Controller Driver");
> --
> 2.6.1
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] bus: imx-weim: Fix deferred probing
2015-11-23 5:09 ` Shawn Guo
@ 2015-11-23 6:41 ` Heiner Kallweit
0 siblings, 0 replies; 3+ messages in thread
From: Heiner Kallweit @ 2015-11-23 6:41 UTC (permalink / raw)
To: linux-arm-kernel
Am 23.11.2015 um 06:09 schrieb Shawn Guo:
> On Sun, Oct 18, 2015 at 10:13:28PM +0200, Heiner Kallweit wrote:
>> With CONFIG_DELAY_DEVICE_PROBES being set the weim driver
>> isn't loadad because module_platform_driver_probe is
>> incompatible with deferred probing.
>
> It seems that DELAY_DEVICE_PROBES did not make its way to mainline?
>
Yes, seems like it broke quite a lot of systems and I found some
discussions where Greg KH expressed his wish to have it removed again.
The patch therefore isn't needed.
Heiner
> Shawn
>
>>
>> Fix this by using builtin_platform_driver instead.
>> Going with deferred probing also means we have to drop
>> the __init annotations.
>>
>> Successfully tested on a I.MX6-based system.
>>
>> I send the patch to linux-arm-kernel as the kernel MAINTAINERS
>> file doesn't list a dedicated maintainer.
>>
>> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
>> ---
>> drivers/bus/imx-weim.c | 11 ++++++-----
>> 1 file changed, 6 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/bus/imx-weim.c b/drivers/bus/imx-weim.c
>> index e98d15e..7c425d3 100644
>> --- a/drivers/bus/imx-weim.c
>> +++ b/drivers/bus/imx-weim.c
>> @@ -59,7 +59,7 @@ static const struct of_device_id weim_id_table[] = {
>> };
>> MODULE_DEVICE_TABLE(of, weim_id_table);
>>
>> -static int __init imx_weim_gpr_setup(struct platform_device *pdev)
>> +static int imx_weim_gpr_setup(struct platform_device *pdev)
>> {
>> struct device_node *np = pdev->dev.of_node;
>> struct property *prop;
>> @@ -109,7 +109,7 @@ err:
>> }
>>
>> /* Parse and set the timing for this device. */
>> -static int __init weim_timing_setup(struct device_node *np, void __iomem *base,
>> +static int weim_timing_setup(struct device_node *np, void __iomem *base,
>> const struct imx_weim_devtype *devtype)
>> {
>> u32 cs_idx, value[devtype->cs_regs_count];
>> @@ -135,7 +135,7 @@ static int __init weim_timing_setup(struct device_node *np, void __iomem *base,
>> return 0;
>> }
>>
>> -static int __init weim_parse_dt(struct platform_device *pdev,
>> +static int weim_parse_dt(struct platform_device *pdev,
>> void __iomem *base)
>> {
>> const struct of_device_id *of_id = of_match_device(weim_id_table,
>> @@ -172,7 +172,7 @@ static int __init weim_parse_dt(struct platform_device *pdev,
>> return ret;
>> }
>>
>> -static int __init weim_probe(struct platform_device *pdev)
>> +static int weim_probe(struct platform_device *pdev)
>> {
>> struct resource *res;
>> struct clk *clk;
>> @@ -209,8 +209,9 @@ static struct platform_driver weim_driver = {
>> .name = "imx-weim",
>> .of_match_table = weim_id_table,
>> },
>> + .probe = weim_probe,
>> };
>> -module_platform_driver_probe(weim_driver, weim_probe);
>> +builtin_platform_driver(weim_driver);
>>
>> MODULE_AUTHOR("Freescale Semiconductor Inc.");
>> MODULE_DESCRIPTION("i.MX EIM Controller Driver");
>> --
>> 2.6.1
>>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-11-23 6:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-18 20:13 [PATCH] bus: imx-weim: Fix deferred probing Heiner Kallweit
2015-11-23 5:09 ` Shawn Guo
2015-11-23 6:41 ` Heiner Kallweit
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).