Skip to content

Commit 6cef126

Browse files
committed
Merge branch 'pci/controller/remove-void-cast'
- Add stubs for devm action functions that call clk_disable_unprepare() to avoid casts between incompatible function types (Krzysztof Wilczyński) * pci/controller/remove-void-cast: PCI: microchip: Remove cast between incompatible function type PCI: keembay: Remove cast between incompatible function type PCI: meson: Remove cast between incompatible function type
2 parents 663544b + ed3cac7 commit 6cef126

File tree

3 files changed

+24
-8
lines changed

3 files changed

+24
-8
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
}

drivers/pci/controller/dwc/pcie-keembay.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,13 @@ static const struct dw_pcie_ops keembay_pcie_ops = {
148148
.stop_link = keembay_pcie_stop_link,
149149
};
150150

151+
static inline void keembay_pcie_disable_clock(void *data)
152+
{
153+
struct clk *clk = data;
154+
155+
clk_disable_unprepare(clk);
156+
}
157+
151158
static inline struct clk *keembay_pcie_probe_clock(struct device *dev,
152159
const char *id, u64 rate)
153160
{
@@ -168,9 +175,7 @@ static inline struct clk *keembay_pcie_probe_clock(struct device *dev,
168175
if (ret)
169176
return ERR_PTR(ret);
170177

171-
ret = devm_add_action_or_reset(dev,
172-
(void(*)(void *))clk_disable_unprepare,
173-
clk);
178+
ret = devm_add_action_or_reset(dev, keembay_pcie_disable_clock, clk);
174179
if (ret)
175180
return ERR_PTR(ret);
176181

drivers/pci/controller/pcie-microchip-host.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -847,6 +847,13 @@ static const struct irq_domain_ops event_domain_ops = {
847847
.map = mc_pcie_event_map,
848848
};
849849

850+
static inline void mc_pcie_deinit_clk(void *data)
851+
{
852+
struct clk *clk = data;
853+
854+
clk_disable_unprepare(clk);
855+
}
856+
850857
static inline struct clk *mc_pcie_init_clk(struct device *dev, const char *id)
851858
{
852859
struct clk *clk;
@@ -862,8 +869,7 @@ static inline struct clk *mc_pcie_init_clk(struct device *dev, const char *id)
862869
if (ret)
863870
return ERR_PTR(ret);
864871

865-
devm_add_action_or_reset(dev, (void (*) (void *))clk_disable_unprepare,
866-
clk);
872+
devm_add_action_or_reset(dev, mc_pcie_deinit_clk, clk);
867873

868874
return clk;
869875
}

0 commit comments

Comments
 (0)