Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm Remove superfluous checking for a "disable" pro...



details:   https://anonhg.NetBSD.org/src/rev/1cccd519a041
branches:  trunk
changeset: 933952:1cccd519a041
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sun May 31 23:52:19 2020 +0000

description:
Remove superfluous checking for a "disable" property in the device_t
properties dictionary.

diffstat:

 sys/arch/arm/broadcom/bcm2835_bsc_fdt.c |  13 ++-----------
 sys/arch/arm/broadcom/bcm2835_emmc.c    |  13 ++-----------
 sys/arch/arm/broadcom/bcm2835_sdhost.c  |  12 ++----------
 sys/arch/arm/sociox/sni_emmc.c          |  12 ++----------
 sys/arch/arm/sociox/sni_exiu.c          |  12 ++----------
 sys/arch/arm/sociox/sni_gpio.c          |  12 ++----------
 sys/arch/arm/sociox/sni_i2c.c           |  11 ++---------
 7 files changed, 14 insertions(+), 71 deletions(-)

diffs (274 lines):

diff -r 9d86dc92fba1 -r 1cccd519a041 sys/arch/arm/broadcom/bcm2835_bsc_fdt.c
--- a/sys/arch/arm/broadcom/bcm2835_bsc_fdt.c   Sun May 31 23:34:34 2020 +0000
+++ b/sys/arch/arm/broadcom/bcm2835_bsc_fdt.c   Sun May 31 23:52:19 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bcm2835_bsc_fdt.c,v 1.1 2020/03/31 12:23:17 jmcneill Exp $     */
+/*     $NetBSD: bcm2835_bsc_fdt.c,v 1.2 2020/05/31 23:52:19 thorpej Exp $      */
 
 /*
  * Copyright (c) 2019 Jason R. Thorpe
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bcm2835_bsc_fdt.c,v 1.1 2020/03/31 12:23:17 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm2835_bsc_fdt.c,v 1.2 2020/05/31 23:52:19 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -67,8 +67,6 @@
        struct bsciic_softc * const sc = device_private(self);
        struct fdt_attach_args * const faa = aux;
        const int phandle = faa->faa_phandle;
-       prop_dictionary_t prop = device_properties(self);
-       bool disable = false;
 
        bus_addr_t addr;
        bus_size_t size;
@@ -82,13 +80,6 @@
                return;
        }
 
-       prop_dictionary_get_bool(prop, "disable", &disable);
-       if (disable) {
-               aprint_naive(": disabled\n");
-               aprint_normal(": disabled\n");
-               return;
-       }
-
        /* Enable clock */
        sc->sc_clk = fdtbus_clock_get_index(phandle, 0);
        if (sc->sc_clk == NULL) {
diff -r 9d86dc92fba1 -r 1cccd519a041 sys/arch/arm/broadcom/bcm2835_emmc.c
--- a/sys/arch/arm/broadcom/bcm2835_emmc.c      Sun May 31 23:34:34 2020 +0000
+++ b/sys/arch/arm/broadcom/bcm2835_emmc.c      Sun May 31 23:52:19 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bcm2835_emmc.c,v 1.36 2020/02/20 01:44:06 jmcneill Exp $       */
+/*     $NetBSD: bcm2835_emmc.c,v 1.37 2020/05/31 23:52:19 thorpej Exp $        */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bcm2835_emmc.c,v 1.36 2020/02/20 01:44:06 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm2835_emmc.c,v 1.37 2020/05/31 23:52:19 thorpej Exp $");
 
 #include "bcmdmac.h"
 
@@ -117,9 +117,7 @@
 {
        struct bcmemmc_softc *sc = device_private(self);
        struct fdt_attach_args * const faa = aux;
-       prop_dictionary_t dict = device_properties(self);
        const int phandle = faa->faa_phandle;
-       bool disable = false;
        enum bcmemmc_type type;
        int error;
 
@@ -138,13 +136,6 @@
        sc->sc.sc_clkbase = 50000;      /* Default to 50MHz */
        sc->sc_iot = faa->faa_bst;
 
-       prop_dictionary_get_bool(dict, "disable", &disable);
-       if (disable) {
-               aprint_naive(": disabled\n");
-               aprint_normal(": disabled\n");
-               return;
-       }
-
        bus_addr_t addr;
        bus_size_t size;
 
diff -r 9d86dc92fba1 -r 1cccd519a041 sys/arch/arm/broadcom/bcm2835_sdhost.c
--- a/sys/arch/arm/broadcom/bcm2835_sdhost.c    Sun May 31 23:34:34 2020 +0000
+++ b/sys/arch/arm/broadcom/bcm2835_sdhost.c    Sun May 31 23:52:19 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bcm2835_sdhost.c,v 1.4 2017/12/10 21:38:26 skrll Exp $ */
+/* $NetBSD: bcm2835_sdhost.c,v 1.5 2020/05/31 23:52:19 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bcm2835_sdhost.c,v 1.4 2017/12/10 21:38:26 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm2835_sdhost.c,v 1.5 2020/05/31 23:52:19 thorpej Exp $");
 
 #include "bcmdmac.h"
 
@@ -191,8 +191,6 @@
 {
        struct sdhost_softc * const sc = device_private(self);
        struct fdt_attach_args * const faa = aux;
-       prop_dictionary_t dict = device_properties(self);
-       bool disable = false;
 
        sc->sc_dev = self;
        sc->sc_bst = faa->faa_bst;
@@ -220,12 +218,6 @@
        aprint_naive("\n");
        aprint_normal(": SD HOST controller\n");
 
-       prop_dictionary_get_bool(dict, "disable", &disable);
-       if (disable) {
-               aprint_naive(": disabled\n");
-               aprint_normal(": disabled\n");
-               return;
-       }
        /* Enable clocks */
        struct clk *clk;
        for (int i = 0; (clk = fdtbus_clock_get_index(phandle, i)); i++) {
diff -r 9d86dc92fba1 -r 1cccd519a041 sys/arch/arm/sociox/sni_emmc.c
--- a/sys/arch/arm/sociox/sni_emmc.c    Sun May 31 23:34:34 2020 +0000
+++ b/sys/arch/arm/sociox/sni_emmc.c    Sun May 31 23:52:19 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sni_emmc.c,v 1.6 2020/03/25 23:20:38 nisimura Exp $    */
+/*     $NetBSD: sni_emmc.c,v 1.7 2020/05/31 23:55:18 thorpej Exp $     */
 
 /*-
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sni_emmc.c,v 1.6 2020/03/25 23:20:38 nisimura Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sni_emmc.c,v 1.7 2020/05/31 23:55:18 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -100,20 +100,12 @@
 {
        struct sniemmc_softc * const sc = device_private(self);
        struct fdt_attach_args * const faa = aux;
-       prop_dictionary_t dict = device_properties(self);
        const int phandle = faa->faa_phandle;
        bus_space_handle_t ioh;
        bus_addr_t addr;
        bus_size_t size;
        char intrstr[128];
-       _Bool disable;
 
-       prop_dictionary_get_bool(dict, "disable", &disable);
-       if (disable) {
-               aprint_naive(": disabled\n");
-               aprint_normal(": disabled\n");
-               return;
-       }
        if (fdtbus_get_reg(phandle, 0, &addr, &size) != 0
            || bus_space_map(faa->faa_bst, addr, size, 0, &ioh) != 0) {
                aprint_error(": unable to map device\n");
diff -r 9d86dc92fba1 -r 1cccd519a041 sys/arch/arm/sociox/sni_exiu.c
--- a/sys/arch/arm/sociox/sni_exiu.c    Sun May 31 23:34:34 2020 +0000
+++ b/sys/arch/arm/sociox/sni_exiu.c    Sun May 31 23:52:19 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sni_exiu.c,v 1.3 2020/03/25 23:29:39 nisimura Exp $    */
+/*     $NetBSD: sni_exiu.c,v 1.4 2020/05/31 23:55:18 thorpej Exp $     */
 
 /*-
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sni_exiu.c,v 1.3 2020/03/25 23:29:39 nisimura Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sni_exiu.c,v 1.4 2020/05/31 23:55:18 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -91,20 +91,12 @@
 {
        struct sniexiu_softc * const sc = device_private(self);
        struct fdt_attach_args * const faa = aux;
-       prop_dictionary_t dict = device_properties(self);
        const int phandle = faa->faa_phandle;
        bus_space_handle_t ioh;
        bus_addr_t addr;
        bus_size_t size;
        char intrstr[128];
-       _Bool disable;
 
-       prop_dictionary_get_bool(dict, "disable", &disable);
-       if (disable) {
-               aprint_naive(": disabled\n");
-               aprint_normal(": disabled\n");
-               return;
-       }
        if (fdtbus_get_reg(phandle, 0, &addr, &size) != 0
            || bus_space_map(faa->faa_bst, addr, size, 0, &ioh) != 0) {
                aprint_error(": unable to map device\n");
diff -r 9d86dc92fba1 -r 1cccd519a041 sys/arch/arm/sociox/sni_gpio.c
--- a/sys/arch/arm/sociox/sni_gpio.c    Sun May 31 23:34:34 2020 +0000
+++ b/sys/arch/arm/sociox/sni_gpio.c    Sun May 31 23:52:19 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sni_gpio.c,v 1.7 2020/03/25 23:31:19 nisimura Exp $    */
+/*     $NetBSD: sni_gpio.c,v 1.8 2020/05/31 23:55:18 thorpej Exp $     */
 
 /*-
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sni_gpio.c,v 1.7 2020/03/25 23:31:19 nisimura Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sni_gpio.c,v 1.8 2020/05/31 23:55:18 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -119,21 +119,13 @@
 {
        struct snigpio_softc * const sc = device_private(self);
        struct fdt_attach_args * const faa = aux;
-       prop_dictionary_t dict = device_properties(self);
        const int phandle = faa->faa_phandle;
        bus_space_handle_t ioh;
        bus_addr_t addr;
        bus_size_t size;
        char intrstr[128];
        const char *list;
-       _Bool disable;
 
-       prop_dictionary_get_bool(dict, "disable", &disable);
-       if (disable) {
-               aprint_naive(": disabled\n");
-               aprint_normal(": disabled\n");
-               return;
-       }
        if (fdtbus_get_reg(phandle, 0, &addr, &size) != 0
            || bus_space_map(faa->faa_bst, addr, size, 0, &ioh) != 0) {
                aprint_error(": unable to map device\n");
diff -r 9d86dc92fba1 -r 1cccd519a041 sys/arch/arm/sociox/sni_i2c.c
--- a/sys/arch/arm/sociox/sni_i2c.c     Sun May 31 23:34:34 2020 +0000
+++ b/sys/arch/arm/sociox/sni_i2c.c     Sun May 31 23:52:19 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sni_i2c.c,v 1.6 2020/03/25 23:20:38 nisimura Exp $     */
+/*     $NetBSD: sni_i2c.c,v 1.7 2020/05/31 23:55:18 thorpej Exp $      */
 
 /*-
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sni_i2c.c,v 1.6 2020/03/25 23:20:38 nisimura Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sni_i2c.c,v 1.7 2020/05/31 23:55:18 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -123,14 +123,7 @@
        bus_addr_t addr;
        bus_size_t size;
        char intrstr[128];
-       _Bool disable;
 
-       prop_dictionary_get_bool(dict, "disable", &disable);
-       if (disable) {
-               aprint_naive(": disabled\n");
-               aprint_normal(": disabled\n");
-               return;
-       }
        if (fdtbus_get_reg(phandle, 0, &addr, &size) != 0
            || bus_space_map(faa->faa_bst, addr, size, 0, &ioh) != 0) {
                aprint_error(": unable to map device\n");



Home | Main Index | Thread Index | Old Index