ANDROID: scsi: ufs: Rename struct ufs_hba_with_hpb into ufs_hba_add_info

Before adding more data members in struct ufs_hba_with_hpb, rename this
data structure. This patch does not change any functionality.

Bug: 200291871
Change-Id: I6b0365ebcf8adf6cfa009218d8c4dc96fa629bde
Signed-off-by: Bart Van Assche <bvanassche@google.com>
This commit is contained in:
Bart Van Assche
2021-10-01 11:37:25 -07:00
committed by Jaegeuk Kim
parent 5adc3c4124
commit 7b6860d2a4
4 changed files with 29 additions and 14 deletions

View File

@@ -0,0 +1,24 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
#ifndef _UFSHCD_ADD_INFO_H_
#define _UFSHCD_ADD_INFO_H_
/*
* Compared to the upstream equivalent, @hpb_dev has been moved from struct
* ufs_hba into struct ufs_hba_add_info to satisfy the Android ABI checks.
* Do NOT use this data structure in any out-of-tree driver since it is not
* covered by the GKI.
*/
struct ufs_hba_add_info {
struct ufs_hba hba;
#ifdef CONFIG_SCSI_UFS_HPB
struct ufshpb_dev_info hpb_dev;
#endif
};
static inline struct ufs_hba_add_info *ufs_hba_add_info(struct ufs_hba *hba)
{
return container_of(hba, struct ufs_hba_add_info, hba);
}
#endif /* _UFSHCD_ADD_INFO_H_ */

View File

@@ -17,6 +17,7 @@
#include <linux/blk-pm.h> #include <linux/blk-pm.h>
#include <linux/blkdev.h> #include <linux/blkdev.h>
#include "ufshcd.h" #include "ufshcd.h"
#include "ufshcd-add-info.h"
#include "ufs_quirks.h" #include "ufs_quirks.h"
#include "unipro.h" #include "unipro.h"
#include "ufs-sysfs.h" #include "ufs-sysfs.h"
@@ -9325,7 +9326,7 @@ int ufshcd_alloc_host(struct device *dev, struct ufs_hba **hba_handle)
} }
host = scsi_host_alloc(&ufshcd_driver_template, host = scsi_host_alloc(&ufshcd_driver_template,
sizeof(struct ufs_hba_with_hpb)); sizeof(struct ufs_hba_add_info));
if (!host) { if (!host) {
dev_err(dev, "scsi_host_alloc failed\n"); dev_err(dev, "scsi_host_alloc failed\n");
err = -ENOMEM; err = -ENOMEM;

View File

@@ -913,7 +913,7 @@ struct ufs_hba {
struct delayed_work rpm_dev_flush_recheck_work; struct delayed_work rpm_dev_flush_recheck_work;
#if 0 #if 0
/* This has been moved into struct ufs_hba_with_hpb. */ /* This has been moved into struct ufs_hba_add_info. */
struct ufshpb_dev_info ufshpb_dev; struct ufshpb_dev_info ufshpb_dev;
#endif #endif
@@ -935,17 +935,6 @@ struct ufs_hba {
ANDROID_KABI_RESERVE(4); ANDROID_KABI_RESERVE(4);
}; };
/*
* Compared to the upstream equivalent, @hpb_dev has been moved from struct
* ufs_hba into struct ufs_hba_with_hpb to satisfy the Android ABI checks.
*/
struct ufs_hba_with_hpb {
struct ufs_hba hba;
#ifdef CONFIG_SCSI_UFS_HPB
struct ufshpb_dev_info hpb_dev;
#endif
};
/* Returns true if clocks can be gated. Otherwise false */ /* Returns true if clocks can be gated. Otherwise false */
static inline bool ufshcd_is_clkgating_allowed(struct ufs_hba *hba) static inline bool ufshcd_is_clkgating_allowed(struct ufs_hba *hba)
{ {

View File

@@ -13,6 +13,7 @@
#include <linux/async.h> #include <linux/async.h>
#include "ufshcd.h" #include "ufshcd.h"
#include "ufshcd-add-info.h"
#include "ufshpb.h" #include "ufshpb.h"
#include "../sd.h" #include "../sd.h"
@@ -37,7 +38,7 @@ static void ufshpb_update_active_info(struct ufshpb_lu *hpb, int rgn_idx,
static inline struct ufshpb_dev_info *ufs_hba_to_hpb(struct ufs_hba *hba) static inline struct ufshpb_dev_info *ufs_hba_to_hpb(struct ufs_hba *hba)
{ {
return &container_of(hba, struct ufs_hba_with_hpb, hba)->hpb_dev; return &ufs_hba_add_info(hba)->hpb_dev;
} }
bool ufshpb_is_allowed(struct ufs_hba *hba) bool ufshpb_is_allowed(struct ufs_hba *hba)