RE: [PATCH v3 10/17] scsi: ufs: ufs-exynos: support custom version of ufs_hba_variant_ops

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




>-----Original Message-----
>From: Chanho Park [mailto:chanho61.park@xxxxxxxxxxx]
>Sent: Friday, September 17, 2021 12:24 PM
>To: Alim Akhtar <alim.akhtar@xxxxxxxxxxx>; Avri Altman
><avri.altman@xxxxxxx>; James E . J . Bottomley <jejb@xxxxxxxxxxxxx>; Martin
>K . Petersen <martin.petersen@xxxxxxxxxx>; Krzysztof Kozlowski
><krzysztof.kozlowski@xxxxxxxxxxxxx>
>Cc: Bean Huo <beanhuo@xxxxxxxxxx>; Bart Van Assche
><bvanassche@xxxxxxx>; Adrian Hunter <adrian.hunter@xxxxxxxxx>; Christoph
>Hellwig <hch@xxxxxxxxxxxxx>; Can Guo <cang@xxxxxxxxxxxxxx>; Jaegeuk Kim
><jaegeuk@xxxxxxxxxx>; Gyunghoon Kwon <goodjob.kwon@xxxxxxxxxxx>;
>linux-samsung-soc@xxxxxxxxxxxxxxx; linux-scsi@xxxxxxxxxxxxxxx; Chanho Park
><chanho61.park@xxxxxxxxxxx>; Kiwoong Kim <kwmad.kim@xxxxxxxxxxx>
>Subject: [PATCH v3 10/17] scsi: ufs: ufs-exynos: support custom version of
>ufs_hba_variant_ops
>
>By default, ufs_hba_exynos_ops will be used but this patch supports to use
>custom version of ufs_hba_variant_ops because some variants of exynos-ufs will
>use only few callbacks.
>
>Cc: Alim Akhtar <alim.akhtar@xxxxxxxxxxx>
>Cc: Kiwoong Kim <kwmad.kim@xxxxxxxxxxx>
>Cc: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxxxxx>
>Signed-off-by: Chanho Park <chanho61.park@xxxxxxxxxxx>
>---
Reviewed-by: Alim Akhtar <alim.akhtar@xxxxxxxxxxx>

> drivers/scsi/ufs/ufs-exynos.c | 8 +++++++-  drivers/scsi/ufs/ufs-exynos.h | 1 +
> 2 files changed, 8 insertions(+), 1 deletion(-)
>
>diff --git a/drivers/scsi/ufs/ufs-exynos.c b/drivers/scsi/ufs/ufs-exynos.c index
>e32f7d09db1a..a3160d9bd234 100644
>--- a/drivers/scsi/ufs/ufs-exynos.c
>+++ b/drivers/scsi/ufs/ufs-exynos.c
>@@ -1238,8 +1238,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);
>
>diff --git a/drivers/scsi/ufs/ufs-exynos.h b/drivers/scsi/ufs/ufs-exynos.h index
>4f93db893ce8..bc4b8b0324bd 100644
>--- a/drivers/scsi/ufs/ufs-exynos.h
>+++ b/drivers/scsi/ufs/ufs-exynos.h
>@@ -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;
>--
>2.33.0






[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux