Re: [PATCH v12 13/24] scsi: ufs: mediatek: Remove vendor kernel quirks cruft

From
sashiko-bot@kernel.org
Date
2026-09-14 12:45:46
Also in
linux-devicetree, linux-scsi
Reply to
Louis-Alexis Eyraud, 2026-09-14
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 [off-list ref]

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.
quoted hunk ↗ jump to hunk
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

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
Thread (38 messages) 38 messages, 4 authors, last reply 2026-09-24
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help