hc
2024-05-10 ee930fffee469d076998274a2ca55e13dc1efb67
kernel/drivers/misc/atmel_tclib.c
....@@ -1,4 +1,4 @@
1
-#include <linux/atmel_tc.h>
1
+// SPDX-License-Identifier: GPL-2.0-only
22 #include <linux/clk.h>
33 #include <linux/err.h>
44 #include <linux/init.h>
....@@ -10,6 +10,7 @@
1010 #include <linux/slab.h>
1111 #include <linux/export.h>
1212 #include <linux/of.h>
13
+#include <soc/at91/atmel_tcb.h>
1314
1415 /*
1516 * This is a thin library to solve the problem of how to portably allocate
....@@ -108,8 +109,10 @@
108109 struct atmel_tc *tc;
109110 struct clk *clk;
110111 int irq;
111
- struct resource *r;
112112 unsigned int i;
113
+
114
+ if (of_get_child_count(pdev->dev.of_node))
115
+ return -EBUSY;
113116
114117 irq = platform_get_irq(pdev, 0);
115118 if (irq < 0)
....@@ -129,8 +132,7 @@
129132 if (IS_ERR(tc->slow_clk))
130133 return PTR_ERR(tc->slow_clk);
131134
132
- r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
133
- tc->regs = devm_ioremap_resource(&pdev->dev, r);
135
+ tc->regs = devm_platform_ioremap_resource(pdev, 0);
134136 if (IS_ERR(tc->regs))
135137 return PTR_ERR(tc->regs);
136138