Source-Changes-HG archive

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

[src/thorpej-i2c-spi-conf2]: src/sys/dev/fdt G/C fdtbus_register_spi_controll...



details:   https://anonhg.NetBSD.org/src/rev/445ee563f96d
branches:  thorpej-i2c-spi-conf2
changeset: 359711:445ee563f96d
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Tue Jan 18 00:14:20 2022 +0000

description:
G/C fdtbus_register_spi_controller(); it serves no purpose in the new
universe.

diffstat:

 sys/arch/arm/imx/imxspi.c      |  14 +------
 sys/arch/arm/rockchip/rk_spi.c |   6 +--
 sys/arch/arm/sunxi/sun4i_spi.c |   6 +--
 sys/dev/fdt/fdt_spi.c          |  81 ------------------------------------------
 sys/dev/fdt/fdtvar.h           |   4 +-
 sys/dev/fdt/files.fdt          |   3 +-
 6 files changed, 8 insertions(+), 106 deletions(-)

diffs (227 lines):

diff -r ece2143a709f -r 445ee563f96d sys/arch/arm/imx/imxspi.c
--- a/sys/arch/arm/imx/imxspi.c Mon Sep 13 14:47:28 2021 +0000
+++ b/sys/arch/arm/imx/imxspi.c Tue Jan 18 00:14:20 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: imxspi.c,v 1.9.2.1 2021/08/09 00:30:07 thorpej Exp $   */
+/*     $NetBSD: imxspi.c,v 1.9.2.2 2022/01/18 00:14:20 thorpej Exp $   */
 
 /*-
  * Copyright (c) 2014  Genetec Corporation.  All rights reserved.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: imxspi.c,v 1.9.2.1 2021/08/09 00:30:07 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imxspi.c,v 1.9.2.2 2022/01/18 00:14:20 thorpej Exp $");
 
 #include "opt_imxspi.h"
 #include "opt_fdt.h"
@@ -52,10 +52,6 @@
 #include <arm/imx/imxspivar.h>
 #include <arm/imx/imxspireg.h>
 
-#ifdef FDT
-#include <dev/fdt/fdtvar.h>
-#endif
-
 /* SPI service routines */
 static int imxspi_configure_enhanced(void *, int, int, int);
 static int imxspi_configure(void *, int, int, int);
@@ -123,11 +119,6 @@
 
        WRITE_REG(sc, PERIODREG, 0x0);
 
-#ifdef FDT
-       KASSERT(sc->sc_phandle != 0);
-
-       fdtbus_register_spi_controller(&sc->sc_spi, sc->sc_phandle);
-#endif
        struct spibus_attach_args sba = {
                .sba_controller = &sc->sc_spi,
        };
@@ -413,4 +404,3 @@
 
        return 0;
 }
