Re: [PATCH v2 05/13] i2c: acpi: Return error pointers from i2c_acpi_new_device()

2018-11-27 Thread Andy Shevchenko
On Tue, Nov 27, 2018 at 04:24:41PM +0100, Hans de Goede wrote: > On 27-11-18 14:46, Andy Shevchenko wrote: > > On Tue, Nov 27, 2018 at 01:49:53PM +0200, Mika Westerberg wrote: > > > On Tue, Nov 27, 2018 at 10:16:25AM +0100, Hans de Goede wrote: > > > > One problem is that i2c_new_device()

Re: [PATCH v2 05/13] i2c: acpi: Return error pointers from i2c_acpi_new_device()

2018-11-27 Thread Andy Shevchenko
On Tue, Nov 27, 2018 at 04:24:41PM +0100, Hans de Goede wrote: > On 27-11-18 14:46, Andy Shevchenko wrote: > > On Tue, Nov 27, 2018 at 01:49:53PM +0200, Mika Westerberg wrote: > > > On Tue, Nov 27, 2018 at 10:16:25AM +0100, Hans de Goede wrote: > > > > One problem is that i2c_new_device()

Re: [PATCH v2 05/13] i2c: acpi: Return error pointers from i2c_acpi_new_device()

2018-11-27 Thread Hans de Goede
Hi, On 27-11-18 14:46, Andy Shevchenko wrote: On Tue, Nov 27, 2018 at 01:49:53PM +0200, Mika Westerberg wrote: On Tue, Nov 27, 2018 at 10:16:25AM +0100, Hans de Goede wrote: One problem is that i2c_new_device() currently simply returns NULL on all errors. Andy, you could take a look how much

Re: [PATCH v2 05/13] i2c: acpi: Return error pointers from i2c_acpi_new_device()

2018-11-27 Thread Hans de Goede
Hi, On 27-11-18 14:46, Andy Shevchenko wrote: On Tue, Nov 27, 2018 at 01:49:53PM +0200, Mika Westerberg wrote: On Tue, Nov 27, 2018 at 10:16:25AM +0100, Hans de Goede wrote: One problem is that i2c_new_device() currently simply returns NULL on all errors. Andy, you could take a look how much

Re: [PATCH v2 05/13] i2c: acpi: Return error pointers from i2c_acpi_new_device()

2018-11-27 Thread Andy Shevchenko
On Tue, Nov 27, 2018 at 01:49:53PM +0200, Mika Westerberg wrote: > On Tue, Nov 27, 2018 at 10:16:25AM +0100, Hans de Goede wrote: > > One problem is that i2c_new_device() currently simply returns NULL on all > > errors. Andy, you could take a look how much work it is to make that return > > an

Re: [PATCH v2 05/13] i2c: acpi: Return error pointers from i2c_acpi_new_device()

2018-11-27 Thread Andy Shevchenko
On Tue, Nov 27, 2018 at 01:49:53PM +0200, Mika Westerberg wrote: > On Tue, Nov 27, 2018 at 10:16:25AM +0100, Hans de Goede wrote: > > One problem is that i2c_new_device() currently simply returns NULL on all > > errors. Andy, you could take a look how much work it is to make that return > > an

Re: [PATCH v2 05/13] i2c: acpi: Return error pointers from i2c_acpi_new_device()

2018-11-27 Thread Mika Westerberg
On Tue, Nov 27, 2018 at 10:16:25AM +0100, Hans de Goede wrote: > One problem is that i2c_new_device() currently simply returns NULL on all > errors. Andy, you could take a look how much work it is to make that return > an ERR_PTR too, or just check its return value and return ERR_PTR(-ENXIO) if >

Re: [PATCH v2 05/13] i2c: acpi: Return error pointers from i2c_acpi_new_device()

2018-11-27 Thread Mika Westerberg
On Tue, Nov 27, 2018 at 10:16:25AM +0100, Hans de Goede wrote: > One problem is that i2c_new_device() currently simply returns NULL on all > errors. Andy, you could take a look how much work it is to make that return > an ERR_PTR too, or just check its return value and return ERR_PTR(-ENXIO) if >

Re: [PATCH v2 05/13] i2c: acpi: Return error pointers from i2c_acpi_new_device()

2018-11-27 Thread Hans de Goede
Hi, On 27-11-18 10:04, Mika Westerberg wrote: On Mon, Nov 26, 2018 at 05:08:50PM +0200, Andy Shevchenko wrote: The caller would like to know the reason why the i2c_acpi_new_device() fails. For example, if adapter is not available, it might be in the future and we would like to re-probe the

Re: [PATCH v2 05/13] i2c: acpi: Return error pointers from i2c_acpi_new_device()

2018-11-27 Thread Hans de Goede
Hi, On 27-11-18 10:04, Mika Westerberg wrote: On Mon, Nov 26, 2018 at 05:08:50PM +0200, Andy Shevchenko wrote: The caller would like to know the reason why the i2c_acpi_new_device() fails. For example, if adapter is not available, it might be in the future and we would like to re-probe the

Re: [PATCH v2 05/13] i2c: acpi: Return error pointers from i2c_acpi_new_device()

2018-11-27 Thread Mika Westerberg
On Mon, Nov 26, 2018 at 05:08:50PM +0200, Andy Shevchenko wrote: > The caller would like to know the reason why the i2c_acpi_new_device() fails. > For example, if adapter is not available, it might be in the future and we > would like to re-probe the clients again. But at the same time we would

Re: [PATCH v2 05/13] i2c: acpi: Return error pointers from i2c_acpi_new_device()

2018-11-27 Thread Mika Westerberg
On Mon, Nov 26, 2018 at 05:08:50PM +0200, Andy Shevchenko wrote: > The caller would like to know the reason why the i2c_acpi_new_device() fails. > For example, if adapter is not available, it might be in the future and we > would like to re-probe the clients again. But at the same time we would

[PATCH v2 05/13] i2c: acpi: Return error pointers from i2c_acpi_new_device()

2018-11-26 Thread Andy Shevchenko
The caller would like to know the reason why the i2c_acpi_new_device() fails. For example, if adapter is not available, it might be in the future and we would like to re-probe the clients again. But at the same time we would like to bail out if the error seems unrecoverable, such as out of memory

[PATCH v2 05/13] i2c: acpi: Return error pointers from i2c_acpi_new_device()

2018-11-26 Thread Andy Shevchenko
The caller would like to know the reason why the i2c_acpi_new_device() fails. For example, if adapter is not available, it might be in the future and we would like to re-probe the clients again. But at the same time we would like to bail out if the error seems unrecoverable, such as out of memory