lkml.org 
[lkml]   [2019]   [Feb]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 2/3] Input: add new vibrator driver for various MSM SOCs
On Tue, Feb 05, 2019 at 11:42:46AM -0800, Dmitry Torokhov wrote:
> > + 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

\
 
 \ /
  Last update: 2019-02-06 01:53    [W:0.067 / U:3.472 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site