Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: memory: mtk-smi: Get rid of mtk_smi_larb_get/put

After adding device_link between the iommu consumer and smi-larb,
the pm_runtime_get(_sync) of smi-larb and smi-common will be called
automatically. we can get rid of mtk_smi_larb_get/put.

Signed-off-by: Yong Wu <yong.wu@mediatek.com>
Reviewed-by: Evan Green <evgreen@chromium.org>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Acked-by: Matthias Brugger <matthias.bgg@gmail.com>
Reviewed-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
Tested-by: Frank Wunderlich <frank-w@public-files.de> # BPI-R2/MT7623
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>

authored by

Yong Wu and committed by
Mauro Carvalho Chehab
dbd171df bf827570

-34
-14
drivers/memory/mtk-smi.c
··· 149 149 unsigned char *bank; 150 150 }; 151 151 152 - int mtk_smi_larb_get(struct device *larbdev) 153 - { 154 - int ret = pm_runtime_resume_and_get(larbdev); 155 - 156 - return (ret < 0) ? ret : 0; 157 - } 158 - EXPORT_SYMBOL_GPL(mtk_smi_larb_get); 159 - 160 - void mtk_smi_larb_put(struct device *larbdev) 161 - { 162 - pm_runtime_put_sync(larbdev); 163 - } 164 - EXPORT_SYMBOL_GPL(mtk_smi_larb_put); 165 - 166 152 static int 167 153 mtk_smi_larb_bind(struct device *dev, struct device *master, void *data) 168 154 {
-20
include/soc/mediatek/smi.h
··· 19 19 unsigned char bank[32]; 20 20 }; 21 21 22 - /* 23 - * mtk_smi_larb_get: Enable the power domain and clocks for this local arbiter. 24 - * It also initialize some basic setting(like iommu). 25 - * mtk_smi_larb_put: Disable the power domain and clocks for this local arbiter. 26 - * Both should be called in non-atomic context. 27 - * 28 - * Returns 0 if successful, negative on failure. 29 - */ 30 - int mtk_smi_larb_get(struct device *larbdev); 31 - void mtk_smi_larb_put(struct device *larbdev); 32 - 33 - #else 34 - 35 - static inline int mtk_smi_larb_get(struct device *larbdev) 36 - { 37 - return 0; 38 - } 39 - 40 - static inline void mtk_smi_larb_put(struct device *larbdev) { } 41 - 42 22 #endif 43 23 44 24 #endif