diff options
author | Rob Herring <robh@kernel.org> | 2023-10-17 15:36:10 -0500 |
---|---|---|
committer | Lee Jones <lee@kernel.org> | 2023-11-01 10:02:17 +0000 |
commit | 830fafce06e6fc2e63e141799833f7c7a73cf62b (patch) | |
tree | d9b5f379a230da54e8a8b70c1095c2e65d72acbb /drivers/mfd/mxs-lradc.c | |
parent | 15d71e678ec14ce26f7a271fef363e5c04ec24bf (diff) | |
download | lwn-830fafce06e6fc2e63e141799833f7c7a73cf62b.tar.gz lwn-830fafce06e6fc2e63e141799833f7c7a73cf62b.zip |
mfd: Use device_get_match_data() in a bunch of drivers
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.
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20231017203612.2701060-1-robh@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
Diffstat (limited to 'drivers/mfd/mxs-lradc.c')
-rw-r--r-- | drivers/mfd/mxs-lradc.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/mfd/mxs-lradc.c b/drivers/mfd/mxs-lradc.c index 21f3033d6eb5..ec1b356562b9 100644 --- a/drivers/mfd/mxs-lradc.c +++ b/drivers/mfd/mxs-lradc.c @@ -16,8 +16,8 @@ #include <linux/mfd/mxs-lradc.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/slab.h> #define ADC_CELL 0 @@ -125,7 +125,6 @@ MODULE_DEVICE_TABLE(of, mxs_lradc_dt_ids); static int mxs_lradc_probe(struct platform_device *pdev) { - const struct of_device_id *of_id; struct device *dev = &pdev->dev; struct device_node *node = dev->of_node; struct mxs_lradc *lradc; @@ -138,11 +137,7 @@ static int mxs_lradc_probe(struct platform_device *pdev) if (!lradc) return -ENOMEM; - of_id = of_match_device(mxs_lradc_dt_ids, &pdev->dev); - if (!of_id) - return -EINVAL; - - lradc->soc = (uintptr_t)of_id->data; + lradc->soc = (enum mxs_lradc_id)device_get_match_data(&pdev->dev); lradc->clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(lradc->clk)) { |