mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 14:53:58 -04:00
cdx: Register cdx bus as a device on cdx subsystem
While scanning for CDX devices, register newly discovered bus as a cdx device. CDX device attributes are visible based on device type. Signed-off-by: Abhijit Gangurde <abhijit.gangurde@amd.com> Link: https://lore.kernel.org/r/20231017160505.10640-5-abhijit.gangurde@amd.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
e3ed12f37e
commit
ce558a391d
@@ -79,8 +79,14 @@ static int cdx_scan_devices(struct cdx_controller *cdx)
|
||||
num_cdx_bus = (u8)ret;
|
||||
|
||||
for (bus_num = 0; bus_num < num_cdx_bus; bus_num++) {
|
||||
struct device *bus_dev;
|
||||
u8 num_cdx_dev;
|
||||
|
||||
/* Add the bus on cdx subsystem */
|
||||
bus_dev = cdx_bus_add(cdx, bus_num);
|
||||
if (!bus_dev)
|
||||
continue;
|
||||
|
||||
/* MCDI FW Read: Fetch the number of devices present */
|
||||
ret = cdx_mcdi_get_num_devs(cdx_mcdi, bus_num);
|
||||
if (ret < 0) {
|
||||
@@ -103,6 +109,7 @@ static int cdx_scan_devices(struct cdx_controller *cdx)
|
||||
continue;
|
||||
}
|
||||
dev_params.cdx = cdx;
|
||||
dev_params.parent = bus_dev;
|
||||
|
||||
/* Add the device to the cdx bus */
|
||||
ret = cdx_device_add(&dev_params);
|
||||
|
||||
Reference in New Issue
Block a user