Skip to content

Commit 533b81d

Browse files
cometzeromartinkpetersen
authored andcommitted
scsi: ufs: ufs-exynos: Support custom version of ufs_hba_variant_ops
By default, ufs_hba_exynos_ops will be used. Add support for a custom version of ufs_hba_variant_ops because some variants of exynos-ufs will use only few callbacks. Link: https://lore.kernel.org/r/20211018124216.153072-8-chanho61.park@samsung.com Cc: Alim Akhtar <alim.akhtar@samsung.com> Cc: Kiwoong Kim <kwmad.kim@samsung.com> Cc: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com> Signed-off-by: Chanho Park <chanho61.park@samsung.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 91c49e7 commit 533b81d

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

drivers/scsi/ufs/ufs-exynos.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1237,8 +1237,14 @@ static int exynos_ufs_probe(struct platform_device *pdev)
12371237
{
12381238
int err;
12391239
struct device *dev = &pdev->dev;
1240+
const struct ufs_hba_variant_ops *vops = &ufs_hba_exynos_ops;
1241+
const struct exynos_ufs_drv_data *drv_data =
1242+
device_get_match_data(dev);
12401243

1241-
err = ufshcd_pltfrm_init(pdev, &ufs_hba_exynos_ops);
1244+
if (drv_data && drv_data->vops)
1245+
vops = drv_data->vops;
1246+
1247+
err = ufshcd_pltfrm_init(pdev, vops);
12421248
if (err)
12431249
dev_err(dev, "ufshcd_pltfrm_init() failed %d\n", err);
12441250

drivers/scsi/ufs/ufs-exynos.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ struct exynos_ufs_uic_attr {
142142
};
143143

144144
struct exynos_ufs_drv_data {
145+
const struct ufs_hba_variant_ops *vops;
145146
struct exynos_ufs_uic_attr *uic_attr;
146147
unsigned int quirks;
147148
unsigned int opts;

0 commit comments

Comments
 (0)