Give the mx25l device sole ownership of the name /dev/flash/spi* instead of

trying to use disk_add_alias() to make spi* an alias for mx25l*.  It turns
out disk_add_alias() works for partitions, but not slices, and that's hard
to fix.

This change is, in effect, a partial revert of r344526.

The mips world relies on the existence of flashmap names formatted as
/dev/flash/spi0s.name, whereas pretty much nothing relies on at45d devices
using the /dev/spi* names (because until recently the at45d driver didn't
even work reliably). So this change makes mx25l devices the sole owner of
the /dev/flash/spi* namespace, which actually makes some sense because it is
a SpiFlash(tm) device, so flash/spi isn't a horrible name.

Reported by:	Mori Hiroki <yamori813@yahoo.co.jp>
This commit is contained in:
ian 2019-03-10 18:48:08 +00:00
parent 463a6d6431
commit 9d0de95847
2 changed files with 1 additions and 3 deletions

View File

@ -381,7 +381,6 @@ at45d_delayed_attach(void *xsc)
sc->disk->d_mediasize = pagesize * ident->pagecount;
sc->disk->d_unit = device_get_unit(sc->dev);
disk_create(sc->disk, DISK_VERSION);
disk_add_alias(sc->disk, "flash/spi");
bioq_init(&sc->bio_queue);
kproc_create(&at45d_task, sc, &sc->p, 0, 0, "task: at45d flash");
sc->taskstate = TSTATE_RUNNING;

View File

@ -510,7 +510,7 @@ mx25l_attach(device_t dev)
sc->sc_disk->d_strategy = mx25l_strategy;
sc->sc_disk->d_getattr = mx25l_getattr;
sc->sc_disk->d_ioctl = mx25l_ioctl;
sc->sc_disk->d_name = "flash/mx25l";
sc->sc_disk->d_name = "flash/spi";
sc->sc_disk->d_drv1 = sc;
sc->sc_disk->d_maxsize = DFLTPHYS;
sc->sc_disk->d_sectorsize = MX25L_SECTORSIZE;
@ -522,7 +522,6 @@ mx25l_attach(device_t dev)
sizeof(sc->sc_disk->d_descr));
disk_create(sc->sc_disk, DISK_VERSION);
disk_add_alias(sc->sc_disk, "flash/spi");
bioq_init(&sc->sc_bio_queue);
kproc_create(&mx25l_task, sc, &sc->sc_p, 0, 0, "task: mx25l flash");