| .. | .. |
|---|
| 21 | 21 | #include <linux/kernel.h> |
|---|
| 22 | 22 | #include <linux/fs.h> |
|---|
| 23 | 23 | #include <linux/miscdevice.h> |
|---|
| 24 | +#include <linux/of.h> |
|---|
| 24 | 25 | #include <linux/watchdog.h> |
|---|
| 25 | 26 | #include <linux/init.h> |
|---|
| 26 | 27 | #include <linux/bitops.h> |
|---|
| .. | .. |
|---|
| 65 | 66 | |
|---|
| 66 | 67 | clear_bit(WDT_OK_TO_CLOSE, &wdt_status); |
|---|
| 67 | 68 | wdt_enable(); |
|---|
| 68 | | - return nonseekable_open(inode, file); |
|---|
| 69 | + return stream_open(inode, file); |
|---|
| 69 | 70 | } |
|---|
| 70 | 71 | |
|---|
| 71 | 72 | static ssize_t |
|---|
| .. | .. |
|---|
| 135 | 136 | |
|---|
| 136 | 137 | heartbeat = time; |
|---|
| 137 | 138 | wdt_enable(); |
|---|
| 138 | | - /* Fall through */ |
|---|
| 139 | + fallthrough; |
|---|
| 139 | 140 | |
|---|
| 140 | 141 | case WDIOC_GETTIMEOUT: |
|---|
| 141 | 142 | ret = put_user(heartbeat, (int *)arg); |
|---|
| .. | .. |
|---|
| 162 | 163 | .llseek = no_llseek, |
|---|
| 163 | 164 | .write = ixp4xx_wdt_write, |
|---|
| 164 | 165 | .unlocked_ioctl = ixp4xx_wdt_ioctl, |
|---|
| 166 | + .compat_ioctl = compat_ptr_ioctl, |
|---|
| 165 | 167 | .open = ixp4xx_wdt_open, |
|---|
| 166 | 168 | .release = ixp4xx_wdt_release, |
|---|
| 167 | 169 | }; |
|---|
| .. | .. |
|---|
| 176 | 178 | { |
|---|
| 177 | 179 | int ret; |
|---|
| 178 | 180 | |
|---|
| 181 | + /* |
|---|
| 182 | + * FIXME: we bail out on device tree boot but this really needs |
|---|
| 183 | + * to be fixed in a nicer way: this registers the MDIO bus before |
|---|
| 184 | + * even matching the driver infrastructure, we should only probe |
|---|
| 185 | + * detected hardware. |
|---|
| 186 | + */ |
|---|
| 187 | + if (of_have_populated_dt()) |
|---|
| 188 | + return -ENODEV; |
|---|
| 179 | 189 | if (!(read_cpuid_id() & 0xf) && !cpu_is_ixp46x()) { |
|---|
| 180 | 190 | pr_err("Rev. A0 IXP42x CPU detected - watchdog disabled\n"); |
|---|
| 181 | 191 | |
|---|