[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAHp75VcPgN5Q=Zk2g3Xj+WcxS1JG=nyoDrtWFL=96-rpPhkW2g@mail.gmail.com>
Date: Sat, 25 Dec 2021 18:39:45 +0200
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: gsomlo@...il.com
Cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Rob Herring <robh+dt@...nel.org>,
devicetree <devicetree@...r.kernel.org>,
Ulf Hansson <ulf.hansson@...aro.org>,
linux-mmc <linux-mmc@...r.kernel.org>,
Karol Gugala <kgugala@...micro.com>,
Mateusz Holenko <mholenko@...micro.com>, krakoczy@...micro.com,
mdudek@...ernships.antmicro.com, paulus@...abs.org,
Joel Stanley <joel@....id.au>,
Stafford Horne <shorne@...il.com>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
david.abdurachmanov@...ive.com, florent@...oy-digital.fr,
Randy Dunlap <rdunlap@...radead.org>
Subject: Re: [PATCH v3 3/3] mmc: Add driver for LiteX's LiteSDCard interface
On Wed, Dec 8, 2021 at 6:15 PM Gabriel Somlo <gsomlo@...il.com> wrote:
>
> LiteX (https://github.com/enjoy-digital/litex) is a SoC framework
> that targets FPGAs. LiteSDCard is a small footprint, configurable
> SDCard core commonly used in LiteX designs.
...
> + int ret;
> +
> + host->irq = platform_get_irq_optional(host->dev, 0);
> + if (host->irq <= 0) {
> + dev_warn(dev, "Failed to get IRQ, using polling\n");
> + goto use_polling;
> + }
This is wrong. It missed the deferred probe, for example.
The best approach is
ret = platform_get_irq_optional(...);
if (ret < 0 && ret != -ENXIO)
return ret;
if (ret > 0)
...we got it...
It will allow the future API fix of platform_get_irq_optional() to be
really optional.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists