lkml.org 
[lkml]   [2022]   [Jun]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] spi: microchip-core: fix passing zero to PTR_ERR warning
Date
On 15/06/2022 13:37, Mark Brown wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>
> On Wed, Jun 15, 2022 at 11:57:37AM +0000, Conor.Dooley@microchip.com wrote:
>> On 15/06/2022 12:40, Mark Brown wrote:
>>> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>>> On Wed, Jun 15, 2022 at 12:30:22PM +0100, Conor Dooley wrote:
>
>>>> - ret = PTR_ERR(spi->clk);
>>>> + ret = !spi->clk ? -ENXIO : PTR_ERR(spi->clk);
>
>>> I think you're looking for PTR_ERR_OR_ZERO() here?
>
>> Maybe I don't understand, so let me explain what I think you're
>> suggesting & maybe you can correct me:
>
>>> - ret = PTR_ERR(spi->clk);
>>> + ret = PTR_ERR_OR_ZERO(spi->clk);
>
>> But if spi->clk is NULL, this will return 0 from the probe
>> rather than returning an error?
>> If that's not what you meant, lmk
>
> Oh, hang on - what error conditions can clk_get() return 0 in? The
> documentation doesn't mention any...

If !CONFIG_HAVE_CLK, (without which it won't boot on the coreplex)
but I don't think I can be sure that CONFIG_HAVE_CLK will /always/
be enabled for other uses of the FPGA.

\
 
 \ /
  Last update: 2022-06-15 14:43    [W:0.058 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site