Commit caca6ad3 authored by Stephen Boyd's avatar Stephen Boyd

Merge branches 'clk-xilinx', 'clk-broadcom' and 'clk-platform' into clk-next

 - BCM63268 timer clock and reset controller
 - Convert platform clk drivers to remove_new

* clk-xilinx:
  clocking-wizard: Support higher frequency accuracy
  clk: zynqmp: pll: Remove the limit

* clk-broadcom:
  clk: bcm: Add BCM63268 timer clock and reset driver
  dt-bindings: clock: Add BCM63268 timer binding
  dt-bindings: reset: add BCM63268 timer reset definitions
  dt-bindings: clk: add BCM63268 timer clock definitions

* clk-platform: (25 commits)
  clk: xilinx: Convert to platform remove callback returning void
  clk: x86: Convert to platform remove callback returning void
  clk: uniphier: Convert to platform remove callback returning void
  clk: ti: Convert to platform remove callback returning void
  clk: tegra: Convert to platform remove callback returning void
  clk: stm32: Convert to platform remove callback returning void
  clk: mvebu: Convert to platform remove callback returning void
  clk: mmp: Convert to platform remove callback returning void
  clk: keystone: Convert to platform remove callback returning void
  clk: hisilicon: Convert to platform remove callback returning void
  clk: stm32mp1: Convert to platform remove callback returning void
  clk: scpi: Convert to platform remove callback returning void
  clk: s2mps11: Convert to platform remove callback returning void
  clk: pwm: Convert to platform remove callback returning void
  clk: palmas: Convert to platform remove callback returning void
  clk: hsdk-pll: Convert to platform remove callback returning void
  clk: fixed-rate: Convert to platform remove callback returning void
  clk: fixed-mmio: Convert to platform remove callback returning void
  clk: fixed-factor: Convert to platform remove callback returning void
  clk: axm5516: Convert to platform remove callback returning void
  ...
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/clock/brcm,bcm63268-timer-clocks.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Broadcom BCM63268 Timer Clock and Reset Device Tree Bindings
maintainers:
- Álvaro Fernández Rojas <noltari@gmail.com>
properties:
compatible:
const: brcm,bcm63268-timer-clocks
reg:
maxItems: 1
"#clock-cells":
const: 1
"#reset-cells":
const: 1
required:
- compatible
- reg
- "#clock-cells"
- "#reset-cells"
additionalProperties: false
examples:
- |
timer_clk: clock-controller@100000ac {
compatible = "brcm,bcm63268-timer-clocks";
reg = <0x100000ac 0x4>;
#clock-cells = <1>;
#reset-cells = <1>;
};
...@@ -198,10 +198,9 @@ static int i2s_pll_clk_probe(struct platform_device *pdev) ...@@ -198,10 +198,9 @@ static int i2s_pll_clk_probe(struct platform_device *pdev)
return of_clk_add_provider(node, of_clk_src_simple_get, clk); return of_clk_add_provider(node, of_clk_src_simple_get, clk);
} }
static int i2s_pll_clk_remove(struct platform_device *pdev) static void i2s_pll_clk_remove(struct platform_device *pdev)
{ {
of_clk_del_provider(pdev->dev.of_node); of_clk_del_provider(pdev->dev.of_node);
return 0;
} }
static const struct of_device_id i2s_pll_clk_id[] = { static const struct of_device_id i2s_pll_clk_id[] = {
...@@ -216,7 +215,7 @@ static struct platform_driver i2s_pll_clk_driver = { ...@@ -216,7 +215,7 @@ static struct platform_driver i2s_pll_clk_driver = {
.of_match_table = i2s_pll_clk_id, .of_match_table = i2s_pll_clk_id,
}, },
.probe = i2s_pll_clk_probe, .probe = i2s_pll_clk_probe,
.remove = i2s_pll_clk_remove, .remove_new = i2s_pll_clk_remove,
}; };
module_platform_driver(i2s_pll_clk_driver); module_platform_driver(i2s_pll_clk_driver);
......
...@@ -257,10 +257,9 @@ static int axs10x_pll_clk_probe(struct platform_device *pdev) ...@@ -257,10 +257,9 @@ static int axs10x_pll_clk_probe(struct platform_device *pdev)
&pll_clk->hw); &pll_clk->hw);
} }
static int axs10x_pll_clk_remove(struct platform_device *pdev) static void axs10x_pll_clk_remove(struct platform_device *pdev)
{ {
of_clk_del_provider(pdev->dev.of_node); of_clk_del_provider(pdev->dev.of_node);
return 0;
} }
static void __init of_axs10x_pll_clk_setup(struct device_node *node) static void __init of_axs10x_pll_clk_setup(struct device_node *node)
...@@ -332,7 +331,7 @@ static struct platform_driver axs10x_pll_clk_driver = { ...@@ -332,7 +331,7 @@ static struct platform_driver axs10x_pll_clk_driver = {
.of_match_table = axs10x_pll_clk_id, .of_match_table = axs10x_pll_clk_id,
}, },
.probe = axs10x_pll_clk_probe, .probe = axs10x_pll_clk_probe,
.remove = axs10x_pll_clk_remove, .remove_new = axs10x_pll_clk_remove,
}; };
builtin_platform_driver(axs10x_pll_clk_driver); builtin_platform_driver(axs10x_pll_clk_driver);
......
...@@ -37,6 +37,15 @@ config CLK_BCM_63XX_GATE ...@@ -37,6 +37,15 @@ config CLK_BCM_63XX_GATE
Enable common clock framework support for Broadcom BCM63xx DSL SoCs Enable common clock framework support for Broadcom BCM63xx DSL SoCs
based on the MIPS architecture based on the MIPS architecture
config CLK_BCM63268_TIMER
bool "Broadcom BCM63268 timer clock and reset support"
depends on BMIPS_GENERIC || COMPILE_TEST
default BMIPS_GENERIC
select RESET_CONTROLLER
help
Enable timer clock and reset support for Broadcom BCM63268 DSL SoCs
based on the MIPS architecture.
config CLK_BCM_KONA config CLK_BCM_KONA
bool "Broadcom Kona CCU clock support" bool "Broadcom Kona CCU clock support"
depends on ARCH_BCM_MOBILE || COMPILE_TEST depends on ARCH_BCM_MOBILE || COMPILE_TEST
......
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
obj-$(CONFIG_CLK_BCM_63XX) += clk-bcm63xx.o obj-$(CONFIG_CLK_BCM_63XX) += clk-bcm63xx.o
obj-$(CONFIG_CLK_BCM_63XX_GATE) += clk-bcm63xx-gate.o obj-$(CONFIG_CLK_BCM_63XX_GATE) += clk-bcm63xx-gate.o
obj-$(CONFIG_CLK_BCM63268_TIMER) += clk-bcm63268-timer.o
obj-$(CONFIG_CLK_BCM_KONA) += clk-kona.o obj-$(CONFIG_CLK_BCM_KONA) += clk-kona.o
obj-$(CONFIG_CLK_BCM_KONA) += clk-kona-setup.o obj-$(CONFIG_CLK_BCM_KONA) += clk-kona-setup.o
obj-$(CONFIG_CLK_BCM_KONA) += clk-bcm281xx.o obj-$(CONFIG_CLK_BCM_KONA) += clk-bcm281xx.o
......
...@@ -92,15 +92,13 @@ static int clk_dvp_probe(struct platform_device *pdev) ...@@ -92,15 +92,13 @@ static int clk_dvp_probe(struct platform_device *pdev)
return ret; return ret;
}; };
static int clk_dvp_remove(struct platform_device *pdev) static void clk_dvp_remove(struct platform_device *pdev)
{ {
struct clk_dvp *dvp = platform_get_drvdata(pdev); struct clk_dvp *dvp = platform_get_drvdata(pdev);
struct clk_hw_onecell_data *data = dvp->data; struct clk_hw_onecell_data *data = dvp->data;
clk_hw_unregister_gate(data->hws[1]); clk_hw_unregister_gate(data->hws[1]);
clk_hw_unregister_gate(data->hws[0]); clk_hw_unregister_gate(data->hws[0]);
return 0;
} }
static const struct of_device_id clk_dvp_dt_ids[] = { static const struct of_device_id clk_dvp_dt_ids[] = {
...@@ -111,7 +109,7 @@ MODULE_DEVICE_TABLE(of, clk_dvp_dt_ids); ...@@ -111,7 +109,7 @@ MODULE_DEVICE_TABLE(of, clk_dvp_dt_ids);
static struct platform_driver clk_dvp_driver = { static struct platform_driver clk_dvp_driver = {
.probe = clk_dvp_probe, .probe = clk_dvp_probe,
.remove = clk_dvp_remove, .remove_new = clk_dvp_remove,
.driver = { .driver = {
.name = "brcm2711-dvp", .name = "brcm2711-dvp",
.of_match_table = clk_dvp_dt_ids, .of_match_table = clk_dvp_dt_ids,
......
// SPDX-License-Identifier: GPL-2.0
/*
* BCM63268 Timer Clock and Reset Controller Driver
*
* Copyright (C) 2023 Álvaro Fernández Rojas <noltari@gmail.com>
*/
#include <linux/clk-provider.h>
#include <linux/container_of.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/io.h>
#include <linux/platform_device.h>
#include <linux/reset-controller.h>
#include <linux/spinlock.h>
#include <dt-bindings/clock/bcm63268-clock.h>
#define BCM63268_TIMER_RESET_SLEEP_MIN_US 10000
#define BCM63268_TIMER_RESET_SLEEP_MAX_US 20000
struct bcm63268_tclkrst_hw {
void __iomem *regs;
spinlock_t lock;
struct reset_controller_dev rcdev;
struct clk_hw_onecell_data data;
};
struct bcm63268_tclk_table_entry {
const char * const name;
u8 bit;
};
static const struct bcm63268_tclk_table_entry bcm63268_timer_clocks[] = {
{
.name = "ephy1",
.bit = BCM63268_TCLK_EPHY1,
}, {
.name = "ephy2",
.bit = BCM63268_TCLK_EPHY2,
}, {
.name = "ephy3",
.bit = BCM63268_TCLK_EPHY3,
}, {
.name = "gphy1",
.bit = BCM63268_TCLK_GPHY1,
}, {
.name = "dsl",
.bit = BCM63268_TCLK_DSL,
}, {
.name = "wakeon_ephy",
.bit = BCM63268_TCLK_WAKEON_EPHY,
}, {
.name = "wakeon_dsl",
.bit = BCM63268_TCLK_WAKEON_DSL,
}, {
.name = "fap1_pll",
.bit = BCM63268_TCLK_FAP1,
}, {
.name = "fap2_pll",
.bit = BCM63268_TCLK_FAP2,
}, {
.name = "uto_50",
.bit = BCM63268_TCLK_UTO_50,
}, {
.name = "uto_extin",
.bit = BCM63268_TCLK_UTO_EXTIN,
}, {
.name = "usb_ref",
.bit = BCM63268_TCLK_USB_REF,
}, {
/* sentinel */
}
};
static inline struct bcm63268_tclkrst_hw *
to_bcm63268_timer_reset(struct reset_controller_dev *rcdev)
{
return container_of(rcdev, struct bcm63268_tclkrst_hw, rcdev);
}
static int bcm63268_timer_reset_update(struct reset_controller_dev *rcdev,
unsigned long id, bool assert)
{
struct bcm63268_tclkrst_hw *reset = to_bcm63268_timer_reset(rcdev);
unsigned long flags;
uint32_t val;
spin_lock_irqsave(&reset->lock, flags);
val = __raw_readl(reset->regs);
if (assert)
val &= ~BIT(id);
else
val |= BIT(id);
__raw_writel(val, reset->regs);
spin_unlock_irqrestore(&reset->lock, flags);
return 0;
}
static int bcm63268_timer_reset_assert(struct reset_controller_dev *rcdev,
unsigned long id)
{
return bcm63268_timer_reset_update(rcdev, id, true);
}
static int bcm63268_timer_reset_deassert(struct reset_controller_dev *rcdev,
unsigned long id)
{
return bcm63268_timer_reset_update(rcdev, id, false);
}
static int bcm63268_timer_reset_reset(struct reset_controller_dev *rcdev,
unsigned long id)
{
bcm63268_timer_reset_update(rcdev, id, true);
usleep_range(BCM63268_TIMER_RESET_SLEEP_MIN_US,
BCM63268_TIMER_RESET_SLEEP_MAX_US);
bcm63268_timer_reset_update(rcdev, id, false);
/*
* Ensure component is taken out reset state by sleeping also after
* deasserting the reset. Otherwise, the component may not be ready
* for operation.
*/
usleep_range(BCM63268_TIMER_RESET_SLEEP_MIN_US,
BCM63268_TIMER_RESET_SLEEP_MAX_US);
return 0;
}
static int bcm63268_timer_reset_status(struct reset_controller_dev *rcdev,
unsigned long id)
{
struct bcm63268_tclkrst_hw *reset = to_bcm63268_timer_reset(rcdev);
return !(__raw_readl(reset->regs) & BIT(id));
}
static const struct reset_control_ops bcm63268_timer_reset_ops = {
.assert = bcm63268_timer_reset_assert,
.deassert = bcm63268_timer_reset_deassert,
.reset = bcm63268_timer_reset_reset,
.status = bcm63268_timer_reset_status,
};
static int bcm63268_tclk_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
const struct bcm63268_tclk_table_entry *entry;
struct bcm63268_tclkrst_hw *hw;
struct clk_hw *clk;
u8 maxbit = 0;
int i, ret;
for (entry = bcm63268_timer_clocks; entry->name; entry++)
maxbit = max(maxbit, entry->bit);
maxbit++;
hw = devm_kzalloc(&pdev->dev, struct_size(hw, data.hws, maxbit),
GFP_KERNEL);
if (!hw)
return -ENOMEM;
platform_set_drvdata(pdev, hw);
spin_lock_init(&hw->lock);
hw->data.num = maxbit;
for (i = 0; i < maxbit; i++)
hw->data.hws[i] = ERR_PTR(-ENODEV);
hw->regs = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(hw->regs))
return PTR_ERR(hw->regs);
for (entry = bcm63268_timer_clocks; entry->name; entry++) {
clk = devm_clk_hw_register_gate(dev, entry->name, NULL, 0,
hw->regs, entry->bit,
CLK_GATE_BIG_ENDIAN,
&hw->lock);
if (IS_ERR(clk))
return PTR_ERR(clk);
hw->data.hws[entry->bit] = clk;
}
ret = devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get,
&hw->data);
if (ret)
return ret;
hw->rcdev.of_node = dev->of_node;
hw->rcdev.ops = &bcm63268_timer_reset_ops;
ret = devm_reset_controller_register(dev, &hw->rcdev);
if (ret)
dev_err(dev, "Failed to register reset controller\n");
return 0;
}
static const struct of_device_id bcm63268_tclk_dt_ids[] = {
{ .compatible = "brcm,bcm63268-timer-clocks" },
{ /* sentinel */ }
};
static struct platform_driver bcm63268_tclk = {
.probe = bcm63268_tclk_probe,
.driver = {
.name = "bcm63268-timer-clock",
.of_match_table = bcm63268_tclk_dt_ids,
},
};
builtin_platform_driver(bcm63268_tclk);
...@@ -541,7 +541,7 @@ static int clk_bcm63xx_probe(struct platform_device *pdev) ...@@ -541,7 +541,7 @@ static int clk_bcm63xx_probe(struct platform_device *pdev)
return ret; return ret;
} }
static int clk_bcm63xx_remove(struct platform_device *pdev) static void clk_bcm63xx_remove(struct platform_device *pdev)
{ {
struct clk_bcm63xx_hw *hw = platform_get_drvdata(pdev); struct clk_bcm63xx_hw *hw = platform_get_drvdata(pdev);
int i; int i;
...@@ -552,8 +552,6 @@ static int clk_bcm63xx_remove(struct platform_device *pdev) ...@@ -552,8 +552,6 @@ static int clk_bcm63xx_remove(struct platform_device *pdev)
if (!IS_ERR(hw->data.hws[i])) if (!IS_ERR(hw->data.hws[i]))
clk_hw_unregister_gate(hw->data.hws[i]); clk_hw_unregister_gate(hw->data.hws[i]);
} }
return 0;
} }
static const struct of_device_id clk_bcm63xx_dt_ids[] = { static const struct of_device_id clk_bcm63xx_dt_ids[] = {
...@@ -570,7 +568,7 @@ static const struct of_device_id clk_bcm63xx_dt_ids[] = { ...@@ -570,7 +568,7 @@ static const struct of_device_id clk_bcm63xx_dt_ids[] = {
static struct platform_driver clk_bcm63xx = { static struct platform_driver clk_bcm63xx = {
.probe = clk_bcm63xx_probe, .probe = clk_bcm63xx_probe,
.remove = clk_bcm63xx_remove, .remove_new = clk_bcm63xx_remove,
.driver = { .driver = {
.name = "bcm63xx-clock", .name = "bcm63xx-clock",
.of_match_table = clk_bcm63xx_dt_ids, .of_match_table = clk_bcm63xx_dt_ids,
......
...@@ -439,13 +439,11 @@ static int raspberrypi_clk_probe(struct platform_device *pdev) ...@@ -439,13 +439,11 @@ static int raspberrypi_clk_probe(struct platform_device *pdev)
return 0; return 0;
} }
static int raspberrypi_clk_remove(struct platform_device *pdev) static void raspberrypi_clk_remove(struct platform_device *pdev)
{ {
struct raspberrypi_clk *rpi = platform_get_drvdata(pdev); struct raspberrypi_clk *rpi = platform_get_drvdata(pdev);
platform_device_unregister(rpi->cpufreq); platform_device_unregister(rpi->cpufreq);
return 0;
} }
static const struct of_device_id raspberrypi_clk_match[] = { static const struct of_device_id raspberrypi_clk_match[] = {
...@@ -460,7 +458,7 @@ static struct platform_driver raspberrypi_clk_driver = { ...@@ -460,7 +458,7 @@ static struct platform_driver raspberrypi_clk_driver = {
.of_match_table = raspberrypi_clk_match, .of_match_table = raspberrypi_clk_match,
}, },
.probe = raspberrypi_clk_probe, .probe = raspberrypi_clk_probe,
.remove = raspberrypi_clk_remove, .remove_new = raspberrypi_clk_remove,
}; };
module_platform_driver(raspberrypi_clk_driver); module_platform_driver(raspberrypi_clk_driver);
......
...@@ -557,11 +557,9 @@ static int axi_clkgen_probe(struct platform_device *pdev) ...@@ -557,11 +557,9 @@ static int axi_clkgen_probe(struct platform_device *pdev)
&axi_clkgen->clk_hw); &axi_clkgen->clk_hw);
} }
static int axi_clkgen_remove(struct platform_device *pdev) static void axi_clkgen_remove(struct platform_device *pdev)
{ {
of_clk_del_provider(pdev->dev.of_node); of_clk_del_provider(pdev->dev.of_node);
return 0;
} }
static const struct of_device_id axi_clkgen_ids[] = { static const struct of_device_id axi_clkgen_ids[] = {
...@@ -583,7 +581,7 @@ static struct platform_driver axi_clkgen_driver = { ...@@ -583,7 +581,7 @@ static struct platform_driver axi_clkgen_driver = {
.of_match_table = axi_clkgen_ids, .of_match_table = axi_clkgen_ids,
}, },
.probe = axi_clkgen_probe, .probe = axi_clkgen_probe,
.remove = axi_clkgen_remove, .remove_new = axi_clkgen_remove,
}; };
module_platform_driver(axi_clkgen_driver); module_platform_driver(axi_clkgen_driver);
......
...@@ -572,15 +572,14 @@ static int axmclk_probe(struct platform_device *pdev) ...@@ -572,15 +572,14 @@ static int axmclk_probe(struct platform_device *pdev)
return of_clk_add_hw_provider(dev->of_node, of_clk_axmclk_get, NULL); return of_clk_add_hw_provider(dev->of_node, of_clk_axmclk_get, NULL);
} }
static int axmclk_remove(struct platform_device *pdev) static void axmclk_remove(struct platform_device *pdev)
{ {
of_clk_del_provider(pdev->dev.of_node); of_clk_del_provider(pdev->dev.of_node);
return 0;
} }
static struct platform_driver axmclk_driver = { static struct platform_driver axmclk_driver = {
.probe = axmclk_probe, .probe = axmclk_probe,
.remove = axmclk_remove, .remove_new = axmclk_remove,
.driver = { .driver = {
.name = "clk-axm5516", .name = "clk-axm5516",
.of_match_table = axmclk_match_table, .of_match_table = axmclk_match_table,
......
...@@ -297,14 +297,12 @@ void __init of_fixed_factor_clk_setup(struct device_node *node) ...@@ -297,14 +297,12 @@ void __init of_fixed_factor_clk_setup(struct device_node *node)
CLK_OF_DECLARE(fixed_factor_clk, "fixed-factor-clock", CLK_OF_DECLARE(fixed_factor_clk, "fixed-factor-clock",
of_fixed_factor_clk_setup); of_fixed_factor_clk_setup);
static int of_fixed_factor_clk_remove(struct platform_device *pdev) static void of_fixed_factor_clk_remove(struct platform_device *pdev)
{ {
struct clk_hw *clk = platform_get_drvdata(pdev); struct clk_hw *clk = platform_get_drvdata(pdev);
of_clk_del_provider(pdev->dev.of_node); of_clk_del_provider(pdev->dev.of_node);
clk_hw_unregister_fixed_factor(clk); clk_hw_unregister_fixed_factor(clk);
return 0;
} }
static int of_fixed_factor_clk_probe(struct platform_device *pdev) static int of_fixed_factor_clk_probe(struct platform_device *pdev)
...@@ -336,7 +334,7 @@ static struct platform_driver of_fixed_factor_clk_driver = { ...@@ -336,7 +334,7 @@ static struct platform_driver of_fixed_factor_clk_driver = {
.of_match_table = of_fixed_factor_clk_ids, .of_match_table = of_fixed_factor_clk_ids,
}, },
.probe = of_fixed_factor_clk_probe, .probe = of_fixed_factor_clk_probe,
.remove = of_fixed_factor_clk_remove, .remove_new = of_fixed_factor_clk_remove,
}; };
builtin_platform_driver(of_fixed_factor_clk_driver); builtin_platform_driver(of_fixed_factor_clk_driver);
#endif #endif
...@@ -71,14 +71,12 @@ static int of_fixed_mmio_clk_probe(struct platform_device *pdev) ...@@ -71,14 +71,12 @@ static int of_fixed_mmio_clk_probe(struct platform_device *pdev)
return 0; return 0;
} }
static int of_fixed_mmio_clk_remove(struct platform_device *pdev) static void of_fixed_mmio_clk_remove(struct platform_device *pdev)
{ {
struct clk_hw *clk = platform_get_drvdata(pdev); struct clk_hw *clk = platform_get_drvdata(pdev);
of_clk_del_provider(pdev->dev.of_node); of_clk_del_provider(pdev->dev.of_node);
clk_hw_unregister_fixed_rate(clk); clk_hw_unregister_fixed_rate(clk);
return 0;
} }
static const struct of_device_id of_fixed_mmio_clk_ids[] = { static const struct of_device_id of_fixed_mmio_clk_ids[] = {
...@@ -93,7 +91,7 @@ static struct platform_driver of_fixed_mmio_clk_driver = { ...@@ -93,7 +91,7 @@ static struct platform_driver of_fixed_mmio_clk_driver = {
.of_match_table = of_fixed_mmio_clk_ids, .of_match_table = of_fixed_mmio_clk_ids,
}, },
.probe = of_fixed_mmio_clk_probe, .probe = of_fixed_mmio_clk_probe,
.remove = of_fixed_mmio_clk_remove, .remove_new = of_fixed_mmio_clk_remove,
}; };
module_platform_driver(of_fixed_mmio_clk_driver); module_platform_driver(of_fixed_mmio_clk_driver);
......
...@@ -196,14 +196,12 @@ void __init of_fixed_clk_setup(struct device_node *node) ...@@ -196,14 +196,12 @@ void __init of_fixed_clk_setup(struct device_node *node)
} }
CLK_OF_DECLARE(fixed_clk, "fixed-clock", of_fixed_clk_setup); CLK_OF_DECLARE(fixed_clk, "fixed-clock", of_fixed_clk_setup);
static int of_fixed_clk_remove(struct platform_device *pdev) static void of_fixed_clk_remove(struct platform_device *pdev)
{ {
struct clk_hw *hw = platform_get_drvdata(pdev); struct clk_hw *hw = platform_get_drvdata(pdev);
of_clk_del_provider(pdev->dev.of_node); of_clk_del_provider(pdev->dev.of_node);
clk_hw_unregister_fixed_rate(hw); clk_hw_unregister_fixed_rate(hw);
return 0;
} }
static int of_fixed_clk_probe(struct platform_device *pdev) static int of_fixed_clk_probe(struct platform_device *pdev)
...@@ -234,7 +232,7 @@ static struct platform_driver of_fixed_clk_driver = { ...@@ -234,7 +232,7 @@ static struct platform_driver of_fixed_clk_driver = {
.of_match_table = of_fixed_clk_ids, .of_match_table = of_fixed_clk_ids,
}, },
.probe = of_fixed_clk_probe, .probe = of_fixed_clk_probe,
.remove = of_fixed_clk_remove, .remove_new = of_fixed_clk_remove,
}; };
builtin_platform_driver(of_fixed_clk_driver); builtin_platform_driver(of_fixed_clk_driver);
#endif #endif
...@@ -350,10 +350,9 @@ static int hsdk_pll_clk_probe(struct platform_device *pdev) ...@@ -350,10 +350,9 @@ static int hsdk_pll_clk_probe(struct platform_device *pdev)
&pll_clk->hw); &pll_clk->hw);
} }
static int hsdk_pll_clk_remove(struct platform_device *pdev) static void hsdk_pll_clk_remove(struct platform_device *pdev)
{ {
of_clk_del_provider(pdev->dev.of_node); of_clk_del_provider(pdev->dev.of_node);
return 0;
} }
static void __init of_hsdk_pll_clk_setup(struct device_node *node) static void __init of_hsdk_pll_clk_setup(struct device_node *node)
...@@ -432,6 +431,6 @@ static struct platform_driver hsdk_pll_clk_driver = { ...@@ -432,6 +431,6 @@ static struct platform_driver hsdk_pll_clk_driver = {
.of_match_table = hsdk_pll_clk_id, .of_match_table = hsdk_pll_clk_id,
}, },
.probe = hsdk_pll_clk_probe, .probe = hsdk_pll_clk_probe,
.remove = hsdk_pll_clk_remove, .remove_new = hsdk_pll_clk_remove,
}; };
builtin_platform_driver(hsdk_pll_clk_driver); builtin_platform_driver(hsdk_pll_clk_driver);
...@@ -271,10 +271,9 @@ static int palmas_clks_probe(struct platform_device *pdev) ...@@ -271,10 +271,9 @@ static int palmas_clks_probe(struct platform_device *pdev)
return ret; return ret;
} }
static int palmas_clks_remove(struct platform_device *pdev) static void palmas_clks_remove(struct platform_device *pdev)
{ {
of_clk_del_provider(pdev->dev.of_node); of_clk_del_provider(pdev->dev.of_node);
return 0;
} }
static struct platform_driver palmas_clks_driver = { static struct platform_driver palmas_clks_driver = {
...@@ -283,7 +282,7 @@ static struct platform_driver palmas_clks_driver = { ...@@ -283,7 +282,7 @@ static struct platform_driver palmas_clks_driver = {
.of_match_table = palmas_clks_of_match, .of_match_table = palmas_clks_of_match,
}, },
.probe = palmas_clks_probe, .probe = palmas_clks_probe,
.remove = palmas_clks_remove, .remove_new = palmas_clks_remove,
}; };
module_platform_driver(palmas_clks_driver); module_platform_driver(palmas_clks_driver);
......
...@@ -129,11 +129,9 @@ static int clk_pwm_probe(struct platform_device *pdev) ...@@ -129,11 +129,9 @@ static int clk_pwm_probe(struct platform_device *pdev)
return of_clk_add_hw_provider(node, of_clk_hw_simple_get, &clk_pwm->hw); return of_clk_add_hw_provider(node, of_clk_hw_simple_get, &clk_pwm->hw);
} }
static int clk_pwm_remove(struct platform_device *pdev) static void clk_pwm_remove(struct platform_device *pdev)
{ {
of_clk_del_provider(pdev->dev.of_node); of_clk_del_provider(pdev->dev.of_node);
return 0;
} }
static const struct of_device_id clk_pwm_dt_ids[] = { static const struct of_device_id clk_pwm_dt_ids[] = {
...@@ -144,7 +142,7 @@ MODULE_DEVICE_TABLE(of, clk_pwm_dt_ids); ...@@ -144,7 +142,7 @@ MODULE_DEVICE_TABLE(of, clk_pwm_dt_ids);
static struct platform_driver clk_pwm_driver = { static struct platform_driver clk_pwm_driver = {
.probe = clk_pwm_probe, .probe = clk_pwm_probe,
.remove = clk_pwm_remove, .remove_new = clk_pwm_remove,
.driver = { .driver = {
.name = "pwm-clock", .name = "pwm-clock",
.of_match_table = clk_pwm_dt_ids, .of_match_table = clk_pwm_dt_ids,
......
...@@ -202,7 +202,7 @@ static int s2mps11_clk_probe(struct platform_device *pdev) ...@@ -202,7 +202,7 @@ static int s2mps11_clk_probe(struct platform_device *pdev)
return ret; return ret;
} }
static int s2mps11_clk_remove(struct platform_device *pdev) static void s2mps11_clk_remove(struct platform_device *pdev)
{ {
struct s2mps11_clk *s2mps11_clks = platform_get_drvdata(pdev); struct s2mps11_clk *s2mps11_clks = platform_get_drvdata(pdev);
int i; int i;
...@@ -217,8 +217,6 @@ static int s2mps11_clk_remove(struct platform_device *pdev) ...@@ -217,8 +217,6 @@ static int s2mps11_clk_remove(struct platform_device *pdev)
continue; continue;
clkdev_drop(s2mps11_clks[i].lookup); clkdev_drop(s2mps11_clks[i].lookup);
} }
return 0;
} }
static const struct platform_device_id s2mps11_clk_id[] = { static const struct platform_device_id s2mps11_clk_id[] = {
...@@ -265,7 +263,7 @@ static struct platform_driver s2mps11_clk_driver = { ...@@ -265,7 +263,7 @@ static struct platform_driver s2mps11_clk_driver = {
.name = "s2mps11-clk", .name = "s2mps11-clk",
}, },
.probe = s2mps11_clk_probe, .probe = s2mps11_clk_probe,
.remove = s2mps11_clk_remove, .remove_new = s2mps11_clk_remove,
.id_table = s2mps11_clk_id, .id_table = s2mps11_clk_id,
}; };
module_platform_driver(s2mps11_clk_driver); module_platform_driver(s2mps11_clk_driver);
......
...@@ -246,7 +246,7 @@ static int scpi_clk_add(struct device *dev, struct device_node *np, ...@@ -246,7 +246,7 @@ static int scpi_clk_add(struct device *dev, struct device_node *np,
return of_clk_add_hw_provider(np, scpi_of_clk_src_get, clk_data); return of_clk_add_hw_provider(np, scpi_of_clk_src_get, clk_data);
} }
static int scpi_clocks_remove(struct platform_device *pdev) static void scpi_clocks_remove(struct platform_device *pdev)
{ {
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct device_node *child, *np = dev->of_node; struct device_node *child, *np = dev->of_node;
...@@ -258,7 +258,6 @@ static int scpi_clocks_remove(struct platform_device *pdev) ...@@ -258,7 +258,6 @@ static int scpi_clocks_remove(struct platform_device *pdev)
for_each_available_child_of_node(np, child) for_each_available_child_of_node(np, child)
of_clk_del_provider(np); of_clk_del_provider(np);
return 0;
} }
static int scpi_clocks_probe(struct platform_device *pdev) static int scpi_clocks_probe(struct platform_device *pdev)
...@@ -305,7 +304,7 @@ static struct platform_driver scpi_clocks_driver = { ...@@ -305,7 +304,7 @@ static struct platform_driver scpi_clocks_driver = {
.of_match_table = scpi_clocks_ids, .of_match_table = scpi_clocks_ids,
}, },
.probe = scpi_clocks_probe, .probe = scpi_clocks_probe,
.remove = scpi_clocks_remove, .remove_new = scpi_clocks_remove,
}; };
module_platform_driver(scpi_clocks_driver); module_platform_driver(scpi_clocks_driver);
......
...@@ -2434,15 +2434,13 @@ static int stm32mp1_rcc_clocks_probe(struct platform_device *pdev) ...@@ -2434,15 +2434,13 @@ static int stm32mp1_rcc_clocks_probe(struct platform_device *pdev)
return ret; return ret;
} }
static int stm32mp1_rcc_clocks_remove(struct platform_device *pdev) static void stm32mp1_rcc_clocks_remove(struct platform_device *pdev)
{ {
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct device_node *child, *np = dev_of_node(dev); struct device_node *child, *np = dev_of_node(dev);
for_each_available_child_of_node(np, child) for_each_available_child_of_node(np, child)
of_clk_del_provider(child); of_clk_del_provider(child);
return 0;
} }
static struct platform_driver stm32mp1_rcc_clocks_driver = { static struct platform_driver stm32mp1_rcc_clocks_driver = {
...@@ -2451,7 +2449,7 @@ static struct platform_driver stm32mp1_rcc_clocks_driver = { ...@@ -2451,7 +2449,7 @@ static struct platform_driver stm32mp1_rcc_clocks_driver = {
.of_match_table = stm32mp1_match_data, .of_match_table = stm32mp1_match_data,
}, },
.probe = stm32mp1_rcc_clocks_probe, .probe = stm32mp1_rcc_clocks_probe,
.remove = stm32mp1_rcc_clocks_remove, .remove_new = stm32mp1_rcc_clocks_remove,
}; };
static int __init stm32mp1_clocks_init(void) static int __init stm32mp1_clocks_init(void)
......
...@@ -162,13 +162,12 @@ static int hi3519_clk_probe(struct platform_device *pdev) ...@@ -162,13 +162,12 @@ static int hi3519_clk_probe(struct platform_device *pdev)
return 0; return 0;
} }
static int hi3519_clk_remove(struct platform_device *pdev) static void hi3519_clk_remove(struct platform_device *pdev)
{ {
struct hi3519_crg_data *crg = platform_get_drvdata(pdev); struct hi3519_crg_data *crg = platform_get_drvdata(pdev);
hisi_reset_exit(crg->rstc); hisi_reset_exit(crg->rstc);
hi3519_clk_unregister(pdev); hi3519_clk_unregister(pdev);
return 0;
} }
...@@ -180,7 +179,7 @@ MODULE_DEVICE_TABLE(of, hi3519_clk_match_table); ...@@ -180,7 +179,7 @@ MODULE_DEVICE_TABLE(of, hi3519_clk_match_table);
static struct platform_driver hi3519_clk_driver = { static struct platform_driver hi3519_clk_driver = {
.probe = hi3519_clk_probe, .probe = hi3519_clk_probe,
.remove = hi3519_clk_remove, .remove_new = hi3519_clk_remove,
.driver = { .driver = {
.name = "hi3519-clk", .name = "hi3519-clk",
.of_match_table = hi3519_clk_match_table, .of_match_table = hi3519_clk_match_table,
......
...@@ -810,18 +810,17 @@ static int hi3559av100_crg_probe(struct platform_device *pdev) ...@@ -810,18 +810,17 @@ static int hi3559av100_crg_probe(struct platform_device *pdev)
return 0; return 0;
} }
static int hi3559av100_crg_remove(struct platform_device *pdev) static void hi3559av100_crg_remove(struct platform_device *pdev)
{ {
struct hisi_crg_dev *crg = platform_get_drvdata(pdev); struct hisi_crg_dev *crg = platform_get_drvdata(pdev);
hisi_reset_exit(crg->rstc); hisi_reset_exit(crg->rstc);
crg->funcs->unregister_clks(pdev); crg->funcs->unregister_clks(pdev);
return 0;
} }
static struct platform_driver hi3559av100_crg_driver = { static struct platform_driver hi3559av100_crg_driver = {
.probe = hi3559av100_crg_probe, .probe = hi3559av100_crg_probe,
.remove = hi3559av100_crg_remove, .remove_new = hi3559av100_crg_remove,
.driver = { .driver = {
.name = "hi3559av100-clock", .name = "hi3559av100-clock",
.of_match_table = hi3559av100_crg_match_table, .of_match_table = hi3559av100_crg_match_table,
......
...@@ -284,18 +284,17 @@ static int hi3516cv300_crg_probe(struct platform_device *pdev) ...@@ -284,18 +284,17 @@ static int hi3516cv300_crg_probe(struct platform_device *pdev)
return 0; return 0;
} }
static int hi3516cv300_crg_remove(struct platform_device *pdev) static void hi3516cv300_crg_remove(struct platform_device *pdev)
{ {
struct hisi_crg_dev *crg = platform_get_drvdata(pdev); struct hisi_crg_dev *crg = platform_get_drvdata(pdev);
hisi_reset_exit(crg->rstc); hisi_reset_exit(crg->rstc);
crg->funcs->unregister_clks(pdev); crg->funcs->unregister_clks(pdev);
return 0;
} }
static struct platform_driver hi3516cv300_crg_driver = { static struct platform_driver hi3516cv300_crg_driver = {
.probe = hi3516cv300_crg_probe, .probe = hi3516cv300_crg_probe,
.remove = hi3516cv300_crg_remove, .remove_new = hi3516cv300_crg_remove,
.driver = { .driver = {
.name = "hi3516cv300-crg", .name = "hi3516cv300-crg",
.of_match_table = hi3516cv300_crg_match_table, .of_match_table = hi3516cv300_crg_match_table,
......
...@@ -367,18 +367,17 @@ static int hi3798cv200_crg_probe(struct platform_device *pdev) ...@@ -367,18 +367,17 @@ static int hi3798cv200_crg_probe(struct platform_device *pdev)
return 0; return 0;
} }
static int hi3798cv200_crg_remove(struct platform_device *pdev) static void hi3798cv200_crg_remove(struct platform_device *pdev)
{ {
struct hisi_crg_dev *crg = platform_get_drvdata(pdev); struct hisi_crg_dev *crg = platform_get_drvdata(pdev);
hisi_reset_exit(crg->rstc); hisi_reset_exit(crg->rstc);
crg->funcs->unregister_clks(pdev); crg->funcs->unregister_clks(pdev);
return 0;
} }
static struct platform_driver hi3798cv200_crg_driver = { static struct platform_driver hi3798cv200_crg_driver = {
.probe = hi3798cv200_crg_probe, .probe = hi3798cv200_crg_probe,
.remove = hi3798cv200_crg_remove, .remove_new = hi3798cv200_crg_remove,
.driver = { .driver = {
.name = "hi3798cv200-crg", .name = "hi3798cv200-crg",
.of_match_table = hi3798cv200_crg_match_table, .of_match_table = hi3798cv200_crg_match_table,
......
...@@ -689,16 +689,14 @@ static int ti_sci_clk_probe(struct platform_device *pdev) ...@@ -689,16 +689,14 @@ static int ti_sci_clk_probe(struct platform_device *pdev)
* via common clock framework. Any memory allocated for the device will * via common clock framework. Any memory allocated for the device will
* be free'd silently via the devm framework. Returns 0 always. * be free'd silently via the devm framework. Returns 0 always.
*/ */
static int ti_sci_clk_remove(struct platform_device *pdev) static void ti_sci_clk_remove(struct platform_device *pdev)
{ {
of_clk_del_provider(pdev->dev.of_node); of_clk_del_provider(pdev->dev.of_node);
return 0;
} }
static struct platform_driver ti_sci_clk_driver = { static struct platform_driver ti_sci_clk_driver = {
.probe = ti_sci_clk_probe, .probe = ti_sci_clk_probe,
.remove = ti_sci_clk_remove, .remove_new = ti_sci_clk_remove,
.driver = { .driver = {
.name = "ti-sci-clk", .name = "ti-sci-clk",
.of_match_table = of_match_ptr(ti_sci_clk_of_match), .of_match_table = of_match_ptr(ti_sci_clk_of_match),
......
...@@ -384,12 +384,10 @@ static int mmp2_audio_clk_probe(struct platform_device *pdev) ...@@ -384,12 +384,10 @@ static int mmp2_audio_clk_probe(struct platform_device *pdev)
return ret; return ret;
} }
static int mmp2_audio_clk_remove(struct platform_device *pdev) static void mmp2_audio_clk_remove(struct platform_device *pdev)
{ {
pm_clk_destroy(&pdev->dev); pm_clk_destroy(&pdev->dev);
pm_runtime_disable(&pdev->dev); pm_runtime_disable(&pdev->dev);
return 0;
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM
...@@ -436,7 +434,7 @@ static struct platform_driver mmp2_audio_clk_driver = { ...@@ -436,7 +434,7 @@ static struct platform_driver mmp2_audio_clk_driver = {
.pm = &mmp2_audio_clk_pm_ops, .pm = &mmp2_audio_clk_pm_ops,
}, },
.probe = mmp2_audio_clk_probe, .probe = mmp2_audio_clk_probe,
.remove = mmp2_audio_clk_remove, .remove_new = mmp2_audio_clk_remove,
}; };
module_platform_driver(mmp2_audio_clk_driver); module_platform_driver(mmp2_audio_clk_driver);
......
...@@ -781,7 +781,7 @@ static int armada_3700_periph_clock_probe(struct platform_device *pdev) ...@@ -781,7 +781,7 @@ static int armada_3700_periph_clock_probe(struct platform_device *pdev)
return 0; return 0;
} }
static int armada_3700_periph_clock_remove(struct platform_device *pdev) static void armada_3700_periph_clock_remove(struct platform_device *pdev)
{ {
struct clk_periph_driver_data *data = platform_get_drvdata(pdev); struct clk_periph_driver_data *data = platform_get_drvdata(pdev);
struct clk_hw_onecell_data *hw_data = data->hw_data; struct clk_hw_onecell_data *hw_data = data->hw_data;
...@@ -791,13 +791,11 @@ static int armada_3700_periph_clock_remove(struct platform_device *pdev) ...@@ -791,13 +791,11 @@ static int armada_3700_periph_clock_remove(struct platform_device *pdev)
for (i = 0; i < hw_data->num; i++) for (i = 0; i < hw_data->num; i++)
clk_hw_unregister(hw_data->hws[i]); clk_hw_unregister(hw_data->hws[i]);
return 0;
} }
static struct platform_driver armada_3700_periph_clock_driver = { static struct platform_driver armada_3700_periph_clock_driver = {
.probe = armada_3700_periph_clock_probe, .probe = armada_3700_periph_clock_probe,
.remove = armada_3700_periph_clock_remove, .remove_new = armada_3700_periph_clock_remove,
.driver = { .driver = {
.name = "marvell-armada-3700-periph-clock", .name = "marvell-armada-3700-periph-clock",
.of_match_table = armada_3700_periph_clock_of_match, .of_match_table = armada_3700_periph_clock_of_match,
......
...@@ -126,7 +126,7 @@ static int armada_3700_tbg_clock_probe(struct platform_device *pdev) ...@@ -126,7 +126,7 @@ static int armada_3700_tbg_clock_probe(struct platform_device *pdev)
return of_clk_add_hw_provider(np, of_clk_hw_onecell_get, hw_tbg_data); return of_clk_add_hw_provider(np, of_clk_hw_onecell_get, hw_tbg_data);
} }
static int armada_3700_tbg_clock_remove(struct platform_device *pdev) static void armada_3700_tbg_clock_remove(struct platform_device *pdev)
{ {
int i; int i;
struct clk_hw_onecell_data *hw_tbg_data = platform_get_drvdata(pdev); struct clk_hw_onecell_data *hw_tbg_data = platform_get_drvdata(pdev);
...@@ -134,8 +134,6 @@ static int armada_3700_tbg_clock_remove(struct platform_device *pdev) ...@@ -134,8 +134,6 @@ static int armada_3700_tbg_clock_remove(struct platform_device *pdev)
of_clk_del_provider(pdev->dev.of_node); of_clk_del_provider(pdev->dev.of_node);
for (i = 0; i < hw_tbg_data->num; i++) for (i = 0; i < hw_tbg_data->num; i++)
clk_hw_unregister_fixed_factor(hw_tbg_data->hws[i]); clk_hw_unregister_fixed_factor(hw_tbg_data->hws[i]);
return 0;
} }
static const struct of_device_id armada_3700_tbg_clock_of_match[] = { static const struct of_device_id armada_3700_tbg_clock_of_match[] = {
...@@ -145,7 +143,7 @@ static const struct of_device_id armada_3700_tbg_clock_of_match[] = { ...@@ -145,7 +143,7 @@ static const struct of_device_id armada_3700_tbg_clock_of_match[] = {
static struct platform_driver armada_3700_tbg_clock_driver = { static struct platform_driver armada_3700_tbg_clock_driver = {
.probe = armada_3700_tbg_clock_probe, .probe = armada_3700_tbg_clock_probe,
.remove = armada_3700_tbg_clock_remove, .remove_new = armada_3700_tbg_clock_remove,
.driver = { .driver = {
.name = "marvell-armada-3700-tbg-clock", .name = "marvell-armada-3700-tbg-clock",
.of_match_table = armada_3700_tbg_clock_of_match, .of_match_table = armada_3700_tbg_clock_of_match,
......
...@@ -65,11 +65,9 @@ static int armada_3700_xtal_clock_probe(struct platform_device *pdev) ...@@ -65,11 +65,9 @@ static int armada_3700_xtal_clock_probe(struct platform_device *pdev)
return ret; return ret;
} }
static int armada_3700_xtal_clock_remove(struct platform_device *pdev) static void armada_3700_xtal_clock_remove(struct platform_device *pdev)
{ {
of_clk_del_provider(pdev->dev.of_node); of_clk_del_provider(pdev->dev.of_node);
return 0;
} }
static const struct of_device_id armada_3700_xtal_clock_of_match[] = { static const struct of_device_id armada_3700_xtal_clock_of_match[] = {
...@@ -79,7 +77,7 @@ static const struct of_device_id armada_3700_xtal_clock_of_match[] = { ...@@ -79,7 +77,7 @@ static const struct of_device_id armada_3700_xtal_clock_of_match[] = {
static struct platform_driver armada_3700_xtal_clock_driver = { static struct platform_driver armada_3700_xtal_clock_driver = {
.probe = armada_3700_xtal_clock_probe, .probe = armada_3700_xtal_clock_probe,
.remove = armada_3700_xtal_clock_remove, .remove_new = armada_3700_xtal_clock_remove,
.driver = { .driver = {
.name = "marvell-armada-3700-xtal-clock", .name = "marvell-armada-3700-xtal-clock",
.of_match_table = armada_3700_xtal_clock_of_match, .of_match_table = armada_3700_xtal_clock_of_match,
......
...@@ -1593,15 +1593,13 @@ static int stm32mp1_rcc_clocks_probe(struct platform_device *pdev) ...@@ -1593,15 +1593,13 @@ static int stm32mp1_rcc_clocks_probe(struct platform_device *pdev)
return ret; return ret;
} }
static int stm32mp1_rcc_clocks_remove(struct platform_device *pdev) static void stm32mp1_rcc_clocks_remove(struct platform_device *pdev)
{ {
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct device_node *child, *np = dev_of_node(dev); struct device_node *child, *np = dev_of_node(dev);
for_each_available_child_of_node(np, child) for_each_available_child_of_node(np, child)
of_clk_del_provider(child); of_clk_del_provider(child);
return 0;
} }
static struct platform_driver stm32mp13_rcc_clocks_driver = { static struct platform_driver stm32mp13_rcc_clocks_driver = {
...@@ -1610,7 +1608,7 @@ static struct platform_driver stm32mp13_rcc_clocks_driver = { ...@@ -1610,7 +1608,7 @@ static struct platform_driver stm32mp13_rcc_clocks_driver = {
.of_match_table = stm32mp13_match_data, .of_match_table = stm32mp13_match_data,
}, },
.probe = stm32mp1_rcc_clocks_probe, .probe = stm32mp1_rcc_clocks_probe,
.remove = stm32mp1_rcc_clocks_remove, .remove_new = stm32mp1_rcc_clocks_remove,
}; };
static int __init stm32mp13_clocks_init(void) static int __init stm32mp13_clocks_init(void)
......
...@@ -2081,7 +2081,10 @@ struct tegra_dfll_soc_data *tegra_dfll_unregister(struct platform_device *pdev) ...@@ -2081,7 +2081,10 @@ struct tegra_dfll_soc_data *tegra_dfll_unregister(struct platform_device *pdev)
{ {
struct tegra_dfll *td = platform_get_drvdata(pdev); struct tegra_dfll *td = platform_get_drvdata(pdev);
/* Try to prevent removal while the DFLL is active */ /*
* Note that exiting early here doesn't prevent unbinding the driver.
* Exiting early here only leaks some resources.
*/
if (td->mode != DFLL_DISABLED) { if (td->mode != DFLL_DISABLED) {
dev_err(&pdev->dev, dev_err(&pdev->dev,
"must disable DFLL before removing driver\n"); "must disable DFLL before removing driver\n");
......
...@@ -612,20 +612,19 @@ static int tegra124_dfll_fcpu_probe(struct platform_device *pdev) ...@@ -612,20 +612,19 @@ static int tegra124_dfll_fcpu_probe(struct platform_device *pdev)
return 0; return 0;
} }
static int tegra124_dfll_fcpu_remove(struct platform_device *pdev) static void tegra124_dfll_fcpu_remove(struct platform_device *pdev)
{ {
struct tegra_dfll_soc_data *soc; struct tegra_dfll_soc_data *soc;
/*
* Note that exiting early here is dangerous as after this function
* returns *soc is freed.
*/
soc = tegra_dfll_unregister(pdev); soc = tegra_dfll_unregister(pdev);
if (IS_ERR(soc)) { if (IS_ERR(soc))
dev_err(&pdev->dev, "failed to unregister DFLL: %ld\n", return;
PTR_ERR(soc));
return PTR_ERR(soc);
}
tegra_cvb_remove_opp_table(soc->dev, soc->cvb, soc->max_freq); tegra_cvb_remove_opp_table(soc->dev, soc->cvb, soc->max_freq);
return 0;
} }
static const struct dev_pm_ops tegra124_dfll_pm_ops = { static const struct dev_pm_ops tegra124_dfll_pm_ops = {
...@@ -636,7 +635,7 @@ static const struct dev_pm_ops tegra124_dfll_pm_ops = { ...@@ -636,7 +635,7 @@ static const struct dev_pm_ops tegra124_dfll_pm_ops = {
static struct platform_driver tegra124_dfll_fcpu_driver = { static struct platform_driver tegra124_dfll_fcpu_driver = {
.probe = tegra124_dfll_fcpu_probe, .probe = tegra124_dfll_fcpu_probe,
.remove = tegra124_dfll_fcpu_remove, .remove_new = tegra124_dfll_fcpu_remove,
.driver = { .driver = {
.name = "tegra124-dfll", .name = "tegra124-dfll",
.of_match_table = tegra124_dfll_fcpu_of_match, .of_match_table = tegra124_dfll_fcpu_of_match,
......
...@@ -931,13 +931,11 @@ static int ti_adpll_probe(struct platform_device *pdev) ...@@ -931,13 +931,11 @@ static int ti_adpll_probe(struct platform_device *pdev)
return err; return err;
} }
static int ti_adpll_remove(struct platform_device *pdev) static void ti_adpll_remove(struct platform_device *pdev)
{ {
struct ti_adpll_data *d = dev_get_drvdata(&pdev->dev); struct ti_adpll_data *d = dev_get_drvdata(&pdev->dev);
ti_adpll_free_resources(d); ti_adpll_free_resources(d);
return 0;
} }
static struct platform_driver ti_adpll_driver = { static struct platform_driver ti_adpll_driver = {
...@@ -946,7 +944,7 @@ static struct platform_driver ti_adpll_driver = { ...@@ -946,7 +944,7 @@ static struct platform_driver ti_adpll_driver = {
.of_match_table = ti_adpll_match, .of_match_table = ti_adpll_match,
}, },
.probe = ti_adpll_probe, .probe = ti_adpll_probe,
.remove = ti_adpll_remove, .remove_new = ti_adpll_remove,
}; };
static int __init ti_adpll_init(void) static int __init ti_adpll_init(void)
......
...@@ -91,11 +91,9 @@ static int uniphier_clk_probe(struct platform_device *pdev) ...@@ -91,11 +91,9 @@ static int uniphier_clk_probe(struct platform_device *pdev)
hw_data); hw_data);
} }
static int uniphier_clk_remove(struct platform_device *pdev) static void uniphier_clk_remove(struct platform_device *pdev)
{ {
of_clk_del_provider(pdev->dev.of_node); of_clk_del_provider(pdev->dev.of_node);
return 0;
} }
static const struct of_device_id uniphier_clk_match[] = { static const struct of_device_id uniphier_clk_match[] = {
...@@ -220,7 +218,7 @@ static const struct of_device_id uniphier_clk_match[] = { ...@@ -220,7 +218,7 @@ static const struct of_device_id uniphier_clk_match[] = {
static struct platform_driver uniphier_clk_driver = { static struct platform_driver uniphier_clk_driver = {
.probe = uniphier_clk_probe, .probe = uniphier_clk_probe,
.remove = uniphier_clk_remove, .remove_new = uniphier_clk_remove,
.driver = { .driver = {
.name = "uniphier-clk", .name = "uniphier-clk",
.of_match_table = uniphier_clk_match, .of_match_table = uniphier_clk_match,
......
...@@ -92,14 +92,14 @@ static int fch_clk_probe(struct platform_device *pdev) ...@@ -92,14 +92,14 @@ static int fch_clk_probe(struct platform_device *pdev)
return 0; return 0;
} }
static int fch_clk_remove(struct platform_device *pdev) static void fch_clk_remove(struct platform_device *pdev)
{ {
int i, clks; int i, clks;
struct pci_dev *rdev; struct pci_dev *rdev;
rdev = pci_get_domain_bus_and_slot(0, 0, PCI_DEVFN(0, 0)); rdev = pci_get_domain_bus_and_slot(0, 0, PCI_DEVFN(0, 0));
if (!rdev) if (!rdev)
return -ENODEV; return;
clks = pci_match_id(fch_pci_ids, rdev) ? CLK_MAX_FIXED : ST_MAX_CLKS; clks = pci_match_id(fch_pci_ids, rdev) ? CLK_MAX_FIXED : ST_MAX_CLKS;
...@@ -107,7 +107,6 @@ static int fch_clk_remove(struct platform_device *pdev) ...@@ -107,7 +107,6 @@ static int fch_clk_remove(struct platform_device *pdev)
clk_hw_unregister(hws[i]); clk_hw_unregister(hws[i]);
pci_dev_put(rdev); pci_dev_put(rdev);
return 0;
} }
static struct platform_driver fch_clk_driver = { static struct platform_driver fch_clk_driver = {
...@@ -116,6 +115,6 @@ static struct platform_driver fch_clk_driver = { ...@@ -116,6 +115,6 @@ static struct platform_driver fch_clk_driver = {
.suppress_bind_attrs = true, .suppress_bind_attrs = true,
}, },
.probe = fch_clk_probe, .probe = fch_clk_probe,
.remove = fch_clk_remove, .remove_new = fch_clk_remove,
}; };
builtin_platform_driver(fch_clk_driver); builtin_platform_driver(fch_clk_driver);
...@@ -367,7 +367,7 @@ static int plt_clk_probe(struct platform_device *pdev) ...@@ -367,7 +367,7 @@ static int plt_clk_probe(struct platform_device *pdev)
return err; return err;
} }
static int plt_clk_remove(struct platform_device *pdev) static void plt_clk_remove(struct platform_device *pdev)
{ {
struct clk_plt_data *data; struct clk_plt_data *data;
...@@ -377,7 +377,6 @@ static int plt_clk_remove(struct platform_device *pdev) ...@@ -377,7 +377,6 @@ static int plt_clk_remove(struct platform_device *pdev)
clkdev_drop(data->mclk_lookup); clkdev_drop(data->mclk_lookup);
plt_clk_unregister_loop(data, PMC_CLK_NUM); plt_clk_unregister_loop(data, PMC_CLK_NUM);
plt_clk_unregister_parents(data); plt_clk_unregister_parents(data);
return 0;
} }
static struct platform_driver plt_clk_driver = { static struct platform_driver plt_clk_driver = {
...@@ -385,6 +384,6 @@ static struct platform_driver plt_clk_driver = { ...@@ -385,6 +384,6 @@ static struct platform_driver plt_clk_driver = {
.name = "clk-pmc-atom", .name = "clk-pmc-atom",
}, },
.probe = plt_clk_probe, .probe = plt_clk_probe,
.remove = plt_clk_remove, .remove_new = plt_clk_remove,
}; };
builtin_platform_driver(plt_clk_driver); builtin_platform_driver(plt_clk_driver);
This diff is collapsed.
...@@ -702,13 +702,11 @@ static int xvcu_probe(struct platform_device *pdev) ...@@ -702,13 +702,11 @@ static int xvcu_probe(struct platform_device *pdev)
* Return: Returns 0 on success * Return: Returns 0 on success
* Negative error code otherwise * Negative error code otherwise
*/ */
static int xvcu_remove(struct platform_device *pdev) static void xvcu_remove(struct platform_device *pdev)
{ {
struct xvcu_device *xvcu; struct xvcu_device *xvcu;
xvcu = platform_get_drvdata(pdev); xvcu = platform_get_drvdata(pdev);
if (!xvcu)
return -ENODEV;
xvcu_unregister_clock_provider(xvcu); xvcu_unregister_clock_provider(xvcu);
...@@ -716,8 +714,6 @@ static int xvcu_remove(struct platform_device *pdev) ...@@ -716,8 +714,6 @@ static int xvcu_remove(struct platform_device *pdev)
regmap_write(xvcu->logicore_reg_ba, VCU_GASKET_INIT, 0); regmap_write(xvcu->logicore_reg_ba, VCU_GASKET_INIT, 0);
clk_disable_unprepare(xvcu->aclk); clk_disable_unprepare(xvcu->aclk);
return 0;
} }
static const struct of_device_id xvcu_of_id_table[] = { static const struct of_device_id xvcu_of_id_table[] = {
...@@ -733,7 +729,7 @@ static struct platform_driver xvcu_driver = { ...@@ -733,7 +729,7 @@ static struct platform_driver xvcu_driver = {
.of_match_table = xvcu_of_id_table, .of_match_table = xvcu_of_id_table,
}, },
.probe = xvcu_probe, .probe = xvcu_probe,
.remove = xvcu_remove, .remove_new = xvcu_remove,
}; };
module_platform_driver(xvcu_driver); module_platform_driver(xvcu_driver);
......
...@@ -341,7 +341,5 @@ struct clk_hw *zynqmp_clk_register_pll(const char *name, u32 clk_id, ...@@ -341,7 +341,5 @@ struct clk_hw *zynqmp_clk_register_pll(const char *name, u32 clk_id,
return ERR_PTR(ret); return ERR_PTR(ret);
} }
clk_hw_set_rate_range(hw, PS_PLL_VCO_MIN, PS_PLL_VCO_MAX);
return hw; return hw;
} }
...@@ -27,4 +27,17 @@ ...@@ -27,4 +27,17 @@
#define BCM63268_CLK_TBUS 27 #define BCM63268_CLK_TBUS 27
#define BCM63268_CLK_ROBOSW250 31 #define BCM63268_CLK_ROBOSW250 31
#define BCM63268_TCLK_EPHY1 0
#define BCM63268_TCLK_EPHY2 1
#define BCM63268_TCLK_EPHY3 2
#define BCM63268_TCLK_GPHY1 3
#define BCM63268_TCLK_DSL 4
#define BCM63268_TCLK_WAKEON_EPHY 6
#define BCM63268_TCLK_WAKEON_DSL 7
#define BCM63268_TCLK_FAP1 11
#define BCM63268_TCLK_FAP2 15
#define BCM63268_TCLK_UTO_50 16
#define BCM63268_TCLK_UTO_EXTIN 17
#define BCM63268_TCLK_USB_REF 18
#endif /* __DT_BINDINGS_CLOCK_BCM63268_H */ #endif /* __DT_BINDINGS_CLOCK_BCM63268_H */
...@@ -23,4 +23,8 @@ ...@@ -23,4 +23,8 @@
#define BCM63268_RST_PCIE_HARD 17 #define BCM63268_RST_PCIE_HARD 17
#define BCM63268_RST_GPHY 18 #define BCM63268_RST_GPHY 18
#define BCM63268_TRST_SW 29
#define BCM63268_TRST_HW 30
#define BCM63268_TRST_POR 31
#endif /* __DT_BINDINGS_RESET_BCM63268_H */ #endif /* __DT_BINDINGS_RESET_BCM63268_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment