There's already a forth word to add trivial open/close methods to a device node which we can use to simpilfy pci.c and reduce the clutter a bit.
Signed-off-by: BALATON Zoltan balaton@eik.bme.hu --- drivers/pci.c | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-)
diff --git a/drivers/pci.c b/drivers/pci.c index f30e427..779a8a4 100644 --- a/drivers/pci.c +++ b/drivers/pci.c @@ -52,7 +52,6 @@
DECLARE_UNNAMED_NODE( ob_pci_bus_node, INSTALL_OPEN, 2*sizeof(int) ); DECLARE_UNNAMED_NODE( ob_pci_bridge_node, INSTALL_OPEN, 2*sizeof(int) ); -DECLARE_UNNAMED_NODE( ob_pci_simple_node, 0, 2*sizeof(int) );
const pci_arch_t *arch;
@@ -175,18 +174,6 @@ static inline void pci_decode_pci_addr(pci_addr addr, int *flags, } }
-static void -ob_pci_open(int *idx) -{ - int ret=1; - RET ( -ret ); -} - -static void -ob_pci_close(int *idx) -{ -} - /* ( str len -- phys.lo phys.mid phys.hi ) */
static void @@ -455,8 +442,6 @@ ob_pci_dma_sync(int *idx) }
NODE_METHODS(ob_pci_bus_node) = { - { "open", ob_pci_open }, - { "close", ob_pci_close }, { "decode-unit", ob_pci_decode_unit }, { "encode-unit", ob_pci_encode_unit }, { "pci-map-in", ob_pci_bus_map_in }, @@ -477,8 +462,6 @@ ob_pci_bridge_map_in(int *idx) }
NODE_METHODS(ob_pci_bridge_node) = { - { "open", ob_pci_open }, - { "close", ob_pci_close }, { "decode-unit", ob_pci_decode_unit }, { "encode-unit", ob_pci_encode_unit }, { "pci-map-in", ob_pci_bridge_map_in }, @@ -489,11 +472,6 @@ NODE_METHODS(ob_pci_bridge_node) = { { "dma-sync", ob_pci_dma_sync }, };
-NODE_METHODS(ob_pci_simple_node) = { - { "open", ob_pci_open }, - { "close", ob_pci_close }, -}; - static void pci_set_bus_range(const pci_config_t *config) { phandle_t dev = find_dev(config->path); @@ -1863,9 +1841,7 @@ static phandle_t ob_configure_pci_device(const char* parent_path, }
/* if devices haven't supplied open/close words then supply them with simple defaults */ - if (!find_package_method("open", phandle) && !find_package_method("close", phandle)) { - BIND_NODE_METHODS(phandle, ob_pci_simple_node); - } + fword("is-open");
/* scan bus behind bridge device */ //if (htype & PCI_HEADER_TYPE_BRIDGE && class == PCI_BASE_CLASS_BRIDGE) {