From: Hans-Christian Egtvedt In order for spi_busnum_to_master to work spi master devices must be linked into the spi_master_class.subsys.kset list. At the moment the default class_obj_subsys.kset is used and we can't enumerate the master devices. Signed-off-by: Hans-Christian Egtvedt Cc: David Brownell Signed-off-by: Andrew Morton --- drivers/spi/spi.c | 1 + 1 file changed, 1 insertion(+) diff -puN drivers/spi/spi.c~spi-set-kset-of-master-class-dev-explicitly drivers/spi/spi.c --- a/drivers/spi/spi.c~spi-set-kset-of-master-class-dev-explicitly +++ a/drivers/spi/spi.c @@ -366,6 +366,7 @@ spi_alloc_master(struct device *dev, uns class_device_initialize(&master->cdev); master->cdev.class = &spi_master_class; + kobj_set_kset_s(&master->cdev, spi_master_class.subsys); master->cdev.dev = get_device(dev); spi_master_set_devdata(master, &master[1]); _