summaryrefslogtreecommitdiffstats
path: root/drivers/base/bus.c
Commit message (Collapse)AuthorAgeFilesLines
* drivers: Introduce dev_set_name()Andrey Smirnov2018-10-181-1/+1
| | | | | | | | Introduce dev_set_name() in order to hide implementation details of setting device's name so it'd be easier to change it. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* drivers: bus: Match against id_table firstAndrey Smirnov2015-12-071-3/+2
| | | | | | | | | | | | | | | | Matching against driver's name before looking throught its id_table can lead to a somewhat strange and unintuitive behaviour where a device whose driver's name matches one of the lines in id_table (which is not unheard of in Linux kernel) will be probed against said driver with 'id_table' field set to NULL which in turn will result in dev_get_drvdata erroring out with -ENODEV. This patch changes the behaviour such that device_match() only tries to match against driver's name only if id_table of that driver is not present. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* drivers/base: Mark (of|platform)_device_id data as constantUwe Kleine-König2015-04-171-2/+2
| | | | | | | | | | There should be no reason to ever change the data pointed to by id_table or of_compatible. So make this offical by adding some 'const's. In Linux the corresponding pointers are marked as const, too. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* i2c/spi: match of_modaliasesSascha Hauer2014-02-071-0/+37
| | | | | | | | i2c/spi devices in the devicetree often come with a "vendor,device" comaptible string. These do not match in barebox, so add a device_match_of_modalias function which does exactly that. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: Add missing includesSascha Hauer2013-11-081-0/+1
| | | | | | | | A lot of files rely on include/driver.h including include/of.h (and this including include/errno.h. include the files explicitly so we can eventually get rid of including of.h from driver.h Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* base: Transform "platform_match" into "device_match" and make this function ↵Alexander Shiyan2013-07-151-0/+24
| | | | | | | | | public This change will allow reuse this function for other buses. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bus: Make struct device a pointerSascha Hauer2013-03-141-3/+4
| | | | | | | | struct bus_type contains an embedded struct device_d which is quite a big structure. Dynamically allocate this instead to save the space in the binary. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bus: add bus deviceJean-Christophe PLAGNIOL-VILLARD2012-11-191-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | automatically add it as parent of any bus device if none already specified we have now a nice output per bus barebox@Atmel at91sam9x5-ek:/ devices: `---- platform `---- atmel_usart0 `---- cs0 `---- atmel_usart1 `---- cs1 `---- mem0 `---- 0x00000000-0x07ffffff: /dev/ram0 `---- mem1 `---- 0x00000000-0x00007fff: /dev/sram0 `---- mem2 `---- 0x00000000-0x000037bf: /dev/defaultenv `---- mem3 `---- 0x00000000-0xfffffffe: /dev/mem `---- cs2 `---- w1-gpio `---- w1_bus0 `---- w1-2d-0 `---- 0x00000000-0x0000007f: /dev/ds24310 `---- w1-2d-1 `---- 0x00000000-0x0000007f: /dev/ds24311 `---- w1-23-0 `---- 0x00000000-0x000001ff: /dev/ds24330 `---- at91sam9x5cm `---- at91sam9x5ek `---- at91sam9x5dm `---- atmel_nand0 `---- nand0 `---- 0x00000000-0x1fffffff: /dev/nand0 `---- 0x00000000-0x0003ffff: /dev/at91bootstrap_raw `---- 0x00040000-0x0009ffff: /dev/self_raw `---- 0x000a0000-0x000bffff: /dev/env_raw `---- 0x000c0000-0x000dffff: /dev/env_raw1 `---- 0x00000000-0x0003ffff: /dev/nand0.at91bootstrap `---- 0x00040000-0x0009ffff: /dev/nand0.barebox `---- 0x000a0000-0x000bffff: /dev/nand0.bareboxenv `---- 0x000c0000-0x000dffff: /dev/nand0.bareboxenv2 `---- 0x000e0000-0x000fffff: /dev/nand0.oftree `---- 0x00100000-0x001fffff: /dev/nand0.free `---- 0x00200000-0x007fffff: /dev/nand0.kernel `---- 0x00800000-0x07ffffff: /dev/nand0.rootfs `---- 0x08000000-0x1fffffff: /dev/nand0.data `---- macb0 `---- miibus0 `---- eth0 `---- atmel_spi0 `---- mtd_dataflash0 `---- dataflash0 `---- 0x00000000-0x0041ffff: /dev/dataflash0 `---- atmel_mci0 `---- mci0 `---- 0x00000000-0x1d9bfffff: /dev/disk0 `---- 0x00100000-0x064fffff: /dev/disk0.0 `---- 0x06500000-0x1d9bfffff: /dev/disk0.1 `---- i2c-gpio0 `---- i2c0 `---- qt10700 `---- cs3 `---- mdio_bus `---- spi `---- i2c `---- w1_bus `---- fs `---- ramfs0 `---- devfs0 `---- net `---- global drivers: atmel_usart ramfs devfs fat macb Generic PHY atmel_nand mtd_dataflash m25p80 atmel_spi i2c-gpio mci atmel_mci qt1070 w1-gpio ds2431 ds2433 mem Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* driver: make get_bus_by_name staticSascha Hauer2012-10-041-1/+1
| | | | | | We have no prototype for it, so it should be static. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* driver: search device and driver based on the bus instead of allJean-Christophe PLAGNIOL-VILLARD2012-09-231-0/+3
| | | | | | | This will allow reduce the number of driver and device to search on. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* driver: register busJean-Christophe PLAGNIOL-VILLARD2012-09-231-0/+34
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>