@@ -3993,11 +3993,11 @@ static void ufshcd_host_memory_configure(struct ufs_hba *hba)
3993
3993
*/
3994
3994
static int ufshcd_dme_link_startup (struct ufs_hba * hba )
3995
3995
{
3996
- struct uic_command uic_cmd = {0 };
3996
+ struct uic_command uic_cmd = {
3997
+ .command = UIC_CMD_DME_LINK_STARTUP ,
3998
+ };
3997
3999
int ret ;
3998
4000
3999
- uic_cmd .command = UIC_CMD_DME_LINK_STARTUP ;
4000
-
4001
4001
ret = ufshcd_send_uic_cmd (hba , & uic_cmd );
4002
4002
if (ret )
4003
4003
dev_dbg (hba -> dev ,
@@ -4015,11 +4015,11 @@ static int ufshcd_dme_link_startup(struct ufs_hba *hba)
4015
4015
*/
4016
4016
static int ufshcd_dme_reset (struct ufs_hba * hba )
4017
4017
{
4018
- struct uic_command uic_cmd = {0 };
4018
+ struct uic_command uic_cmd = {
4019
+ .command = UIC_CMD_DME_RESET ,
4020
+ };
4019
4021
int ret ;
4020
4022
4021
- uic_cmd .command = UIC_CMD_DME_RESET ;
4022
-
4023
4023
ret = ufshcd_send_uic_cmd (hba , & uic_cmd );
4024
4024
if (ret )
4025
4025
dev_err (hba -> dev ,
@@ -4054,11 +4054,11 @@ EXPORT_SYMBOL_GPL(ufshcd_dme_configure_adapt);
4054
4054
*/
4055
4055
static int ufshcd_dme_enable (struct ufs_hba * hba )
4056
4056
{
4057
- struct uic_command uic_cmd = {0 };
4057
+ struct uic_command uic_cmd = {
4058
+ .command = UIC_CMD_DME_ENABLE ,
4059
+ };
4058
4060
int ret ;
4059
4061
4060
- uic_cmd .command = UIC_CMD_DME_ENABLE ;
4061
-
4062
4062
ret = ufshcd_send_uic_cmd (hba , & uic_cmd );
4063
4063
if (ret )
4064
4064
dev_err (hba -> dev ,
@@ -4111,7 +4111,12 @@ static inline void ufshcd_add_delay_before_dme_cmd(struct ufs_hba *hba)
4111
4111
int ufshcd_dme_set_attr (struct ufs_hba * hba , u32 attr_sel ,
4112
4112
u8 attr_set , u32 mib_val , u8 peer )
4113
4113
{
4114
- struct uic_command uic_cmd = {0 };
4114
+ struct uic_command uic_cmd = {
4115
+ .command = peer ? UIC_CMD_DME_PEER_SET : UIC_CMD_DME_SET ,
4116
+ .argument1 = attr_sel ,
4117
+ .argument2 = UIC_ARG_ATTR_TYPE (attr_set ),
4118
+ .argument3 = mib_val ,
4119
+ };
4115
4120
static const char * const action [] = {
4116
4121
"dme-set" ,
4117
4122
"dme-peer-set"
@@ -4120,12 +4125,6 @@ int ufshcd_dme_set_attr(struct ufs_hba *hba, u32 attr_sel,
4120
4125
int ret ;
4121
4126
int retries = UFS_UIC_COMMAND_RETRIES ;
4122
4127
4123
- uic_cmd .command = peer ?
4124
- UIC_CMD_DME_PEER_SET : UIC_CMD_DME_SET ;
4125
- uic_cmd .argument1 = attr_sel ;
4126
- uic_cmd .argument2 = UIC_ARG_ATTR_TYPE (attr_set );
4127
- uic_cmd .argument3 = mib_val ;
4128
-
4129
4128
do {
4130
4129
/* for peer attributes we retry upon failure */
4131
4130
ret = ufshcd_send_uic_cmd (hba , & uic_cmd );
@@ -4155,7 +4154,10 @@ EXPORT_SYMBOL_GPL(ufshcd_dme_set_attr);
4155
4154
int ufshcd_dme_get_attr (struct ufs_hba * hba , u32 attr_sel ,
4156
4155
u32 * mib_val , u8 peer )
4157
4156
{
4158
- struct uic_command uic_cmd = {0 };
4157
+ struct uic_command uic_cmd = {
4158
+ .command = peer ? UIC_CMD_DME_PEER_GET : UIC_CMD_DME_GET ,
4159
+ .argument1 = attr_sel ,
4160
+ };
4159
4161
static const char * const action [] = {
4160
4162
"dme-get" ,
4161
4163
"dme-peer-get"
@@ -4189,10 +4191,6 @@ int ufshcd_dme_get_attr(struct ufs_hba *hba, u32 attr_sel,
4189
4191
}
4190
4192
}
4191
4193
4192
- uic_cmd .command = peer ?
4193
- UIC_CMD_DME_PEER_GET : UIC_CMD_DME_GET ;
4194
- uic_cmd .argument1 = attr_sel ;
4195
-
4196
4194
do {
4197
4195
/* for peer attributes we retry upon failure */
4198
4196
ret = ufshcd_send_uic_cmd (hba , & uic_cmd );
@@ -4325,7 +4323,11 @@ static int ufshcd_uic_pwr_ctrl(struct ufs_hba *hba, struct uic_command *cmd)
4325
4323
*/
4326
4324
int ufshcd_uic_change_pwr_mode (struct ufs_hba * hba , u8 mode )
4327
4325
{
4328
- struct uic_command uic_cmd = {0 };
4326
+ struct uic_command uic_cmd = {
4327
+ .command = UIC_CMD_DME_SET ,
4328
+ .argument1 = UIC_ARG_MIB (PA_PWRMODE ),
4329
+ .argument3 = mode ,
4330
+ };
4329
4331
int ret ;
4330
4332
4331
4333
if (hba -> quirks & UFSHCD_QUIRK_BROKEN_PA_RXHSUNTERMCAP ) {
@@ -4338,9 +4340,6 @@ int ufshcd_uic_change_pwr_mode(struct ufs_hba *hba, u8 mode)
4338
4340
}
4339
4341
}
4340
4342
4341
- uic_cmd .command = UIC_CMD_DME_SET ;
4342
- uic_cmd .argument1 = UIC_ARG_MIB (PA_PWRMODE );
4343
- uic_cmd .argument3 = mode ;
4344
4343
ufshcd_hold (hba );
4345
4344
ret = ufshcd_uic_pwr_ctrl (hba , & uic_cmd );
4346
4345
ufshcd_release (hba );
@@ -4381,13 +4380,14 @@ EXPORT_SYMBOL_GPL(ufshcd_link_recovery);
4381
4380
4382
4381
int ufshcd_uic_hibern8_enter (struct ufs_hba * hba )
4383
4382
{
4384
- int ret ;
4385
- struct uic_command uic_cmd = {0 };
4383
+ struct uic_command uic_cmd = {
4384
+ .command = UIC_CMD_DME_HIBER_ENTER ,
4385
+ };
4386
4386
ktime_t start = ktime_get ();
4387
+ int ret ;
4387
4388
4388
4389
ufshcd_vops_hibern8_notify (hba , UIC_CMD_DME_HIBER_ENTER , PRE_CHANGE );
4389
4390
4390
- uic_cmd .command = UIC_CMD_DME_HIBER_ENTER ;
4391
4391
ret = ufshcd_uic_pwr_ctrl (hba , & uic_cmd );
4392
4392
trace_ufshcd_profile_hibern8 (dev_name (hba -> dev ), "enter" ,
4393
4393
ktime_to_us (ktime_sub (ktime_get (), start )), ret );
@@ -4405,13 +4405,14 @@ EXPORT_SYMBOL_GPL(ufshcd_uic_hibern8_enter);
4405
4405
4406
4406
int ufshcd_uic_hibern8_exit (struct ufs_hba * hba )
4407
4407
{
4408
- struct uic_command uic_cmd = {0 };
4408
+ struct uic_command uic_cmd = {
4409
+ .command = UIC_CMD_DME_HIBER_EXIT ,
4410
+ };
4409
4411
int ret ;
4410
4412
ktime_t start = ktime_get ();
4411
4413
4412
4414
ufshcd_vops_hibern8_notify (hba , UIC_CMD_DME_HIBER_EXIT , PRE_CHANGE );
4413
4415
4414
- uic_cmd .command = UIC_CMD_DME_HIBER_EXIT ;
4415
4416
ret = ufshcd_uic_pwr_ctrl (hba , & uic_cmd );
4416
4417
trace_ufshcd_profile_hibern8 (dev_name (hba -> dev ), "exit" ,
4417
4418
ktime_to_us (ktime_sub (ktime_get (), start )), ret );
0 commit comments