Skip to content

Commit

Permalink
Merge branch 'pci/controller/remove-void-cast'
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
Bjorn Helgaas committed Aug 29, 2023
2 parents 663544b + ed3cac7 commit 6cef126
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
11 changes: 8 additions & 3 deletions drivers/pci/controller/dwc/pci-meson.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,13 @@ static int meson_pcie_reset(struct meson_pcie *mp)
return 0;
}

static inline void meson_pcie_disable_clock(void *data)
{
struct clk *clk = data;

clk_disable_unprepare(clk);
}

static inline struct clk *meson_pcie_probe_clock(struct device *dev,
const char *id, u64 rate)
{
Expand All @@ -187,9 +194,7 @@ static inline struct clk *meson_pcie_probe_clock(struct device *dev,
return ERR_PTR(ret);
}

devm_add_action_or_reset(dev,
(void (*) (void *))clk_disable_unprepare,
clk);
devm_add_action_or_reset(dev, meson_pcie_disable_clock, clk);

return clk;
}
Expand Down
11 changes: 8 additions & 3 deletions drivers/pci/controller/dwc/pcie-keembay.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,13 @@ static const struct dw_pcie_ops keembay_pcie_ops = {
.stop_link = keembay_pcie_stop_link,
};

static inline void keembay_pcie_disable_clock(void *data)
{
struct clk *clk = data;

clk_disable_unprepare(clk);
}

static inline struct clk *keembay_pcie_probe_clock(struct device *dev,
const char *id, u64 rate)
{
Expand All @@ -168,9 +175,7 @@ static inline struct clk *keembay_pcie_probe_clock(struct device *dev,
if (ret)
return ERR_PTR(ret);

ret = devm_add_action_or_reset(dev,
(void(*)(void *))clk_disable_unprepare,
clk);
ret = devm_add_action_or_reset(dev, keembay_pcie_disable_clock, clk);
if (ret)
return ERR_PTR(ret);

Expand Down
10 changes: 8 additions & 2 deletions drivers/pci/controller/pcie-microchip-host.c
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,13 @@ static const struct irq_domain_ops event_domain_ops = {
.map = mc_pcie_event_map,
};

static inline void mc_pcie_deinit_clk(void *data)
{
struct clk *clk = data;

clk_disable_unprepare(clk);
}

static inline struct clk *mc_pcie_init_clk(struct device *dev, const char *id)
{
struct clk *clk;
Expand All @@ -862,8 +869,7 @@ static inline struct clk *mc_pcie_init_clk(struct device *dev, const char *id)
if (ret)
return ERR_PTR(ret);

devm_add_action_or_reset(dev, (void (*) (void *))clk_disable_unprepare,
clk);
devm_add_action_or_reset(dev, mc_pcie_deinit_clk, clk);

return clk;
}
Expand Down

0 comments on commit 6cef126

Please sign in to comment.