hc
2024-05-14 bedbef8ad3e75a304af6361af235302bcc61d06b
kernel/drivers/watchdog/ep93xx_wdt.c
....@@ -89,18 +89,17 @@
8989
9090 static int ep93xx_wdt_probe(struct platform_device *pdev)
9191 {
92
+ struct device *dev = &pdev->dev;
9293 struct ep93xx_wdt_priv *priv;
9394 struct watchdog_device *wdd;
94
- struct resource *res;
9595 unsigned long val;
9696 int ret;
9797
98
- priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
98
+ priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
9999 if (!priv)
100100 return -ENOMEM;
101101
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);
104103 if (IS_ERR(priv->mmio))
105104 return PTR_ERR(priv->mmio);
106105
....@@ -112,21 +111,21 @@
112111 wdd->ops = &ep93xx_wdt_ops;
113112 wdd->min_timeout = 1;
114113 wdd->max_hw_heartbeat_ms = 200;
115
- wdd->parent = &pdev->dev;
114
+ wdd->parent = dev;
116115
117116 watchdog_set_nowayout(wdd, nowayout);
118117
119118 wdd->timeout = WDT_TIMEOUT;
120
- watchdog_init_timeout(wdd, timeout, &pdev->dev);
119
+ watchdog_init_timeout(wdd, timeout, dev);
121120
122121 watchdog_set_drvdata(wdd, priv);
123122
124
- ret = devm_watchdog_register_device(&pdev->dev, wdd);
123
+ ret = devm_watchdog_register_device(dev, wdd);
125124 if (ret)
126125 return ret;
127126
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)" : "");
130129
131130 return 0;
132131 }