summaryrefslogtreecommitdiff
path: root/drivers/media/platform/omap3isp/isp.c
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@iki.fi>2015-03-25 19:57:29 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-04-02 16:39:14 -0300
commit4c8f14861cccb7b19cfd582e135847aa772f3854 (patch)
treed67a1d2af4831b9b1b6094852a2b853437ae347a /drivers/media/platform/omap3isp/isp.c
parent64904b574e33f897cc425fcbe64cebab92b3c6fb (diff)
[media] omap3isp: Platform data could be NULL
Only check for call platform data callback functions if there's platform data. Also take care of a few other cases where the NULL pdata pointer could have been accessed, and remove the check for NULL dev->platform_data pointer. Removing the check for NULL dev->platform_data isn't strictly needed by the DT support but there's no harm from that either: the device now can be used without sensors, for instance. Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/platform/omap3isp/isp.c')
-rw-r--r--drivers/media/platform/omap3isp/isp.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers/media/platform/omap3isp/isp.c
index 82499cd7c3d7..537377b43083 100644
--- a/drivers/media/platform/omap3isp/isp.c
+++ b/drivers/media/platform/omap3isp/isp.c
@@ -330,8 +330,8 @@ static int isp_xclk_init(struct isp_device *isp)
if (np)
continue;
- if (pdata->xclks[i].con_id == NULL &&
- pdata->xclks[i].dev_id == NULL)
+ if (!pdata || (pdata->xclks[i].con_id == NULL &&
+ pdata->xclks[i].dev_id == NULL))
continue;
xclk->lookup = kzalloc(sizeof(*xclk->lookup), GFP_KERNEL);
@@ -1989,7 +1989,8 @@ static int isp_register_entities(struct isp_device *isp)
goto done;
/* Register external entities */
- for (subdevs = pdata->subdevs; subdevs && subdevs->subdevs; ++subdevs) {
+ for (subdevs = pdata ? pdata->subdevs : NULL;
+ subdevs && subdevs->subdevs; ++subdevs) {
struct v4l2_subdev *sensor;
sensor = isp_register_subdev_group(isp, subdevs->subdevs);
@@ -2271,9 +2272,6 @@ static int isp_probe(struct platform_device *pdev)
int ret;
int i, m;
- if (pdata == NULL)
- return -EINVAL;
-
isp = devm_kzalloc(&pdev->dev, sizeof(*isp), GFP_KERNEL);
if (!isp) {
dev_err(&pdev->dev, "could not allocate memory\n");