* [PATCH] i2c: also convert placeholder function to return errno
@ 2020-07-25 14:07 Wolfram Sang
2020-07-25 15:39 ` Andy Shevchenko
2020-07-27 18:18 ` Wolfram Sang
0 siblings, 2 replies; 3+ messages in thread
From: Wolfram Sang @ 2020-07-25 14:07 UTC (permalink / raw)
To: linux-i2c; +Cc: Andy Shevchenko, Wolfram Sang
All i2c_new_device-alike functions return ERR_PTR these days, but this
fallback function was missed.
Fixes: 2dea645ffc21 ("i2c: acpi: Return error pointers from i2c_acpi_new_device()")
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
I recall that -ENOSYS is returned in case something is not compiled in.
I am open for -ENODEV if this is deemed better...
include/linux/i2c.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index b8b8963f8bb9..83fe48304781 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -1001,7 +1001,7 @@ static inline u32 i2c_acpi_find_bus_speed(struct device *dev)
static inline struct i2c_client *i2c_acpi_new_device(struct device *dev,
int index, struct i2c_board_info *info)
{
- return NULL;
+ return ERR_PTR(-ENOSYS);
}
static inline struct i2c_adapter *i2c_acpi_find_adapter_by_handle(acpi_handle handle)
{
--
2.27.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] i2c: also convert placeholder function to return errno
2020-07-25 14:07 [PATCH] i2c: also convert placeholder function to return errno Wolfram Sang
@ 2020-07-25 15:39 ` Andy Shevchenko
2020-07-27 18:18 ` Wolfram Sang
1 sibling, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2020-07-25 15:39 UTC (permalink / raw)
To: Wolfram Sang; +Cc: linux-i2c
On Sat, Jul 25, 2020 at 04:07:36PM +0200, Wolfram Sang wrote:
> All i2c_new_device-alike functions return ERR_PTR these days, but this
> fallback function was missed.
I think either will work.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Thanks!
> Fixes: 2dea645ffc21 ("i2c: acpi: Return error pointers from i2c_acpi_new_device()")
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> ---
>
> I recall that -ENOSYS is returned in case something is not compiled in.
> I am open for -ENODEV if this is deemed better...
>
> include/linux/i2c.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/linux/i2c.h b/include/linux/i2c.h
> index b8b8963f8bb9..83fe48304781 100644
> --- a/include/linux/i2c.h
> +++ b/include/linux/i2c.h
> @@ -1001,7 +1001,7 @@ static inline u32 i2c_acpi_find_bus_speed(struct device *dev)
> static inline struct i2c_client *i2c_acpi_new_device(struct device *dev,
> int index, struct i2c_board_info *info)
> {
> - return NULL;
> + return ERR_PTR(-ENOSYS);
> }
> static inline struct i2c_adapter *i2c_acpi_find_adapter_by_handle(acpi_handle handle)
> {
> --
> 2.27.0
>
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] i2c: also convert placeholder function to return errno
2020-07-25 14:07 [PATCH] i2c: also convert placeholder function to return errno Wolfram Sang
2020-07-25 15:39 ` Andy Shevchenko
@ 2020-07-27 18:18 ` Wolfram Sang
1 sibling, 0 replies; 3+ messages in thread
From: Wolfram Sang @ 2020-07-27 18:18 UTC (permalink / raw)
To: linux-i2c; +Cc: Andy Shevchenko
[-- Attachment #1: Type: text/plain, Size: 419 bytes --]
On Sat, Jul 25, 2020 at 04:07:36PM +0200, Wolfram Sang wrote:
> All i2c_new_device-alike functions return ERR_PTR these days, but this
> fallback function was missed.
>
> Fixes: 2dea645ffc21 ("i2c: acpi: Return error pointers from i2c_acpi_new_device()")
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Changed to ENODEV (because of checkpatch warning) and applied to
for-current, thanks!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-07-27 18:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-25 14:07 [PATCH] i2c: also convert placeholder function to return errno Wolfram Sang
2020-07-25 15:39 ` Andy Shevchenko
2020-07-27 18:18 ` Wolfram Sang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).