Hi,
This patch introduces simple function to find disk by device softc.
Use case is geom_flashmap. It provides way to register callback to identify slices on flash device. It passes device_t into callback, but flash size is required to calculate end of memory-mapped flash region. This functions helps to retrieve flash size of any device (CFI, SPI and so on).