-
diff -r ece2143a709f -r 445ee563f96d sys/arch/arm/rockchip/rk_spi.c
--- a/sys/arch/arm/rockchip/rk_spi.c    Mon Sep 13 14:47:28 2021 +0000
+++ b/sys/arch/arm/rockchip/rk_spi.c    Tue Jan 18 00:14:20 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rk_spi.c,v 1.7.8.1 2021/08/09 00:30:07 thorpej Exp $   */
+/*     $NetBSD: rk_spi.c,v 1.7.8.2 2022/01/18 00:14:20 thorpej Exp $   */
 
 /*
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rk_spi.c,v 1.7.8.1 2021/08/09 00:30:07 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rk_spi.c,v 1.7.8.2 2022/01/18 00:14:20 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -251,8 +251,6 @@
        sc->sc_spi.sct_transfer = rk_spi_transfer;
        sc->sc_spi.sct_nslaves = 2;
 
-       fdtbus_register_spi_controller(&sc->sc_spi, phandle);
-
        struct spibus_attach_args sba = {
                .sba_controller = &sc->sc_spi,
        };
diff -r ece2143a709f -r 445ee563f96d sys/arch/arm/sunxi/sun4i_spi.c
--- a/sys/arch/arm/sunxi/sun4i_spi.c    Mon Sep 13 14:47:28 2021 +0000
+++ b/sys/arch/arm/sunxi/sun4i_spi.c    Tue Jan 18 00:14:20 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sun4i_spi.c,v 1.7.14.1 2021/08/09 00:30:07 thorpej Exp $       */
+/*     $NetBSD: sun4i_spi.c,v 1.7.14.2 2022/01/18 00:14:20 thorpej Exp $       */
 
 /*
  * Copyright (c) 2019 Tobias Nygren
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sun4i_spi.c,v 1.7.14.1 2021/08/09 00:30:07 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sun4i_spi.c,v 1.7.14.2 2022/01/18 00:14:20 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -152,8 +152,6 @@
        sc->sc_spi.sct_transfer = sun4ispi_transfer;
        (void) of_getprop_uint32(phandle, "num-cs", &sc->sc_spi.sct_nslaves);
 
-       fdtbus_register_spi_controller(&sc->sc_spi, phandle);
-
        struct spibus_attach_args sba = {
                .sba_controller = &sc->sc_spi,
        };
diff -r ece2143a709f -r 445ee563f96d sys/dev/fdt/fdt_spi.c
--- a/sys/dev/fdt/fdt_spi.c     Mon Sep 13 14:47:28 2021 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-/* $NetBSD: fdt_spi.c,v 1.3.2.1 2021/08/09 00:30:09 thorpej Exp $ */
-
-/*
- * Copyright (c) 2019 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Tobias Nygren.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fdt_spi.c,v 1.3.2.1 2021/08/09 00:30:09 thorpej Exp $");
-
-#include <sys/param.h>
-#include <sys/device.h>
-#include <sys/bus.h>
-#include <sys/kmem.h>
-#include <sys/queue.h>
-#include <dev/spi/spivar.h>
-#include <libfdt.h>
-#include <dev/fdt/fdtvar.h>
-
-struct fdtbus_spi_controller {
-       struct spi_controller *spi_ctlr;
-       int spi_phandle;
-
-       LIST_ENTRY(fdtbus_spi_controller) spi_next;
-};
-
-static LIST_HEAD(, fdtbus_spi_controller) fdtbus_spi_controllers =
-    LIST_HEAD_INITIALIZER(fdtbus_spi_controllers);
-
-int
-fdtbus_register_spi_controller(struct spi_controller *ctlr, int phandle)
-{
-       struct fdtbus_spi_controller *spi;
-
-       spi = kmem_alloc(sizeof(*spi), KM_SLEEP);
-       spi->spi_ctlr = ctlr;
-       spi->spi_phandle = phandle;
-
-       LIST_INSERT_HEAD(&fdtbus_spi_controllers, spi, spi_next);
-
-       return 0;
-}
-
-#if 0
-static struct spi_controller *
-fdtbus_get_spi_controller(int phandle)
-{
-       struct fdtbus_spi_controller *spi;
-
-       LIST_FOREACH(spi, &fdtbus_spi_controllers, spi_next) {
-               if (spi->spi_phandle == phandle) {
-                       return spi->spi_ctlr;
-               }
-       }
-       return NULL;
-}
-#endif
diff -r ece2143a709f -r 445ee563f96d sys/dev/fdt/fdtvar.h
--- a/sys/dev/fdt/fdtvar.h      Mon Sep 13 14:47:28 2021 +0000
+++ b/sys/dev/fdt/fdtvar.h      Tue Jan 18 00:14:20 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fdtvar.h,v 1.70.12.1 2021/08/09 00:30:09 thorpej Exp $ */
+/* $NetBSD: fdtvar.h,v 1.70.12.2 2022/01/18 00:14:20 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -35,7 +35,6 @@
 #include <sys/termios.h>
 
 #include <dev/i2c/i2cvar.h>
-#include <dev/spi/spivar.h>
 #include <dev/pwm/pwmvar.h>
 #include <dev/clk/clk.h>
 
@@ -271,7 +270,6 @@
 int            fdtbus_register_interrupt_controller(device_t, int,
                    const struct fdtbus_interrupt_controller_func *);
 int            fdtbus_register_i2c_controller(i2c_tag_t, int);
-int            fdtbus_register_spi_controller(struct spi_controller *, int);
 int            fdtbus_register_gpio_controller(device_t, int,
                    const struct fdtbus_gpio_controller_func *);
 int            fdtbus_register_pinctrl_config(device_t, int,
diff -r ece2143a709f -r 445ee563f96d sys/dev/fdt/files.fdt
--- a/sys/dev/fdt/files.fdt     Mon Sep 13 14:47:28 2021 +0000
+++ b/sys/dev/fdt/files.fdt     Tue Jan 18 00:14:20 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files.fdt,v 1.61 2021/04/26 15:02:29 thorpej Exp $
+# $NetBSD: files.fdt,v 1.61.10.1 2022/01/18 00:14:20 thorpej Exp $
 
 include        "external/bsd/libfdt/conf/files.libfdt"
 
@@ -80,7 +80,6 @@
 file   dev/fdt/fdt_regulator.c                 fdt
 file   dev/fdt/fdt_reset.c                     fdt
 file   dev/fdt/fdt_rtc.c                       fdt
-file   dev/fdt/fdt_spi.c                       fdt
 file   dev/fdt/fdt_syscon.c                    fdt
 file   dev/fdt/fdt_pinctrl.c                   fdt
 



Home | Main Index | Thread Index | Old Index