File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717#include <linux/irqdomain.h>
1818#include <linux/mfd/syscon.h>
1919#include <linux/module.h>
20- #include <linux/of_device .h>
20+ #include <linux/of .h>
2121#include <linux/of_platform.h>
2222#include <linux/platform_device.h>
2323#include <linux/pm_runtime.h>
24+ #include <linux/property.h>
2425#include <linux/regmap.h>
2526#include <linux/regulator/consumer.h>
2627#include <linux/slab.h>
@@ -708,8 +709,6 @@ static int stm32_adc_probe(struct platform_device *pdev)
708709 struct stm32_adc_priv * priv ;
709710 struct device * dev = & pdev -> dev ;
710711 struct device_node * np = pdev -> dev .of_node ;
711- const struct of_device_id * of_id ;
712-
713712 struct resource * res ;
714713 u32 max_rate ;
715714 int ret ;
@@ -722,11 +721,7 @@ static int stm32_adc_probe(struct platform_device *pdev)
722721 return - ENOMEM ;
723722 platform_set_drvdata (pdev , & priv -> common );
724723
725- of_id = of_match_device (dev -> driver -> of_match_table , dev );
726- if (!of_id )
727- return - ENODEV ;
728-
729- priv -> cfg = (const struct stm32_adc_priv_cfg * )of_id -> data ;
724+ priv -> cfg = device_get_match_data (dev );
730725 priv -> nb_adc_max = priv -> cfg -> num_adcs ;
731726 spin_lock_init (& priv -> common .lock );
732727
Original file line number Diff line number Diff line change 1616 */
1717#include <linux/interrupt.h>
1818#include <linux/kernel.h>
19+ #include <linux/mod_devicetable.h>
1920#include <linux/module.h>
2021#include <linux/platform_device.h>
21- #include <linux/of_platform .h>
22+ #include <linux/property .h>
2223#include <linux/mfd/twl.h>
2324#include <linux/iio/iio.h>
2425#include <linux/iio/sysfs.h>
@@ -879,17 +880,14 @@ static int twl6030_gpadc_probe(struct platform_device *pdev)
879880 struct device * dev = & pdev -> dev ;
880881 struct twl6030_gpadc_data * gpadc ;
881882 const struct twl6030_gpadc_platform_data * pdata ;
882- const struct of_device_id * match ;
883883 struct iio_dev * indio_dev ;
884884 int irq ;
885885 int ret ;
886886
887- match = of_match_device ( of_twl6030_match_tbl , dev );
888- if (!match )
887+ pdata = device_get_match_data ( & pdev -> dev );
888+ if (!pdata )
889889 return - EINVAL ;
890890
891- pdata = match -> data ;
892-
893891 indio_dev = devm_iio_device_alloc (dev , sizeof (* gpadc ));
894892 if (!indio_dev )
895893 return - ENOMEM ;
Original file line number Diff line number Diff line change 99
1010#include <linux/clk.h>
1111#include <linux/delay.h>
12+ #include <linux/mod_devicetable.h>
1213#include <linux/module.h>
1314#include <linux/of_platform.h>
15+ #include <linux/platform_device.h>
1416#include <linux/pm_runtime.h>
17+ #include <linux/property.h>
1518#include <linux/regulator/consumer.h>
1619#include <linux/reset.h>
1720
@@ -94,16 +97,12 @@ static int stm32_dac_probe(struct platform_device *pdev)
9497 struct reset_control * rst ;
9598 int ret ;
9699
97- if (!dev -> of_node )
98- return - ENODEV ;
99-
100100 priv = devm_kzalloc (dev , sizeof (* priv ), GFP_KERNEL );
101101 if (!priv )
102102 return - ENOMEM ;
103103 platform_set_drvdata (pdev , & priv -> common );
104104
105- cfg = (const struct stm32_dac_cfg * )
106- of_match_device (dev -> driver -> of_match_table , dev )-> data ;
105+ cfg = device_get_match_data (dev );
107106
108107 mmio = devm_platform_ioremap_resource (pdev , 0 );
109108 if (IS_ERR (mmio ))
You can’t perform that action at this time.
0 commit comments