diff mbox series

[RESEND,v1] platform/x86: i2c-multi-instantiate: Fail the probe if no IRQ provided

Message ID 20191014115739.15342-1-andriy.shevchenko@linux.intel.com (mailing list archive)
State Accepted, archived
Headers show
Series [RESEND,v1] platform/x86: i2c-multi-instantiate: Fail the probe if no IRQ provided | expand

Commit Message

Andy Shevchenko Oct. 14, 2019, 11:57 a.m. UTC
For APIC case of interrupt we don't fail a ->probe() of the driver,
which makes kernel to print a lot of warnings from the children.

We have two options here:
- switch to platform_get_irq_optional(), though it won't stop children
  to be probed and failed
- fail the ->probe() of i2c-multi-instantiate

Since the in reality we never had devices in the wild where IRQ resource
is optional, the latter solution suits the best.

Fixes: 799d3379a672 ("platform/x86: i2c-multi-instantiate: Introduce IOAPIC IRQ support")
Reported-by: Ammy Yi <ammy.yi@intel.com>
Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
- Cc Ammy
 drivers/platform/x86/i2c-multi-instantiate.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Hans de Goede Oct. 16, 2019, 8:40 a.m. UTC | #1
Hi,

On 10/14/19 1:57 PM, Andy Shevchenko wrote:
> For APIC case of interrupt we don't fail a ->probe() of the driver,
> which makes kernel to print a lot of warnings from the children.
> 
> We have two options here:
> - switch to platform_get_irq_optional(), though it won't stop children
>    to be probed and failed
> - fail the ->probe() of i2c-multi-instantiate
> 
> Since the in reality we never had devices in the wild where IRQ resource
> is optional, the latter solution suits the best.
> 
> Fixes: 799d3379a672 ("platform/x86: i2c-multi-instantiate: Introduce IOAPIC IRQ support")
> Reported-by: Ammy Yi <ammy.yi@intel.com>
> Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> Cc: Hans de Goede <hdegoede@redhat.com>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

I thought I already replied to this, but the archive disagrees. Patch
looks good to me:

Reviewed-by; Hans de Goede <hdegoede@redhat.com>

Regards,

Hans


> ---
> - Cc Ammy
>   drivers/platform/x86/i2c-multi-instantiate.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/platform/x86/i2c-multi-instantiate.c b/drivers/platform/x86/i2c-multi-instantiate.c
> index ea68f6ed66ae..ffb8d5d1eb5f 100644
> --- a/drivers/platform/x86/i2c-multi-instantiate.c
> +++ b/drivers/platform/x86/i2c-multi-instantiate.c
> @@ -108,6 +108,7 @@ static int i2c_multi_inst_probe(struct platform_device *pdev)
>   			if (ret < 0) {
>   				dev_dbg(dev, "Error requesting irq at index %d: %d\n",
>   					inst_data[i].irq_idx, ret);
> +				goto error;
>   			}
>   			board_info.irq = ret;
>   			break;
>
Andy Shevchenko Oct. 20, 2019, 8:02 a.m. UTC | #2
On Wed, Oct 16, 2019 at 4:01 PM Hans de Goede <hdegoede@redhat.com> wrote:
> On 10/14/19 1:57 PM, Andy Shevchenko wrote:
> > For APIC case of interrupt we don't fail a ->probe() of the driver,
> > which makes kernel to print a lot of warnings from the children.

> I thought I already replied to this, but the archive disagrees. Patch
> looks good to me:
>
> Reviewed-by; Hans de Goede <hdegoede@redhat.com>

Thank you!
Sorry, it went without your Rb tag.
diff mbox series

Patch

diff --git a/drivers/platform/x86/i2c-multi-instantiate.c b/drivers/platform/x86/i2c-multi-instantiate.c
index ea68f6ed66ae..ffb8d5d1eb5f 100644
--- a/drivers/platform/x86/i2c-multi-instantiate.c
+++ b/drivers/platform/x86/i2c-multi-instantiate.c
@@ -108,6 +108,7 @@  static int i2c_multi_inst_probe(struct platform_device *pdev)
 			if (ret < 0) {
 				dev_dbg(dev, "Error requesting irq at index %d: %d\n",
 					inst_data[i].irq_idx, ret);
+				goto error;
 			}
 			board_info.irq = ret;
 			break;