Skip to content

Commit ebf8506

Browse files
nxpfranklivinodkoul
authored andcommitted
dmaengine: fsl-dpaa2-qdma: Add dpdmai_cmd_open
Introduce the structures dpdmai_cmd_open to maintain consistency within the API calls of the driver. Signed-off-by: Frank Li <Frank.Li@nxp.com> Link: https://lore.kernel.org/r/20240320-dpaa2-v1-3-eb56e47c94ec@nxp.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent 26a4d2a commit ebf8506

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

drivers/dma/fsl-dpaa2-qdma/dpdmai.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ struct dpdmai_rsp_get_tx_queue {
3333
__le32 fqid;
3434
};
3535

36+
struct dpdmai_cmd_open {
37+
__le32 dpdmai_id;
38+
} __packed;
39+
3640
static inline u64 mc_enc(int lsoffset, int width, u64 val)
3741
{
3842
return (val & MAKE_UMASK64(width)) << lsoffset;
@@ -58,16 +62,16 @@ static inline u64 mc_enc(int lsoffset, int width, u64 val)
5862
int dpdmai_open(struct fsl_mc_io *mc_io, u32 cmd_flags,
5963
int dpdmai_id, u16 *token)
6064
{
65+
struct dpdmai_cmd_open *cmd_params;
6166
struct fsl_mc_command cmd = { 0 };
62-
__le64 *cmd_dpdmai_id;
6367
int err;
6468

6569
/* prepare command */
6670
cmd.header = mc_encode_cmd_header(DPDMAI_CMDID_OPEN,
6771
cmd_flags, 0);
6872

69-
cmd_dpdmai_id = cmd.params;
70-
*cmd_dpdmai_id = cpu_to_le32(dpdmai_id);
73+
cmd_params = (struct dpdmai_cmd_open *)&cmd.params;
74+
cmd_params->dpdmai_id = cpu_to_le32(dpdmai_id);
7175

7276
/* send command to mc*/
7377
err = mc_send_command(mc_io, &cmd);

0 commit comments

Comments
 (0)