Thread (5 messages) 5 messages, 3 authors, 2019-08-12

Re: [PATCH v2 2/2] rtc: Add Amlogic Virtual Wake RTC

From: Kevin Hilman <khilman@baylibre.com>
Date: 2019-08-12 23:21:33
Also in: linux-amlogic, linux-rtc

Alexandre Belloni [off-list ref] writes:
On 07/08/2019 21:23:57-0700, Kevin Hilman wrote:
quoted
+static int meson_vrtc_probe(struct platform_device *pdev)
+{
+	struct meson_vrtc_data *vrtc;
+	struct resource *res;
+
+	vrtc = devm_kzalloc(&pdev->dev, sizeof(*vrtc), GFP_KERNEL);
+	if (!vrtc)
+		return -ENOMEM;
+
+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	vrtc->io_alarm = devm_ioremap_resource(&pdev->dev, res);
You could use devm_platform_ioremap_resource.
quoted
+	if (IS_ERR(vrtc->io_alarm))
+		return PTR_ERR(vrtc->io_alarm);
+
+	device_init_wakeup(&pdev->dev, 1);
+
+	platform_set_drvdata(pdev, vrtc);
+
+	vrtc->rtc = devm_rtc_device_register(&pdev->dev, "meson-vrtc",
+					     &meson_vrtc_ops, THIS_MODULE);
Please use devm_rtc_allocate_device and rtc_register_device.
OK, will update both and send a v3.

Thanks for the review,

Kevin

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help