[PATCH v12 13/24] scsi: ufs: mediatek: Remove vendor kernel quirks cruft
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Mon Sep 14 05:45:46 PDT 2026
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Incomplete cleanup: unused macro, enum, and SiP command left in header file
--
commit 5f2b17479ebe3d92418015f1a81b60d943aa3ac6
Author: Nicolas Frattaroli <nicolas.frattaroli at collabora.com>
scsi: ufs: mediatek: Remove vendor kernel quirks cruft
Both ufs_mtk_vreg_fix_vcc and ufs_mtk_vreg_fix_vccqx look like they are
vendor kernel hacks to work around existing downstream device trees.
Mainline does not need or want them, so remove them.
> diff --git a/drivers/ufs/host/ufs-mediatek.c b/drivers/ufs/host/ufs-mediatek.c
> index 3d108a0929205..3c10a9fd09dfc 100644
> --- a/drivers/ufs/host/ufs-mediatek.c
> +++ b/drivers/ufs/host/ufs-mediatek.c
> @@ -1053,73 +1053,6 @@ static void ufs_mtk_init_clocks(struct ufs_hba *hba)
> }
> }
>
> -#define MAX_VCC_NAME 30
> -static int ufs_mtk_vreg_fix_vcc(struct ufs_hba *hba)
> -{
[ ... ]
> - if (of_property_read_bool(np, "mediatek,ufs-vcc-by-num")) {
> - ufs_mtk_get_vcc_num(res);
> - if (res.a1 > UFS_VCC_NONE && res.a1 < UFS_VCC_MAX)
[Severity: Low]
With the removal of this function, does this also mean that
ufs_mtk_get_vcc_num(), enum ufs_mtk_vcc_num, and UFS_MTK_SIP_GET_VCC_NUM
are now entirely unused?
Looking at drivers/ufs/host/ufs-mediatek-sip.h, it seems like these were
only used here and could be removed as well to avoid leaving dead code behind:
drivers/ufs/host/ufs-mediatek-sip.h:
#define UFS_MTK_SIP_GET_VCC_NUM BIT(6)
...
enum ufs_mtk_vcc_num {
UFS_VCC_NONE = 0,
UFS_VCC_1,
UFS_VCC_2,
UFS_VCC_MAX
};
...
#define ufs_mtk_get_vcc_num(res) \
ufs_mtk_smc(UFS_MTK_SIP_GET_VCC_NUM, &(res))
Could these be cleaned up in this patch as well?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260914-mt8196-ufs-v12-0-9279d7ef814d@collabora.com?part=13
More information about the linux-phy
mailing list