Index: sys/dev/spibus/spigen.c =================================================================== --- sys/dev/spibus/spigen.c +++ sys/dev/spibus/spigen.c @@ -186,11 +186,22 @@ { struct spigen_softc *sc; const int unit = device_get_unit(dev); +#ifdef FDT + int cs; + + spibus_get_cs(dev, &cs); +#endif sc = device_get_softc(dev); sc->sc_dev = dev; sc->sc_cdev = make_dev(&spigen_cdevsw, unit, +#ifdef FDT + /* is this right??? */ + UID_ROOT, GID_OPERATOR, 0660, "spigen%d.%d", + device_get_unit(device_get_parent(dev)), cs); +#else UID_ROOT, GID_OPERATOR, 0660, "spigen%d", unit); +#endif sc->sc_cdev->si_drv1 = dev; sc->sc_command_length_max = PAGE_SIZE; sc->sc_data_length_max = PAGE_SIZE;