Thread (8 messages) 8 messages, 3 authors, 2019-02-06

Re: [PATCH v3 2/3] Input: add new vibrator driver for various MSM SOCs

From: Brian Masney <hidden>
Date: 2019-02-06 00:52:20
Also in: linux-arm-msm, linux-devicetree, lkml

On Tue, Feb 05, 2019 at 11:42:46AM -0800, Dmitry Torokhov wrote:
quoted
+		dev_err(&pdev->dev, "Failed to lookup pwm clock: %ld\n",
+			PTR_ERR(vibrator->clk));
+		return PTR_ERR(vibrator->clk);
+	}
+
+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	if (!res) {
+		dev_err(&pdev->dev, "Failed to get platform resource\n");
+		return -ENODEV;
+	}
+
+	vibrator->base = devm_ioremap(&pdev->dev, res->start,
+				     resource_size(res));
+	if (IS_ERR(vibrator->base)) {
devm_ioremap() returns NULL on error. You either need to check for NULL
or see of you can use devm_ioremap_resource().
I originally tried to use devm_ioremap_resource() but the call to
devm_request_mem_region() would fail. I'll go with the NULL check here
for devm_ioremap().

Thanks for the review!

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