lkml.org 
[lkml]   [2022]   [Oct]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v3 1/2] pinctrl: pinctrl-loongson2: add pinctrl driver support
From
On 27/10/2022 04:20, Yinbo Zhu wrote:
> You can find these code has a change in this code conext. I have a
> feedback on this code. but I mistakenly thought helper is dev_err_probe.
> res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> pctrl->reg_base = devm_ioremap_resource(dev, res);
> if (IS_ERR(pctrl->reg_base))
> - return PTR_ERR(pctrl->reg_base);
> + return dev_err_probe(pctrl->dev, PTR_ERR(pctrl->reg_base),
> + "unable to map I/O memory");
>
> raw_spin_lock_init(&pctrl->lock);
>
>>
>> There is a helper combining two calls into one. Grep for it in headers
>> and use it.
>>
> You said is that use "devm_platform_get_and_ioremap_resource" as a
> helper? sorry, I will do it.

I believe the helper is devm_platform_ioremap_resource(), but I never
remember the names so just check in the sources.

Best regards,
Krzysztof

\
 
 \ /
  Last update: 2022-10-27 14:51    [W:0.057 / U:0.312 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site