Thread (6 messages) 6 messages, 2 authors, 2018-05-02

[PATCH v2 2/3] platform: move the early platform device support to arch/sh

From: geert@linux-m68k.org (Geert Uytterhoeven)
Date: 2018-05-02 21:01:36
Also in: linux-serial, linux-sh, lkml

Hi Bartosz,

On Wed, May 2, 2018 at 11:48 AM, Bartosz Golaszewski [off-list ref] wrote:
From: Bartosz Golaszewski <redacted>

SuperH is the only user of the current implementation of early platform
device support. We want to introduce a more robust approach to early
probing. As the first step - move all the current early platform code
to arch/sh.

In order not to export internal drivers/base functions to arch code for
this temporary solution - copy the two needed routines for driver
matching from drivers/base/platform.c to arch/sh/drivers/platform_early.c.

Also: call early_platform_cleanup() from subsys_initcall() so that it's
called after all early devices are probed.

Signed-off-by: Bartosz Golaszewski <redacted>
Thanks for your patch!
quoted hunk ↗ jump to hunk
--- a/drivers/clocksource/sh_cmt.c
+++ b/drivers/clocksource/sh_cmt.c
quoted hunk ↗ jump to hunk
@@ -1043,10 +1047,12 @@ static int sh_cmt_probe(struct platform_device *pdev)
        struct sh_cmt_device *cmt = platform_get_drvdata(pdev);
        int ret;

+#ifdef CONFIG_SUPERH
        if (!is_early_platform_device(pdev)) {
                pm_runtime_set_active(&pdev->dev);
                pm_runtime_enable(&pdev->dev);
        }
+#endif
I think the above is not correct: on ARM/ARM64, is_early_platform_device()
used to return false, so the pm_runtime_*() functions must be called.

Perhaps you should keep a dummy is_early_platform_device(), always
returning false on !SUPERH? That would reduce the number of #ifdefs you
have to add, too.
quoted hunk ↗ jump to hunk
--- a/drivers/clocksource/sh_mtu2.c
+++ b/drivers/clocksource/sh_mtu2.c
@@ -450,10 +454,12 @@ static int sh_mtu2_probe(struct platform_device *pdev)
        struct sh_mtu2_device *mtu = platform_get_drvdata(pdev);
        int ret;

+#ifdef CONFIG_SUPERH
        if (!is_early_platform_device(pdev)) {
                pm_runtime_set_active(&pdev->dev);
                pm_runtime_enable(&pdev->dev);
        }
+#endif
Likewise.
quoted hunk ↗ jump to hunk
--- a/drivers/clocksource/sh_tmu.c
+++ b/drivers/clocksource/sh_tmu.c
@@ -606,10 +610,12 @@ static int sh_tmu_probe(struct platform_device *pdev)
        struct sh_tmu_device *tmu = platform_get_drvdata(pdev);
        int ret;

+#ifdef CONFIG_SUPERH
        if (!is_early_platform_device(pdev)) {
                pm_runtime_set_active(&pdev->dev);
                pm_runtime_enable(&pdev->dev);
        }
+#endif
Likewise.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help