Thread (2 messages) 2 messages, 2 authors, 2018-02-12

Re: [RFC v4 12/26] watchdog: renesas_wdt: Add R-Car Gen2 support

From: Wolfram Sang <hidden>
Date: 2018-02-07 22:53:56
Also in: linux-arm-kernel, linux-clk, linux-renesas-soc, linux-watchdog

Possibly related (same subject, not in this thread)

+#ifdef CONFIG_PM
+static int rwdt_suspend(struct device *dev)
+{
+	struct platform_device *pdev;
+	struct rwdt_priv *priv;
+
+	pdev = to_platform_device(dev);
+	priv = platform_get_drvdata(pdev);
struct rwdt_priv *priv = dev_get_drvdata(dev);

?

+	if (watchdog_active(&priv->wdev)) {
+		rwdt_write(priv, priv->cks, RWTCSRA);
+	}
+	return 0;
+}
+
+static int rwdt_resume(struct device *dev)
+{
+	struct platform_device *pdev;
+	struct rwdt_priv *priv;
+
+	pdev = to_platform_device(dev);
+	priv = platform_get_drvdata(pdev);
ditto
+	if (watchdog_active(&priv->wdev)) {
+		rwdt_write(priv, priv->cks | RWTCSRA_TME, RWTCSRA);
+	}
+	return 0;
+}
+
+static const struct dev_pm_ops rwdt_pm = {
+	.suspend = rwdt_suspend,
+	.resume = rwdt_resume,
+};
Use SIMPLE_DEV_PM_OPS macro (see stmp3xxx_rtc_wdt.c for an example) for
more compact code and...
+#ifdef CONFIG_PM
+		.pm = &rwdt_pm,
+#endif
... removing this ifdeffery?

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help