.. | .. |
---|
1 | | -#include <linux/atmel_tc.h> |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
2 | 2 | #include <linux/clk.h> |
---|
3 | 3 | #include <linux/err.h> |
---|
4 | 4 | #include <linux/init.h> |
---|
.. | .. |
---|
10 | 10 | #include <linux/slab.h> |
---|
11 | 11 | #include <linux/export.h> |
---|
12 | 12 | #include <linux/of.h> |
---|
| 13 | +#include <soc/at91/atmel_tcb.h> |
---|
13 | 14 | |
---|
14 | 15 | /* |
---|
15 | 16 | * This is a thin library to solve the problem of how to portably allocate |
---|
.. | .. |
---|
108 | 109 | struct atmel_tc *tc; |
---|
109 | 110 | struct clk *clk; |
---|
110 | 111 | int irq; |
---|
111 | | - struct resource *r; |
---|
112 | 112 | unsigned int i; |
---|
| 113 | + |
---|
| 114 | + if (of_get_child_count(pdev->dev.of_node)) |
---|
| 115 | + return -EBUSY; |
---|
113 | 116 | |
---|
114 | 117 | irq = platform_get_irq(pdev, 0); |
---|
115 | 118 | if (irq < 0) |
---|
.. | .. |
---|
129 | 132 | if (IS_ERR(tc->slow_clk)) |
---|
130 | 133 | return PTR_ERR(tc->slow_clk); |
---|
131 | 134 | |
---|
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); |
---|
134 | 136 | if (IS_ERR(tc->regs)) |
---|
135 | 137 | return PTR_ERR(tc->regs); |
---|
136 | 138 | |
---|