Skip to content

Commit

Permalink
scsi: ufs: ufs-exynos: Support custom version of ufs_hba_variant_ops
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Chanho Park authored and Martin K. Petersen committed Oct 28, 2021
1 parent 91c49e7 commit 533b81d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/scsi/ufs/ufs-exynos.c
Original file line number Diff line number Diff line change
Expand Up @@ -1237,8 +1237,14 @@ static int exynos_ufs_probe(struct platform_device *pdev)
{
int err;
struct device *dev = &pdev->dev;
const struct ufs_hba_variant_ops *vops = &ufs_hba_exynos_ops;
const struct exynos_ufs_drv_data *drv_data =
device_get_match_data(dev);

err = ufshcd_pltfrm_init(pdev, &ufs_hba_exynos_ops);
if (drv_data && drv_data->vops)
vops = drv_data->vops;

err = ufshcd_pltfrm_init(pdev, vops);
if (err)
dev_err(dev, "ufshcd_pltfrm_init() failed %d\n", err);

Expand Down
1 change: 1 addition & 0 deletions drivers/scsi/ufs/ufs-exynos.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ struct exynos_ufs_uic_attr {
};

struct exynos_ufs_drv_data {
const struct ufs_hba_variant_ops *vops;
struct exynos_ufs_uic_attr *uic_attr;
unsigned int quirks;
unsigned int opts;
Expand Down

0 comments on commit 533b81d

Please sign in to comment.