Commit 45cb70f9 authored by Pierre-Louis Bossart's avatar Pierre-Louis Bossart Committed by Vinod Koul

soundwire: bus: remove sdw_defer argument in sdw_transfer_defer()

There's no point in passing an argument that is a pointer to a bus
member. We can directly get the member and do an indirection when
needed.

This is a first step before simplifying the hardware-specific
callbacks further.
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: default avatarBard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230119073211.85979-3-yung-chuan.liao@linux.intel.comSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent 5ec0c872
...@@ -225,9 +225,9 @@ static inline int do_transfer(struct sdw_bus *bus, struct sdw_msg *msg) ...@@ -225,9 +225,9 @@ static inline int do_transfer(struct sdw_bus *bus, struct sdw_msg *msg)
} }
static inline int do_transfer_defer(struct sdw_bus *bus, static inline int do_transfer_defer(struct sdw_bus *bus,
struct sdw_msg *msg, struct sdw_msg *msg)
struct sdw_defer *defer)
{ {
struct sdw_defer *defer = &bus->defer_msg;
int retry = bus->prop.err_threshold; int retry = bus->prop.err_threshold;
enum sdw_command_response resp; enum sdw_command_response resp;
int ret = 0, i; int ret = 0, i;
...@@ -315,19 +315,17 @@ EXPORT_SYMBOL(sdw_show_ping_status); ...@@ -315,19 +315,17 @@ EXPORT_SYMBOL(sdw_show_ping_status);
* sdw_transfer_defer() - Asynchronously transfer message to a SDW Slave device * sdw_transfer_defer() - Asynchronously transfer message to a SDW Slave device
* @bus: SDW bus * @bus: SDW bus
* @msg: SDW message to be xfered * @msg: SDW message to be xfered
* @defer: Defer block for signal completion
* *
* Caller needs to hold the msg_lock lock while calling this * Caller needs to hold the msg_lock lock while calling this
*/ */
int sdw_transfer_defer(struct sdw_bus *bus, struct sdw_msg *msg, int sdw_transfer_defer(struct sdw_bus *bus, struct sdw_msg *msg)
struct sdw_defer *defer)
{ {
int ret; int ret;
if (!bus->ops->xfer_msg_defer) if (!bus->ops->xfer_msg_defer)
return -ENOTSUPP; return -ENOTSUPP;
ret = do_transfer_defer(bus, msg, defer); ret = do_transfer_defer(bus, msg);
if (ret != 0 && ret != -ENODATA) if (ret != 0 && ret != -ENODATA)
dev_err(bus->dev, "Defer trf on Slave %d failed:%d\n", dev_err(bus->dev, "Defer trf on Slave %d failed:%d\n",
msg->dev_num, ret); msg->dev_num, ret);
......
...@@ -151,8 +151,7 @@ int sdw_configure_dpn_intr(struct sdw_slave *slave, int port, ...@@ -151,8 +151,7 @@ int sdw_configure_dpn_intr(struct sdw_slave *slave, int port,
bool enable, int mask); bool enable, int mask);
int sdw_transfer(struct sdw_bus *bus, struct sdw_msg *msg); int sdw_transfer(struct sdw_bus *bus, struct sdw_msg *msg);
int sdw_transfer_defer(struct sdw_bus *bus, struct sdw_msg *msg, int sdw_transfer_defer(struct sdw_bus *bus, struct sdw_msg *msg);
struct sdw_defer *defer);
#define SDW_READ_INTR_CLEAR_RETRY 10 #define SDW_READ_INTR_CLEAR_RETRY 10
......
...@@ -684,8 +684,6 @@ static int sdw_bank_switch(struct sdw_bus *bus, int m_rt_count) ...@@ -684,8 +684,6 @@ static int sdw_bank_switch(struct sdw_bus *bus, int m_rt_count)
if (!wr_msg) if (!wr_msg)
return -ENOMEM; return -ENOMEM;
bus->defer_msg.msg = wr_msg;
wbuf = kzalloc(sizeof(*wbuf), GFP_KERNEL); wbuf = kzalloc(sizeof(*wbuf), GFP_KERNEL);
if (!wbuf) { if (!wbuf) {
ret = -ENOMEM; ret = -ENOMEM;
...@@ -713,7 +711,7 @@ static int sdw_bank_switch(struct sdw_bus *bus, int m_rt_count) ...@@ -713,7 +711,7 @@ static int sdw_bank_switch(struct sdw_bus *bus, int m_rt_count)
multi_link = bus->multi_link && (m_rt_count >= bus->hw_sync_min_links); multi_link = bus->multi_link && (m_rt_count >= bus->hw_sync_min_links);
if (multi_link) if (multi_link)
ret = sdw_transfer_defer(bus, wr_msg, &bus->defer_msg); ret = sdw_transfer_defer(bus, wr_msg);
else else
ret = sdw_transfer(bus, wr_msg); ret = sdw_transfer(bus, wr_msg);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment