Skip to content

Commit b898db9

Browse files
committed
Merge tag 'soundwire-6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire
Pull soundwire updates from Vinod Koul: - Constify sdw_bus and sdw_master_type objects - use of rtd helper for better code - intel aux device remove redundant assignment * tag 'soundwire-6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire: soundwire: Use snd_soc_substream_to_rtd() to obtain rtd soundwire: constify the struct device_type usage soundwire: bus_type: make sdw_bus_type const soundwire: intel_auxdevice: remove redundant assignment to variable link_flags soundwire: stream: add missing const to Documentation
2 parents c77756d + e17aae1 commit b898db9

File tree

7 files changed

+11
-13
lines changed

7 files changed

+11
-13
lines changed

Documentation/driver-api/soundwire/stream.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,12 +324,12 @@ framework, this stream state is linked to .hw_params() operation.
324324
325325
int sdw_stream_add_master(struct sdw_bus * bus,
326326
struct sdw_stream_config * stream_config,
327-
struct sdw_ports_config * ports_config,
327+
const struct sdw_ports_config * ports_config,
328328
struct sdw_stream_runtime * stream);
329329
330330
int sdw_stream_add_slave(struct sdw_slave * slave,
331331
struct sdw_stream_config * stream_config,
332-
struct sdw_ports_config * ports_config,
332+
const struct sdw_ports_config * ports_config,
333333
struct sdw_stream_runtime * stream);
334334
335335

drivers/soundwire/bus_type.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ int sdw_slave_uevent(const struct device *dev, struct kobj_uevent_env *env)
7272
return 0;
7373
}
7474

75-
struct bus_type sdw_bus_type = {
75+
const struct bus_type sdw_bus_type = {
7676
.name = "soundwire",
7777
.match = sdw_bus_match,
7878
};

drivers/soundwire/intel_auxdevice.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -621,8 +621,6 @@ static int __maybe_unused intel_resume(struct device *dev)
621621
return 0;
622622
}
623623

624-
link_flags = md_flags >> (bus->link_id * 8);
625-
626624
if (pm_runtime_suspended(dev)) {
627625
dev_dbg(dev, "pm_runtime status was suspended, forcing active\n");
628626

drivers/soundwire/master.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ static const struct dev_pm_ops master_dev_pm = {
112112
pm_generic_runtime_resume, NULL)
113113
};
114114

115-
struct device_type sdw_master_type = {
115+
const struct device_type sdw_master_type = {
116116
.name = "soundwire_master",
117117
.release = sdw_master_device_release,
118118
.pm = &master_dev_pm,

drivers/soundwire/slave.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ static void sdw_slave_release(struct device *dev)
1616
kfree(slave);
1717
}
1818

19-
struct device_type sdw_slave_type = {
19+
const struct device_type sdw_slave_type = {
2020
.name = "sdw_slave",
2121
.release = sdw_slave_release,
2222
.uevent = sdw_slave_uevent,

drivers/soundwire/stream.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1718,7 +1718,7 @@ EXPORT_SYMBOL(sdw_deprepare_stream);
17181718
static int set_stream(struct snd_pcm_substream *substream,
17191719
struct sdw_stream_runtime *sdw_stream)
17201720
{
1721-
struct snd_soc_pcm_runtime *rtd = substream->private_data;
1721+
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
17221722
struct snd_soc_dai *dai;
17231723
int ret = 0;
17241724
int i;
@@ -1771,7 +1771,7 @@ EXPORT_SYMBOL(sdw_alloc_stream);
17711771
int sdw_startup_stream(void *sdw_substream)
17721772
{
17731773
struct snd_pcm_substream *substream = sdw_substream;
1774-
struct snd_soc_pcm_runtime *rtd = substream->private_data;
1774+
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
17751775
struct sdw_stream_runtime *sdw_stream;
17761776
char *name;
17771777
int ret;
@@ -1815,7 +1815,7 @@ EXPORT_SYMBOL(sdw_startup_stream);
18151815
void sdw_shutdown_stream(void *sdw_substream)
18161816
{
18171817
struct snd_pcm_substream *substream = sdw_substream;
1818-
struct snd_soc_pcm_runtime *rtd = substream->private_data;
1818+
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
18191819
struct sdw_stream_runtime *sdw_stream;
18201820
struct snd_soc_dai *dai;
18211821

include/linux/soundwire/sdw_type.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
#ifndef __SOUNDWIRE_TYPES_H
55
#define __SOUNDWIRE_TYPES_H
66

7-
extern struct bus_type sdw_bus_type;
8-
extern struct device_type sdw_slave_type;
9-
extern struct device_type sdw_master_type;
7+
extern const struct bus_type sdw_bus_type;
8+
extern const struct device_type sdw_slave_type;
9+
extern const struct device_type sdw_master_type;
1010

1111
static inline int is_sdw_slave(const struct device *dev)
1212
{

0 commit comments

Comments
 (0)