u-boot-2016/drivers
Simon Glass e48eeb9ea3 dm: blk: Improve block device claiming
The intention with block devices is that the device number (devnum field
in its descriptor) matches the alias of its parent device. For example,
with:

	aliases {
		mmc0 = "/sdhci@700b0600";
		mmc1 = "/sdhci@700b0400";
	}

we expect that the block devices for mmc0 and mmc1 would have device
numbers of 0 and 1 respectively.

Unfortunately this does not currently always happen. If there is another
MMC device earlier in the driver model data structures its block device
will be created first. It will therefore get device number 0 and mmc0
will therefore miss out. In this case the MMC device will have sequence
number 0 but its block device will not.

To avoid this, allow a device to request a device number and bump any
existing device number that is using it. This all happens during the
binding phase so it is safe to change these numbers around. This allows
device numbers to match the aliases in all circumstances.

Add a test to verify the behaviour.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-06-01 07:03:05 -06:00
..
adc dm: Rename dev_addr..() functions 2017-06-01 07:03:01 -06:00
bios_emulator bios_emulator: Fix cast for 64-bit compilation 2016-10-11 11:55:33 +08:00
block dm: blk: Improve block device claiming 2017-06-01 07:03:05 -06:00
bootcount Blackfin: Remove 2017-04-05 13:52:01 -04:00
clk dm: core: Replace of_offset with accessor (part 2) 2017-06-01 07:03:04 -06:00
core dm: core: Adjust device_bind_common() to take an ofnode 2017-06-01 07:03:04 -06:00
cpu dm: Rename dev_addr..() functions 2017-06-01 07:03:01 -06:00
crypto Convert CONFIG_CMD_HASH to Kconfig 2017-05-22 12:38:15 -04:00
ddr Merge git://git.denx.de/u-boot-fsl-qoriq 2017-04-18 11:36:06 -04:00
demo dm: core: Replace of_offset with accessor 2017-02-08 06:12:14 -07:00
dfu common: dfu: ignore reset for spl-dfu 2017-05-12 08:37:09 -04:00
dma dm: Rename dev_addr..() functions 2017-06-01 07:03:01 -06:00
firmware dm: core: Replace of_offset with accessor (part 2) 2017-06-01 07:03:04 -06:00
fpga FPGA: drivers/fpga/ivm_core.c: incorrect printf 2017-04-18 10:29:23 -04:00
gpio dm: core: Replace of_offset with accessor (part 2) 2017-06-01 07:03:04 -06:00
i2c dm: Rename dev_addr..() functions 2017-06-01 07:03:01 -06:00
input dm: Rename dev_addr..() functions 2017-06-01 07:03:01 -06:00
led dm: Rename dev_addr..() functions 2017-06-01 07:03:01 -06:00
mailbox dm: Rename dev_addr..() functions 2017-06-01 07:03:01 -06:00
memory memory: Move TI_AEMIF config to KCONFIG 2016-04-18 17:11:43 -04:00
misc dm: Rename dev_addr..() functions 2017-06-01 07:03:01 -06:00
mmc dm: mmc: Don't call board_mmc_power_init() with driver model 2017-06-01 07:03:04 -06:00
mtd fix: nand: pxa3xx: Remove hardcode values from the driver 2017-05-09 13:38:18 +02:00
net dm: core: Replace of_offset with accessor (part 2) 2017-06-01 07:03:04 -06:00
pch dm: Use dm_scan_fdt_dev() directly where possible 2016-07-27 14:15:54 -06:00
pci dm: Rename dev_addr..() functions 2017-06-01 07:03:01 -06:00
pcmcia Kconfig: Add a CONFIG_IDE option 2017-05-22 12:45:27 -04:00
phy dm: core: Replace of_offset with accessor (part 2) 2017-06-01 07:03:04 -06:00
pinctrl dm: core: Replace of_offset with accessor (part 2) 2017-06-01 07:03:04 -06:00
power dm: Rename dev_addr..() functions 2017-06-01 07:03:01 -06:00
pwm dm: Rename dev_addr..() functions 2017-06-01 07:03:01 -06:00
qe armv7: ls1021a: Drop macro CONFIG_LS102XA 2017-04-17 09:03:30 -07:00
ram dm: core: Replace of_offset with accessor (part 2) 2017-06-01 07:03:04 -06:00
remoteproc dm: core: Replace of_offset with accessor 2017-02-08 06:12:14 -07:00
reset dm: Rename dev_addr..() functions 2017-06-01 07:03:01 -06:00
rtc Drop three-wire serial (TWS) support 2017-05-22 08:37:10 -04:00
serial dm: core: Replace of_offset with accessor (part 2) 2017-06-01 07:03:04 -06:00
soc Use correct spelling of "U-Boot" 2016-02-06 12:00:59 +01:00
sound of: clean up OF_CONTROL ifdef conditionals 2015-08-18 13:46:05 -04:00
spi dm: core: Replace of_offset with accessor (part 2) 2017-06-01 07:03:04 -06:00
spmi dm: Rename dev_addr..() functions 2017-06-01 07:03:01 -06:00
sysreset dm: Fix up inclusion of common.h 2017-06-01 07:03:03 -06:00
thermal thermal: imx: fix calculation 2017-05-18 11:23:31 +02:00
timer dm: core: Replace of_offset with accessor (part 2) 2017-06-01 07:03:04 -06:00
tpm dm: Rename dev_addr..() functions 2017-06-01 07:03:01 -06:00
usb dm: Rename dev_addr..() functions 2017-06-01 07:03:01 -06:00
video dm: core: Replace of_offset with accessor (part 2) 2017-06-01 07:03:04 -06:00
watchdog dm: Rename dev_addr..() functions 2017-06-01 07:03:01 -06:00
Kconfig Drop digital thermometer and thermostat (DTT) drivers 2017-05-22 08:37:11 -04:00
Makefile Drop digital thermometer and thermostat (DTT) drivers 2017-05-22 08:37:11 -04:00