Skip to content

Commit 1a8bf35

Browse files
committed
PCI: meson: Remove cast between incompatible function type
Rather than casting void(*)(struct clk *) to void (*)(void *), that forces conversion to an incompatible function type, replace the cast with a small local stub function with a signature that matches what the devm_add_action_or_reset() function expects. The sub function takes a void *, then passes it directly to clk_disable_unprepare(), which handles the more specific type. Reported by clang when building with warnings enabled: drivers/pci/controller/dwc/pci-meson.c:191:6: warning: cast from 'void (*)(struct clk *)' to 'void (*)(void *)' converts to incompatible function type [-Wcast-function-type-strict] (void (*) (void *))clk_disable_unprepare, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ No functional changes are intended. Fixes: 9c0ef6d ("PCI: amlogic: Add the Amlogic Meson PCIe controller driver") Link: https://lore.kernel.org/linux-pci/20230629165956.237832-1-kwilczynski@kernel.org Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
1 parent 06c2afb commit 1a8bf35

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

drivers/pci/controller/dwc/pci-meson.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,13 @@ static int meson_pcie_reset(struct meson_pcie *mp)
163163
return 0;
164164
}
165165

166+
static inline void meson_pcie_disable_clock(void *data)
167+
{
168+
struct clk *clk = data;
169+
170+
clk_disable_unprepare(clk);
171+
}
172+
166173
static inline struct clk *meson_pcie_probe_clock(struct device *dev,
167174
const char *id, u64 rate)
168175
{
@@ -187,9 +194,7 @@ static inline struct clk *meson_pcie_probe_clock(struct device *dev,
187194
return ERR_PTR(ret);
188195
}
189196

190-
devm_add_action_or_reset(dev,
191-
(void (*) (void *))clk_disable_unprepare,
192-
clk);
197+
devm_add_action_or_reset(dev, meson_pcie_disable_clock, clk);
193198

194199
return clk;
195200
}

0 commit comments

Comments
 (0)