Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/thorpej-cfargs]: src/sys/dev/gpio No need to pass the parent softc down ...



details:   https://anonhg.NetBSD.org/src/rev/7f99d8d85c57
branches:  thorpej-cfargs
changeset: 953789:7f99d8d85c57
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sat Mar 20 20:47:53 2021 +0000

description:
No need to pass the parent softc down to the indirect submatch routine;
it's available from the parent device_t there.

diffstat:

 sys/arch/arm/xscale/pxa2x0.c |  8 ++++----
 sys/arch/zaurus/dev/zssp.c   |  6 +++---
 sys/dev/gpio/gpio.c          |  8 ++++----
 3 files changed, 11 insertions(+), 11 deletions(-)

diffs (99 lines):

diff -r 49802eedf961 -r 7f99d8d85c57 sys/arch/arm/xscale/pxa2x0.c
--- a/sys/arch/arm/xscale/pxa2x0.c      Sat Mar 20 19:33:30 2021 +0000
+++ b/sys/arch/arm/xscale/pxa2x0.c      Sat Mar 20 20:47:53 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pxa2x0.c,v 1.22.52.1 2021/03/20 19:33:32 thorpej Exp $ */
+/*     $NetBSD: pxa2x0.c,v 1.22.52.2 2021/03/20 20:47:53 thorpej Exp $ */
 
 /*
  * Copyright (c) 2002, 2005  Genetec Corporation.  All rights reserved.
@@ -99,7 +99,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pxa2x0.c,v 1.22.52.1 2021/03/20 19:33:32 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pxa2x0.c,v 1.22.52.2 2021/03/20 20:47:53 thorpej Exp $");
 
 #include "pxaintc.h"
 #include "pxagpio.h"
@@ -230,7 +230,7 @@
        /*
         * Attach all other devices
         */
-       config_search(self, sc,
+       config_search(self, NULL,
            CFARG_SUBMATCH, pxaip_search,
            CFARG_IATTR, "pxaip",
            CFARG_EOL);
@@ -239,7 +239,7 @@
 static int
 pxaip_search(device_t parent, cfdata_t cf, const int *ldesc, void *aux)
 {
-       struct pxaip_softc *sc = aux;
+       struct pxaip_softc *sc = device_private(parent);
        struct pxaip_attach_args aa;
 
        aa.pxa_iot = sc->sc_bust;
diff -r 49802eedf961 -r 7f99d8d85c57 sys/arch/zaurus/dev/zssp.c
--- a/sys/arch/zaurus/dev/zssp.c        Sat Mar 20 19:33:30 2021 +0000
+++ b/sys/arch/zaurus/dev/zssp.c        Sat Mar 20 20:47:53 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: zssp.c,v 1.13.62.1 2021/03/20 19:33:39 thorpej Exp $   */
+/*     $NetBSD: zssp.c,v 1.13.62.2 2021/03/20 20:47:53 thorpej Exp $   */
 /*     $OpenBSD: zaurus_ssp.c,v 1.6 2005/04/08 21:58:49 uwe Exp $      */
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: zssp.c,v 1.13.62.1 2021/03/20 19:33:39 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: zssp.c,v 1.13.62.2 2021/03/20 20:47:53 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -144,7 +144,7 @@
        zssp_init();
 
        /* Attach all devices */
-       config_search(self, sc,
+       config_search(self, NULL,
            CFARG_SUBMATCH, zssp_search,
            CFARG_IATTR, "zssp",
            CFARG_EOL);
diff -r 49802eedf961 -r 7f99d8d85c57 sys/dev/gpio/gpio.c
--- a/sys/dev/gpio/gpio.c       Sat Mar 20 19:33:30 2021 +0000
+++ b/sys/dev/gpio/gpio.c       Sat Mar 20 20:47:53 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: gpio.c,v 1.64.10.1 2021/03/20 19:33:40 thorpej Exp $ */
+/* $NetBSD: gpio.c,v 1.64.10.2 2021/03/20 20:47:53 thorpej Exp $ */
 /*     $OpenBSD: gpio.c,v 1.6 2006/01/14 12:33:49 grange Exp $ */
 
 /*
@@ -19,7 +19,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gpio.c,v 1.64.10.1 2021/03/20 19:33:40 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gpio.c,v 1.64.10.2 2021/03/20 20:47:53 thorpej Exp $");
 
 /*
  * General Purpose Input/Output framework.
@@ -191,7 +191,7 @@
 {
        struct gpio_softc *sc = device_private(self);
 
-       config_search(self, sc,
+       config_search(self, NULL,
            CFARG_SUBMATCH, gpio_search,
            CFARG_IATTR, ifattr,
            CFARG_LOCATORS, locators,
@@ -272,7 +272,7 @@
        struct gpio_attach_args ga;
        size_t namlen;
 
-       ga.ga_gpio = aux;
+       ga.ga_gpio = device_private(parent);
        ga.ga_offset = cf->cf_loc[GPIOCF_OFFSET];
        ga.ga_mask = cf->cf_loc[GPIOCF_MASK];
        ga.ga_flags = cf->cf_loc[GPIOCF_FLAG];



Home | Main Index | Thread Index | Old Index