OSDN Git Service

media: v4l2-core: Remove BUG() from i2c and spi helpers
authorEzequiel Garcia <ezequiel@collabora.com>
Thu, 15 Aug 2019 16:48:06 +0000 (13:48 -0300)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Mon, 26 Aug 2019 13:52:36 +0000 (10:52 -0300)
commit1a065ee3e97cc58ab900ccb7eb2b421fdab1d0dc
tree7dbf7d29c493494e21c4b977269453ba4cb6c9c1
parent51ff392c280733aa9e6bd47b3f5e83e32bfdf16a
media: v4l2-core: Remove BUG() from i2c and spi helpers

Currently, the i2c and spi subdev creation helpers
are calling BUG() when passed a NULL v4l2_device parameter.

This makes little sense; simply returning NULL seems more
sensible.

These two helpers may already return NULL on error, so callers
should already be checking for this, or at least be prepared
for a NULL result.

Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/v4l2-core/v4l2-i2c.c
drivers/media/v4l2-core/v4l2-spi.c