diff options
author | Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> | 2020-05-19 01:43:19 +0800 |
---|---|---|
committer | Vinod Koul <vkoul@kernel.org> | 2020-05-19 12:44:34 +0530 |
commit | 90acca1d54ad566b4af5f1030b4a4a2420ce2ef0 (patch) | |
tree | dc66ab4a43b1a2a6b02a661223fee051e28afa10 /drivers/soundwire/slave.c | |
parent | 5cab3ff2489ede5abffa6ad730708e087dc45a4d (diff) | |
download | linux-90acca1d54ad566b4af5f1030b4a4a2420ce2ef0.tar.gz linux-90acca1d54ad566b4af5f1030b4a4a2420ce2ef0.tar.bz2 linux-90acca1d54ad566b4af5f1030b4a4a2420ce2ef0.zip |
soundwire: bus_type: introduce sdw_slave_type and sdw_master_type
this is a preparatory patch before the introduction of the
sdw_master_type. The SoundWire slave support is slightly modified with
the use of a sdw_slave_type, and the uevent handling move to
slave.c (since it's not necessary for the master).
No functionality change other than moving code around.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Acked-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20200518174322.31561-3-yung-chuan.liao@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/soundwire/slave.c')
-rw-r--r-- | drivers/soundwire/slave.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/soundwire/slave.c b/drivers/soundwire/slave.c index 4bacdb187eab..0839445ee07b 100644 --- a/drivers/soundwire/slave.c +++ b/drivers/soundwire/slave.c @@ -14,6 +14,12 @@ static void sdw_slave_release(struct device *dev) kfree(slave); } +struct device_type sdw_slave_type = { + .name = "sdw_slave", + .release = sdw_slave_release, + .uevent = sdw_slave_uevent, +}; + static int sdw_slave_add(struct sdw_bus *bus, struct sdw_slave_id *id, struct fwnode_handle *fwnode) { @@ -41,9 +47,9 @@ static int sdw_slave_add(struct sdw_bus *bus, id->class_id, id->unique_id); } - slave->dev.release = sdw_slave_release; slave->dev.bus = &sdw_bus_type; slave->dev.of_node = of_node_get(to_of_node(fwnode)); + slave->dev.type = &sdw_slave_type; slave->bus = bus; slave->status = SDW_SLAVE_UNATTACHED; init_completion(&slave->enumeration_complete); |