Thread (9 messages) 9 messages, 4 authors, 2021-12-25

Re: [PATCH v3 3/3] mmc: Add driver for LiteX's LiteSDCard interface

From: Andy Shevchenko <hidden>
Date: 2021-12-25 16:40:26
Also in: linux-mmc, lkml

On Wed, Dec 8, 2021 at 6:15 PM Gabriel Somlo [off-list ref] 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help