soundwire: cadence: further simplify low-level xfer_msg_defer() callback
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Thu, 19 Jan 2023 07:32:11 +0000 (15:32 +0800)
committerVinod Koul <vkoul@kernel.org>
Tue, 31 Jan 2023 14:31:52 +0000 (20:01 +0530)
The message pointer is already stored in the bus->defer structure, not
need to pass it as an argument.

Suggested-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20230119073211.85979-5-yung-chuan.liao@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/soundwire/bus.c
drivers/soundwire/cadence_master.c
drivers/soundwire/cadence_master.h
include/linux/soundwire/sdw.h

index 29d644bb4020118a084e6a874bcb3ad7f8e01110..b6aca59c313003f7e4edb536571f05e6270a8b89 100644 (file)
@@ -237,7 +237,7 @@ static inline int do_transfer_defer(struct sdw_bus *bus,
        init_completion(&defer->complete);
 
        for (i = 0; i <= retry; i++) {
-               resp = bus->ops->xfer_msg_defer(bus, msg);
+               resp = bus->ops->xfer_msg_defer(bus);
                ret = find_response_code(resp);
                /* if cmd is ok or ignored return */
                if (ret == 0 || ret == -ENODATA)
index 65fcb28c8f5824331c139d05220452b1267f0e12..e835dabb516c48e9684b93aa4f31585b614caf5f 100644 (file)
@@ -749,10 +749,11 @@ cdns_xfer_msg(struct sdw_bus *bus, struct sdw_msg *msg)
 EXPORT_SYMBOL(cdns_xfer_msg);
 
 enum sdw_command_response
-cdns_xfer_msg_defer(struct sdw_bus *bus,
-                   struct sdw_msg *msg)
+cdns_xfer_msg_defer(struct sdw_bus *bus)
 {
        struct sdw_cdns *cdns = bus_to_cdns(bus);
+       struct sdw_defer *defer = &bus->defer_msg;
+       struct sdw_msg *msg = defer->msg;
        int cmd = 0, ret;
 
        /* for defer only 1 message is supported */
index 90289a3dd505751fd53dfda5d08023d40ac009c4..dec0b4f993c1a8d518ac4d20b1e00b61dc495b21 100644 (file)
@@ -184,7 +184,7 @@ enum sdw_command_response
 cdns_xfer_msg(struct sdw_bus *bus, struct sdw_msg *msg);
 
 enum sdw_command_response
-cdns_xfer_msg_defer(struct sdw_bus *bus, struct sdw_msg *msg);
+cdns_xfer_msg_defer(struct sdw_bus *bus);
 
 u32 cdns_read_ping_status(struct sdw_bus *bus);
 
index 9e5fc03072845189299693a110af5cf032dcdc2e..d09a9857e1de51f83931233739cd5ca177461955 100644 (file)
@@ -837,7 +837,8 @@ struct sdw_defer {
  * @read_prop: Read Master properties
  * @override_adr: Override value read from firmware (quirk for buggy firmware)
  * @xfer_msg: Transfer message callback
- * @xfer_msg_defer: Defer version of transfer message callback
+ * @xfer_msg_defer: Defer version of transfer message callback. The message is handled with the
+ * bus struct @sdw_defer
  * @set_bus_conf: Set the bus configuration
  * @pre_bank_switch: Callback for pre bank switch
  * @post_bank_switch: Callback for post bank switch
@@ -851,7 +852,7 @@ struct sdw_master_ops {
        enum sdw_command_response (*xfer_msg)
                        (struct sdw_bus *bus, struct sdw_msg *msg);
        enum sdw_command_response (*xfer_msg_defer)
-                       (struct sdw_bus *bus, struct sdw_msg *msg);
+                       (struct sdw_bus *bus);
        int (*set_bus_conf)(struct sdw_bus *bus,
                        struct sdw_bus_params *params);
        int (*pre_bank_switch)(struct sdw_bus *bus);