diff options
author | Rob Herring <robh@kernel.org> | 2023-10-06 16:39:58 -0500 |
---|---|---|
committer | Stephen Boyd <sboyd@kernel.org> | 2023-10-23 20:16:21 -0700 |
commit | 409c39ec92a35e3708f5b5798c78eae78512cd71 (patch) | |
tree | fce942519c2e665033d29f497bc8763d7a1fb559 /drivers/clk/clk-lochnagar.c | |
parent | faf6b92ee0091ff7a7bba03a1726a1a97112e9db (diff) | |
download | lwn-409c39ec92a35e3708f5b5798c78eae78512cd71.tar.gz lwn-409c39ec92a35e3708f5b5798c78eae78512cd71.zip |
clk: Use device_get_match_data()
Use preferred device_get_match_data() instead of of_match_device() to
get the driver match data. With this, adjust the includes to explicitly
include the correct headers.
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20231006213959.334439-1-robh@kernel.org
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> #msm part
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> # Samsung
Acked-by: David Lechner <david@lechnology.com>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'drivers/clk/clk-lochnagar.c')
-rw-r--r-- | drivers/clk/clk-lochnagar.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/clk/clk-lochnagar.c b/drivers/clk/clk-lochnagar.c index db468a62c8d7..5561a2c66b69 100644 --- a/drivers/clk/clk-lochnagar.c +++ b/drivers/clk/clk-lochnagar.c @@ -12,8 +12,8 @@ #include <linux/device.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/of_device.h> #include <linux/platform_device.h> +#include <linux/property.h> #include <linux/regmap.h> #include <linux/mfd/lochnagar1_regs.h> @@ -242,22 +242,17 @@ static int lochnagar_clk_probe(struct platform_device *pdev) }; struct device *dev = &pdev->dev; struct lochnagar_clk_priv *priv; - const struct of_device_id *of_id; struct lochnagar_clk *lclk; struct lochnagar_config *conf; int ret, i; - of_id = of_match_device(lochnagar_of_match, dev); - if (!of_id) - return -EINVAL; - priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); if (!priv) return -ENOMEM; priv->dev = dev; priv->regmap = dev_get_regmap(dev->parent, NULL); - conf = (struct lochnagar_config *)of_id->data; + conf = (struct lochnagar_config *)device_get_match_data(dev); memcpy(priv->lclks, conf->clks, sizeof(priv->lclks)); |