lkml.org 
[lkml]   [2019]   [Sep]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 4.19 32/79] fpga: altera-ps-spi: Fix getting of optional confd gpio
From
Date
On 22/09/2019 04:46, Pavel Machek wrote:
> Hi!
>
>> Currently the driver does not handle EPROBE_DEFER for the confd gpio.
>> Use devm_gpiod_get_optional() instead of devm_gpiod_get() and return
>> error codes from altera_ps_probe().
>
>> @@ -265,10 +265,13 @@ static int altera_ps_probe(struct spi_device *spi)
>> return PTR_ERR(conf->status);
>> }
>>
>> - conf->confd = devm_gpiod_get(&spi->dev, "confd", GPIOD_IN);
>> + conf->confd = devm_gpiod_get_optional(&spi->dev, "confd", GPIOD_IN);
>> if (IS_ERR(conf->confd)) {
>> - dev_warn(&spi->dev, "Not using confd gpio: %ld\n",
>> - PTR_ERR(conf->confd));
>> + dev_err(&spi->dev, "Failed to get confd gpio: %ld\n",
>> + PTR_ERR(conf->confd));
>> + return PTR_ERR(conf->confd);
>
> Will this result in repeated errors in dmesg in case of EPROBE_DEFER?
> We often avoid printing such messages in EPROBE_DEFER case.

Yes it will. I can submit a patch for that if required.

>
>> + } else if (!conf->confd) {
>> + dev_warn(&spi->dev, "Not using confd gpio");
>> }
>>
>> /* Register manager with unique name */
>
> Best regards,
> Pavel
>


--
Regards
Phil Reid

\
 
 \ /
  Last update: 2019-09-23 03:35    [W:0.082 / U:0.540 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site