From: Dzianis Kahanovich <mahatma@bspu.unibel.by>
To: linux-fbdev@vger.kernel.org
Subject: [PATCH] via-camera: check viafb_find_i2c_adapter() result to NULL
Date: Tue, 04 Jan 2011 11:42:06 +0000 [thread overview]
Message-ID: <4D23078E.8070801@bspu.unibel.by> (raw)
If viafb_find_i2c_adapter() patch still useful - via-camera.c must be fixed too.
Signed-off-by: Dzianis Kahanovich <mahatma@eu.by>
---
--- b/drivers/media/video/via-camera.c 2011-01-04 13:08:18.000000000 +0200
+++ c/drivers/media/video/via-camera.c 2011-01-04 13:35:45.000000000 +0200
@@ -1344,8 +1344,9 @@ static __devinit int viacam_probe(struct
* is OLPC-specific. 0x42 assumption is ov7670-specific.
*/
sensor_adapter = viafb_find_i2c_adapter(VIA_PORT_31);
- cam->sensor = v4l2_i2c_new_subdev(&cam->v4l2_dev, sensor_adapter,
- "ov7670", 0x42 >> 1, NULL);
+ if (sensor_adapter != NULL)
+ cam->sensor = v4l2_i2c_new_subdev(&cam->v4l2_dev,
+ sensor_adapter, "ov7670", 0x42 >> 1, NULL);
if (cam->sensor = NULL) {
dev_err(&pdev->dev, "Unable to find the sensor!\n");
ret = -ENODEV;
--
reply other threads:[~2011-01-04 11:42 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D23078E.8070801@bspu.unibel.by \
--to=mahatma@bspu.unibel.by \
--cc=linux-fbdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox