Skip to content

Commit 543a827

Browse files
Stanley Chumartinkpetersen
authored andcommitted
scsi: core: Clean up struct ufs_saved_pwr_info
The "is_valid" field of the struct ufs_saved_pwr_info is no longer used, and this struct can be replaced by struct ufs_pa_layer_attr without any changes to the functionality. Signed-off-by: Stanley Chu <stanley.chu@mediatek.com> Link: https://lore.kernel.org/r/20230330012918.13748-1-stanley.chu@mediatek.com Reviewed-by: Avri Altman <avri.altman@wdc.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent f467b86 commit 543a827

2 files changed

Lines changed: 4 additions & 10 deletions

File tree

drivers/ufs/core/ufshcd.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,7 +1269,7 @@ static int ufshcd_scale_gear(struct ufs_hba *hba, bool scale_up)
12691269
struct ufs_pa_layer_attr new_pwr_info;
12701270

12711271
if (scale_up) {
1272-
memcpy(&new_pwr_info, &hba->clk_scaling.saved_pwr_info.info,
1272+
memcpy(&new_pwr_info, &hba->clk_scaling.saved_pwr_info,
12731273
sizeof(struct ufs_pa_layer_attr));
12741274
} else {
12751275
memcpy(&new_pwr_info, &hba->pwr_info,
@@ -1278,7 +1278,7 @@ static int ufshcd_scale_gear(struct ufs_hba *hba, bool scale_up)
12781278
if (hba->pwr_info.gear_tx > hba->clk_scaling.min_gear ||
12791279
hba->pwr_info.gear_rx > hba->clk_scaling.min_gear) {
12801280
/* save the current power mode */
1281-
memcpy(&hba->clk_scaling.saved_pwr_info.info,
1281+
memcpy(&hba->clk_scaling.saved_pwr_info,
12821282
&hba->pwr_info,
12831283
sizeof(struct ufs_pa_layer_attr));
12841284

@@ -10349,10 +10349,9 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base, unsigned int irq)
1034910349

1035010350
/* Initialize devfreq */
1035110351
if (ufshcd_is_clkscaling_supported(hba)) {
10352-
memcpy(&hba->clk_scaling.saved_pwr_info.info,
10352+
memcpy(&hba->clk_scaling.saved_pwr_info,
1035310353
&hba->pwr_info,
1035410354
sizeof(struct ufs_pa_layer_attr));
10355-
hba->clk_scaling.saved_pwr_info.is_valid = true;
1035610355
hba->clk_scaling.is_allowed = true;
1035710356

1035810357
err = ufshcd_devfreq_init(hba);

include/ufs/ufshcd.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -394,11 +394,6 @@ struct ufs_clk_gating {
394394
struct workqueue_struct *clk_gating_workq;
395395
};
396396

397-
struct ufs_saved_pwr_info {
398-
struct ufs_pa_layer_attr info;
399-
bool is_valid;
400-
};
401-
402397
/**
403398
* struct ufs_clk_scaling - UFS clock scaling related data
404399
* @active_reqs: number of requests that are pending. If this is zero when
@@ -428,7 +423,7 @@ struct ufs_clk_scaling {
428423
ktime_t window_start_t;
429424
ktime_t busy_start_t;
430425
struct device_attribute enable_attr;
431-
struct ufs_saved_pwr_info saved_pwr_info;
426+
struct ufs_pa_layer_attr saved_pwr_info;
432427
struct workqueue_struct *workq;
433428
struct work_struct suspend_work;
434429
struct work_struct resume_work;

0 commit comments

Comments
 (0)