aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
authorKuninori Morimoto <morimoto.kuninori@renesas.com>2009-12-11 09:34:50 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-12-16 06:27:22 -0500
commit88a67c51dfc649c18fc8828970cb4fd09d1871b5 (patch)
tree2065ca68091b9d6919ecc00758872dcbe4c87a02 /drivers/media/video
parent6d74e5f361bdacfdcfe14220868d562368aaadc2 (diff)
V4L/DVB (13653): tw9910: simplify chip ID calculation
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/tw9910.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/media/video/tw9910.c b/drivers/media/video/tw9910.c
index e3a4942e0f37..3d8a45f0eb2a 100644
--- a/drivers/media/video/tw9910.c
+++ b/drivers/media/video/tw9910.c
@@ -863,7 +863,7 @@ static int tw9910_video_probe(struct soc_camera_device *icd,
863 struct i2c_client *client) 863 struct i2c_client *client)
864{ 864{
865 struct tw9910_priv *priv = to_tw9910(client); 865 struct tw9910_priv *priv = to_tw9910(client);
866 s32 val; 866 s32 id;
867 867
868 /* 868 /*
869 * We must have a parent by now. And it cannot be a wrong one. 869 * We must have a parent by now. And it cannot be a wrong one.
@@ -889,19 +889,20 @@ static int tw9910_video_probe(struct soc_camera_device *icd,
889 * check and show Product ID 889 * check and show Product ID
890 * So far only revisions 0 and 1 have been seen 890 * So far only revisions 0 and 1 have been seen
891 */ 891 */
892 val = i2c_smbus_read_byte_data(client, ID); 892 id = i2c_smbus_read_byte_data(client, ID);
893 priv->revision = GET_REV(val); 893 priv->revision = GET_REV(id);
894 id = GET_ID(id);
894 895
895 if (0x0B != GET_ID(val) || 896 if (0x0B != id ||
896 0x01 < priv->revision) { 897 0x01 < priv->revision) {
897 dev_err(&client->dev, 898 dev_err(&client->dev,
898 "Product ID error %x:%x\n", 899 "Product ID error %x:%x\n",
899 GET_ID(val), priv->revision); 900 id, priv->revision);
900 return -ENODEV; 901 return -ENODEV;
901 } 902 }
902 903
903 dev_info(&client->dev, 904 dev_info(&client->dev,
904 "tw9910 Product ID %0x:%0x\n", GET_ID(val), priv->revision); 905 "tw9910 Product ID %0x:%0x\n", id, priv->revision);
905 906
906 icd->vdev->tvnorms = V4L2_STD_NTSC | V4L2_STD_PAL; 907 icd->vdev->tvnorms = V4L2_STD_NTSC | V4L2_STD_PAL;
907 icd->vdev->current_norm = V4L2_STD_NTSC; 908 icd->vdev->current_norm = V4L2_STD_NTSC;