Skip to content

host.Init() fails due register alias #73

@stackcoder

Description

@stackcoder

Describe the bug
I wanted to use the gpiomem feature which always failed:

bcm283x-gpio (GPIO24): subsystem gpiomem not initialized

Turns out a duplicated alias let fail gpio.Init() early and prevents loading the bcm283x-dma driver.

To Reproduce
Steps to reproduce the behavior:

  1. Take the init example code:
package main

import (
	"fmt"
	"log"
	"periph.io/x/host/v3"
)

func main() {
	state, err := host.Init()
	if err != nil {
		log.Fatalf("failed to initialize periph: %v", err)
	}

	fmt.Printf("Drivers failed to load:\n")
	for _, failure := range state.Failed {
		fmt.Printf("- %s: %v\n", failure.D, failure.Err)
	}
}
  1. Run it.
  2. Check for error:

bcm283x-gpio (GPIO24): subsystem gpiomem not initialized

Expected behavior
Host fully initializes. A duplicated gpio alias as a substitutable minor thing should not prohibit using other parts of the library.

Platform:

  • OS: gokrazy
  • Board: Raspberry Pi 1 B+

Additional context
Verified that Init() completes when ignoring gpioreg.RegisterAlias errors: stackcoder@52e9412

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions