.. | .. |
---|
89 | 89 | |
---|
90 | 90 | static int ep93xx_wdt_probe(struct platform_device *pdev) |
---|
91 | 91 | { |
---|
| 92 | + struct device *dev = &pdev->dev; |
---|
92 | 93 | struct ep93xx_wdt_priv *priv; |
---|
93 | 94 | struct watchdog_device *wdd; |
---|
94 | | - struct resource *res; |
---|
95 | 95 | unsigned long val; |
---|
96 | 96 | int ret; |
---|
97 | 97 | |
---|
98 | | - priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); |
---|
| 98 | + priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); |
---|
99 | 99 | if (!priv) |
---|
100 | 100 | return -ENOMEM; |
---|
101 | 101 | |
---|
102 | | - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
---|
103 | | - priv->mmio = devm_ioremap_resource(&pdev->dev, res); |
---|
| 102 | + priv->mmio = devm_platform_ioremap_resource(pdev, 0); |
---|
104 | 103 | if (IS_ERR(priv->mmio)) |
---|
105 | 104 | return PTR_ERR(priv->mmio); |
---|
106 | 105 | |
---|
.. | .. |
---|
112 | 111 | wdd->ops = &ep93xx_wdt_ops; |
---|
113 | 112 | wdd->min_timeout = 1; |
---|
114 | 113 | wdd->max_hw_heartbeat_ms = 200; |
---|
115 | | - wdd->parent = &pdev->dev; |
---|
| 114 | + wdd->parent = dev; |
---|
116 | 115 | |
---|
117 | 116 | watchdog_set_nowayout(wdd, nowayout); |
---|
118 | 117 | |
---|
119 | 118 | wdd->timeout = WDT_TIMEOUT; |
---|
120 | | - watchdog_init_timeout(wdd, timeout, &pdev->dev); |
---|
| 119 | + watchdog_init_timeout(wdd, timeout, dev); |
---|
121 | 120 | |
---|
122 | 121 | watchdog_set_drvdata(wdd, priv); |
---|
123 | 122 | |
---|
124 | | - ret = devm_watchdog_register_device(&pdev->dev, wdd); |
---|
| 123 | + ret = devm_watchdog_register_device(dev, wdd); |
---|
125 | 124 | if (ret) |
---|
126 | 125 | return ret; |
---|
127 | 126 | |
---|
128 | | - dev_info(&pdev->dev, "EP93XX watchdog driver %s\n", |
---|
129 | | - (val & 0x08) ? " (nCS1 disable detected)" : ""); |
---|
| 127 | + dev_info(dev, "EP93XX watchdog driver %s\n", |
---|
| 128 | + (val & 0x08) ? " (nCS1 disable detected)" : ""); |
---|
130 | 129 | |
---|
131 | 130 | return 0; |
---|
132 | 131 | } |
---|