diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2008-07-20 05:35:02 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-07-23 15:42:52 -0400 |
commit | 22a04f106346c3af019135f2de3cabf9ac41c3ba (patch) | |
tree | 520b5260c3883f153cb55192f7df92899fbd062e /drivers/media/video/sn9c102 | |
parent | 5e85e732f0ed56aa97a3ba26ac2b93ffe597a208 (diff) |
V4L/DVB (8429): videodev: renamed 'class_dev' to 'dev'
The class_dev field is a normal device, not a class device. This is very
confusing and now that the old 'dev' field has been renamed to 'parent'
we can rename 'class_dev' to just 'dev'.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/sn9c102')
-rw-r--r-- | drivers/media/video/sn9c102/sn9c102_core.c | 60 |
1 files changed, 25 insertions, 35 deletions
diff --git a/drivers/media/video/sn9c102/sn9c102_core.c b/drivers/media/video/sn9c102/sn9c102_core.c index 7f9c7bcf3c85..475b78191151 100644 --- a/drivers/media/video/sn9c102/sn9c102_core.c +++ b/drivers/media/video/sn9c102/sn9c102_core.c | |||
@@ -1038,8 +1038,7 @@ static ssize_t sn9c102_show_reg(struct device* cd, | |||
1038 | if (mutex_lock_interruptible(&sn9c102_sysfs_lock)) | 1038 | if (mutex_lock_interruptible(&sn9c102_sysfs_lock)) |
1039 | return -ERESTARTSYS; | 1039 | return -ERESTARTSYS; |
1040 | 1040 | ||
1041 | cam = video_get_drvdata(container_of(cd, struct video_device, | 1041 | cam = video_get_drvdata(container_of(cd, struct video_device, dev)); |
1042 | class_dev)); | ||
1043 | if (!cam) { | 1042 | if (!cam) { |
1044 | mutex_unlock(&sn9c102_sysfs_lock); | 1043 | mutex_unlock(&sn9c102_sysfs_lock); |
1045 | return -ENODEV; | 1044 | return -ENODEV; |
@@ -1064,8 +1063,7 @@ sn9c102_store_reg(struct device* cd, struct device_attribute *attr, | |||
1064 | if (mutex_lock_interruptible(&sn9c102_sysfs_lock)) | 1063 | if (mutex_lock_interruptible(&sn9c102_sysfs_lock)) |
1065 | return -ERESTARTSYS; | 1064 | return -ERESTARTSYS; |
1066 | 1065 | ||
1067 | cam = video_get_drvdata(container_of(cd, struct video_device, | 1066 | cam = video_get_drvdata(container_of(cd, struct video_device, dev)); |
1068 | class_dev)); | ||
1069 | if (!cam) { | 1067 | if (!cam) { |
1070 | mutex_unlock(&sn9c102_sysfs_lock); | 1068 | mutex_unlock(&sn9c102_sysfs_lock); |
1071 | return -ENODEV; | 1069 | return -ENODEV; |
@@ -1098,8 +1096,7 @@ static ssize_t sn9c102_show_val(struct device* cd, | |||
1098 | if (mutex_lock_interruptible(&sn9c102_sysfs_lock)) | 1096 | if (mutex_lock_interruptible(&sn9c102_sysfs_lock)) |
1099 | return -ERESTARTSYS; | 1097 | return -ERESTARTSYS; |
1100 | 1098 | ||
1101 | cam = video_get_drvdata(container_of(cd, struct video_device, | 1099 | cam = video_get_drvdata(container_of(cd, struct video_device, dev)); |
1102 | class_dev)); | ||
1103 | if (!cam) { | 1100 | if (!cam) { |
1104 | mutex_unlock(&sn9c102_sysfs_lock); | 1101 | mutex_unlock(&sn9c102_sysfs_lock); |
1105 | return -ENODEV; | 1102 | return -ENODEV; |
@@ -1132,8 +1129,7 @@ sn9c102_store_val(struct device* cd, struct device_attribute *attr, | |||
1132 | if (mutex_lock_interruptible(&sn9c102_sysfs_lock)) | 1129 | if (mutex_lock_interruptible(&sn9c102_sysfs_lock)) |
1133 | return -ERESTARTSYS; | 1130 | return -ERESTARTSYS; |
1134 | 1131 | ||
1135 | cam = video_get_drvdata(container_of(cd, struct video_device, | 1132 | cam = video_get_drvdata(container_of(cd, struct video_device, dev)); |
1136 | class_dev)); | ||
1137 | if (!cam) { | 1133 | if (!cam) { |
1138 | mutex_unlock(&sn9c102_sysfs_lock); | 1134 | mutex_unlock(&sn9c102_sysfs_lock); |
1139 | return -ENODEV; | 1135 | return -ENODEV; |
@@ -1170,8 +1166,7 @@ static ssize_t sn9c102_show_i2c_reg(struct device* cd, | |||
1170 | if (mutex_lock_interruptible(&sn9c102_sysfs_lock)) | 1166 | if (mutex_lock_interruptible(&sn9c102_sysfs_lock)) |
1171 | return -ERESTARTSYS; | 1167 | return -ERESTARTSYS; |
1172 | 1168 | ||
1173 | cam = video_get_drvdata(container_of(cd, struct video_device, | 1169 | cam = video_get_drvdata(container_of(cd, struct video_device, dev)); |
1174 | class_dev)); | ||
1175 | if (!cam) { | 1170 | if (!cam) { |
1176 | mutex_unlock(&sn9c102_sysfs_lock); | 1171 | mutex_unlock(&sn9c102_sysfs_lock); |
1177 | return -ENODEV; | 1172 | return -ENODEV; |
@@ -1198,8 +1193,7 @@ sn9c102_store_i2c_reg(struct device* cd, struct device_attribute *attr, | |||
1198 | if (mutex_lock_interruptible(&sn9c102_sysfs_lock)) | 1193 | if (mutex_lock_interruptible(&sn9c102_sysfs_lock)) |
1199 | return -ERESTARTSYS; | 1194 | return -ERESTARTSYS; |
1200 | 1195 | ||
1201 | cam = video_get_drvdata(container_of(cd, struct video_device, | 1196 | cam = video_get_drvdata(container_of(cd, struct video_device, dev)); |
1202 | class_dev)); | ||
1203 | if (!cam) { | 1197 | if (!cam) { |
1204 | mutex_unlock(&sn9c102_sysfs_lock); | 1198 | mutex_unlock(&sn9c102_sysfs_lock); |
1205 | return -ENODEV; | 1199 | return -ENODEV; |
@@ -1232,8 +1226,7 @@ static ssize_t sn9c102_show_i2c_val(struct device* cd, | |||
1232 | if (mutex_lock_interruptible(&sn9c102_sysfs_lock)) | 1226 | if (mutex_lock_interruptible(&sn9c102_sysfs_lock)) |
1233 | return -ERESTARTSYS; | 1227 | return -ERESTARTSYS; |
1234 | 1228 | ||
1235 | cam = video_get_drvdata(container_of(cd, struct video_device, | 1229 | cam = video_get_drvdata(container_of(cd, struct video_device, dev)); |
1236 | class_dev)); | ||
1237 | if (!cam) { | 1230 | if (!cam) { |
1238 | mutex_unlock(&sn9c102_sysfs_lock); | 1231 | mutex_unlock(&sn9c102_sysfs_lock); |
1239 | return -ENODEV; | 1232 | return -ENODEV; |
@@ -1271,8 +1264,7 @@ sn9c102_store_i2c_val(struct device* cd, struct device_attribute *attr, | |||
1271 | if (mutex_lock_interruptible(&sn9c102_sysfs_lock)) | 1264 | if (mutex_lock_interruptible(&sn9c102_sysfs_lock)) |
1272 | return -ERESTARTSYS; | 1265 | return -ERESTARTSYS; |
1273 | 1266 | ||
1274 | cam = video_get_drvdata(container_of(cd, struct video_device, | 1267 | cam = video_get_drvdata(container_of(cd, struct video_device, dev)); |
1275 | class_dev)); | ||
1276 | if (!cam) { | 1268 | if (!cam) { |
1277 | mutex_unlock(&sn9c102_sysfs_lock); | 1269 | mutex_unlock(&sn9c102_sysfs_lock); |
1278 | return -ENODEV; | 1270 | return -ENODEV; |
@@ -1318,8 +1310,7 @@ sn9c102_store_green(struct device* cd, struct device_attribute *attr, | |||
1318 | if (mutex_lock_interruptible(&sn9c102_sysfs_lock)) | 1310 | if (mutex_lock_interruptible(&sn9c102_sysfs_lock)) |
1319 | return -ERESTARTSYS; | 1311 | return -ERESTARTSYS; |
1320 | 1312 | ||
1321 | cam = video_get_drvdata(container_of(cd, struct video_device, | 1313 | cam = video_get_drvdata(container_of(cd, struct video_device, dev)); |
1322 | class_dev)); | ||
1323 | if (!cam) { | 1314 | if (!cam) { |
1324 | mutex_unlock(&sn9c102_sysfs_lock); | 1315 | mutex_unlock(&sn9c102_sysfs_lock); |
1325 | return -ENODEV; | 1316 | return -ENODEV; |
@@ -1400,8 +1391,7 @@ static ssize_t sn9c102_show_frame_header(struct device* cd, | |||
1400 | struct sn9c102_device* cam; | 1391 | struct sn9c102_device* cam; |
1401 | ssize_t count; | 1392 | ssize_t count; |
1402 | 1393 | ||
1403 | cam = video_get_drvdata(container_of(cd, struct video_device, | 1394 | cam = video_get_drvdata(container_of(cd, struct video_device, dev)); |
1404 | class_dev)); | ||
1405 | if (!cam) | 1395 | if (!cam) |
1406 | return -ENODEV; | 1396 | return -ENODEV; |
1407 | 1397 | ||
@@ -1428,49 +1418,49 @@ static DEVICE_ATTR(frame_header, S_IRUGO, sn9c102_show_frame_header, NULL); | |||
1428 | 1418 | ||
1429 | static int sn9c102_create_sysfs(struct sn9c102_device* cam) | 1419 | static int sn9c102_create_sysfs(struct sn9c102_device* cam) |
1430 | { | 1420 | { |
1431 | struct device *classdev = &(cam->v4ldev->class_dev); | 1421 | struct device *dev = &(cam->v4ldev->dev); |
1432 | int err = 0; | 1422 | int err = 0; |
1433 | 1423 | ||
1434 | if ((err = device_create_file(classdev, &dev_attr_reg))) | 1424 | if ((err = device_create_file(dev, &dev_attr_reg))) |
1435 | goto err_out; | 1425 | goto err_out; |
1436 | if ((err = device_create_file(classdev, &dev_attr_val))) | 1426 | if ((err = device_create_file(dev, &dev_attr_val))) |
1437 | goto err_reg; | 1427 | goto err_reg; |
1438 | if ((err = device_create_file(classdev, &dev_attr_frame_header))) | 1428 | if ((err = device_create_file(dev, &dev_attr_frame_header))) |
1439 | goto err_val; | 1429 | goto err_val; |
1440 | 1430 | ||
1441 | if (cam->sensor.sysfs_ops) { | 1431 | if (cam->sensor.sysfs_ops) { |
1442 | if ((err = device_create_file(classdev, &dev_attr_i2c_reg))) | 1432 | if ((err = device_create_file(dev, &dev_attr_i2c_reg))) |
1443 | goto err_frame_header; | 1433 | goto err_frame_header; |
1444 | if ((err = device_create_file(classdev, &dev_attr_i2c_val))) | 1434 | if ((err = device_create_file(dev, &dev_attr_i2c_val))) |
1445 | goto err_i2c_reg; | 1435 | goto err_i2c_reg; |
1446 | } | 1436 | } |
1447 | 1437 | ||
1448 | if (cam->bridge == BRIDGE_SN9C101 || cam->bridge == BRIDGE_SN9C102) { | 1438 | if (cam->bridge == BRIDGE_SN9C101 || cam->bridge == BRIDGE_SN9C102) { |
1449 | if ((err = device_create_file(classdev, &dev_attr_green))) | 1439 | if ((err = device_create_file(dev, &dev_attr_green))) |
1450 | goto err_i2c_val; | 1440 | goto err_i2c_val; |
1451 | } else { | 1441 | } else { |
1452 | if ((err = device_create_file(classdev, &dev_attr_blue))) | 1442 | if ((err = device_create_file(dev, &dev_attr_blue))) |
1453 | goto err_i2c_val; | 1443 | goto err_i2c_val; |
1454 | if ((err = device_create_file(classdev, &dev_attr_red))) | 1444 | if ((err = device_create_file(dev, &dev_attr_red))) |
1455 | goto err_blue; | 1445 | goto err_blue; |
1456 | } | 1446 | } |
1457 | 1447 | ||
1458 | return 0; | 1448 | return 0; |
1459 | 1449 | ||
1460 | err_blue: | 1450 | err_blue: |
1461 | device_remove_file(classdev, &dev_attr_blue); | 1451 | device_remove_file(dev, &dev_attr_blue); |
1462 | err_i2c_val: | 1452 | err_i2c_val: |
1463 | if (cam->sensor.sysfs_ops) | 1453 | if (cam->sensor.sysfs_ops) |
1464 | device_remove_file(classdev, &dev_attr_i2c_val); | 1454 | device_remove_file(dev, &dev_attr_i2c_val); |
1465 | err_i2c_reg: | 1455 | err_i2c_reg: |
1466 | if (cam->sensor.sysfs_ops) | 1456 | if (cam->sensor.sysfs_ops) |
1467 | device_remove_file(classdev, &dev_attr_i2c_reg); | 1457 | device_remove_file(dev, &dev_attr_i2c_reg); |
1468 | err_frame_header: | 1458 | err_frame_header: |
1469 | device_remove_file(classdev, &dev_attr_frame_header); | 1459 | device_remove_file(dev, &dev_attr_frame_header); |
1470 | err_val: | 1460 | err_val: |
1471 | device_remove_file(classdev, &dev_attr_val); | 1461 | device_remove_file(dev, &dev_attr_val); |
1472 | err_reg: | 1462 | err_reg: |
1473 | device_remove_file(classdev, &dev_attr_reg); | 1463 | device_remove_file(dev, &dev_attr_reg); |
1474 | err_out: | 1464 | err_out: |
1475 | return err; | 1465 | return err; |
1476 | } | 1466 | } |