[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200504145622.13895-4-stanley.chu@mediatek.com>
Date: Mon, 4 May 2020 22:56:17 +0800
From: Stanley Chu <stanley.chu@...iatek.com>
To: <linux-scsi@...r.kernel.org>, <martin.petersen@...cle.com>,
<avri.altman@....com>, <alim.akhtar@...sung.com>,
<jejb@...ux.ibm.com>, <asutoshd@...eaurora.org>
CC: <beanhuo@...ron.com>, <cang@...eaurora.org>,
<matthias.bgg@...il.com>, <bvanassche@....org>,
<linux-mediatek@...ts.infradead.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>, <kuohong.wang@...iatek.com>,
<peter.wang@...iatek.com>, <chun-hung.wu@...iatek.com>,
<andy.teng@...iatek.com>, Stanley Chu <stanley.chu@...iatek.com>
Subject: [PATCH v6 3/8] scsi: ufs: export ufs_fixup_device_setup() function
Export ufs_fixup_device_setup() to allow vendors to re-use it for
fixing device quriks on specified UFS hosts.
Signed-off-by: Stanley Chu <stanley.chu@...iatek.com>
Reviewed-by: Avri Altman <avri.altman@....com>
---
drivers/scsi/ufs/ufshcd.c | 7 ++++---
drivers/scsi/ufs/ufshcd.h | 4 +++-
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index fc1549f829cc..ba8185625109 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -6835,12 +6835,12 @@ static void ufshcd_wb_probe(struct ufs_hba *hba, u8 *desc_buf)
hba->caps &= ~UFSHCD_CAP_WB_EN;
}
-static void ufs_fixup_device_setup(struct ufs_hba *hba)
+void ufshcd_fixup_device_setup(struct ufs_hba *hba, struct ufs_dev_fix *fixups)
{
struct ufs_dev_fix *f;
struct ufs_dev_info *dev_info = &hba->dev_info;
- for (f = ufs_fixups; f->quirk; f++) {
+ for (f = fixups; f->quirk; f++) {
if ((f->wmanufacturerid == dev_info->wmanufacturerid ||
f->wmanufacturerid == UFS_ANY_VENDOR) &&
((dev_info->model &&
@@ -6849,6 +6849,7 @@ static void ufs_fixup_device_setup(struct ufs_hba *hba)
hba->dev_quirks |= f->quirk;
}
}
+EXPORT_SYMBOL_GPL(ufshcd_fixup_device_setup);
static int ufs_get_device_desc(struct ufs_hba *hba)
{
@@ -6895,7 +6896,7 @@ static int ufs_get_device_desc(struct ufs_hba *hba)
goto out;
}
- ufs_fixup_device_setup(hba);
+ ufshcd_fixup_device_setup(hba, ufs_fixups);
ufshcd_vops_fixup_dev_quirks(hba);
/*
diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h
index 5fa03e0f3bd1..f34601121880 100644
--- a/drivers/scsi/ufs/ufshcd.h
+++ b/drivers/scsi/ufs/ufshcd.h
@@ -69,6 +69,7 @@
#include <scsi/scsi_eh.h>
#include "ufs.h"
+#include "ufs_quirks.h"
#include "ufshci.h"
#define UFSHCD "ufshcd"
@@ -951,7 +952,8 @@ int ufshcd_query_flag(struct ufs_hba *hba, enum query_opcode opcode,
void ufshcd_auto_hibern8_enable(struct ufs_hba *hba);
void ufshcd_auto_hibern8_update(struct ufs_hba *hba, u32 ahit);
-
+void ufshcd_fixup_device_setup(struct ufs_hba *hba,
+ struct ufs_dev_fix *fixups);
#define SD_ASCII_STD true
#define SD_RAW false
int ufshcd_read_string_desc(struct ufs_hba *hba, u8 desc_index,
--
2.18.0
Powered by blists - more mailing lists