Thread (15 messages) 15 messages, 6 authors, 2020-10-23

Re: [PATCH] serial: pmac_zilog: don't init if zilog is not available

From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: 2020-10-22 07:26:19
Also in: linux-m68k, linux-serial, lkml

Hi Finn,

On Thu, Oct 22, 2020 at 5:23 AM Finn Thain [off-list ref] wrote:
The patch below seems to fix the problem for me. Does it work on your
system(s)?
Thanks for your patch!
quoted hunk ↗ jump to hunk
--- a/arch/m68k/mac/config.c
+++ b/arch/m68k/mac/config.c
@@ -776,16 +776,12 @@ static struct resource scc_b_rsrcs[] = {
 struct platform_device scc_a_pdev = {
        .name           = "scc",
        .id             = 0,
-       .num_resources  = ARRAY_SIZE(scc_a_rsrcs),
-       .resource       = scc_a_rsrcs,
 };
 EXPORT_SYMBOL(scc_a_pdev);

 struct platform_device scc_b_pdev = {
        .name           = "scc",
        .id             = 1,
-       .num_resources  = ARRAY_SIZE(scc_b_rsrcs),
-       .resource       = scc_b_rsrcs,
 };
 EXPORT_SYMBOL(scc_b_pdev);
@@ -812,10 +808,15 @@ static void __init mac_identify(void)

        /* Set up serial port resources for the console initcall. */

-       scc_a_rsrcs[0].start = (resource_size_t) mac_bi_data.sccbase + 2;
-       scc_a_rsrcs[0].end   = scc_a_rsrcs[0].start;
-       scc_b_rsrcs[0].start = (resource_size_t) mac_bi_data.sccbase;
-       scc_b_rsrcs[0].end   = scc_b_rsrcs[0].start;
+       scc_a_rsrcs[0].start     = (resource_size_t)mac_bi_data.sccbase + 2;
+       scc_a_rsrcs[0].end       = scc_a_rsrcs[0].start;
+       scc_a_pdev.num_resources = ARRAY_SIZE(scc_a_rsrcs);
+       scc_a_pdev.resource      = scc_a_rsrcs;
+
+       scc_b_rsrcs[0].start     = (resource_size_t)mac_bi_data.sccbase;
+       scc_b_rsrcs[0].end       = scc_b_rsrcs[0].start;
+       scc_b_pdev.num_resources = ARRAY_SIZE(scc_b_rsrcs);
+       scc_b_pdev.resource      = scc_b_rsrcs;
I can't say I'm a fan of this...
quoted hunk ↗ jump to hunk
        switch (macintosh_config->scc_type) {
        case MAC_SCC_PSC:
diff --git a/drivers/tty/serial/pmac_zilog.c b/drivers/tty/serial/pmac_zilog.c
index 96e7aa479961..95abdb305d67 100644
--- a/drivers/tty/serial/pmac_zilog.c
+++ b/drivers/tty/serial/pmac_zilog.c
@@ -1697,18 +1697,17 @@ extern struct platform_device scc_a_pdev, scc_b_pdev;
The real issue is this "extern struct platform_device scc_a_pdev, scc_b_pdev",
circumventing the driver framework.

Can we get rid of that?

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@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