From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mika Westerberg Subject: Re: [PATCH v2 05/13] i2c: acpi: Return error pointers from i2c_acpi_new_device() Date: Tue, 27 Nov 2018 13:49:53 +0200 Message-ID: <20181127114953.GQ2296@lahna.fi.intel.com> References: <20181126150858.16901-1-andriy.shevchenko@linux.intel.com> <20181126150858.16901-6-andriy.shevchenko@linux.intel.com> <20181127090432.GK2296@lahna.fi.intel.com> <98674437-9374-32d4-4b25-dedd0cad5bea@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <98674437-9374-32d4-4b25-dedd0cad5bea@redhat.com> Sender: linux-kernel-owner@vger.kernel.org To: Hans de Goede Cc: Andy Shevchenko , Darren Hart , platform-driver-x86@vger.kernel.org, "Rafael J. Wysocki" , linux-acpi@vger.kernel.org, Jonathan Cameron , Wolfram Sang , linux-i2c@vger.kernel.org, Heikki Krogerus , linux-kernel@vger.kernel.org List-Id: linux-acpi@vger.kernel.org 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 > it fails for now... I would use -ENODEV here and -EINVAL in case there is no ACPI companion :)