aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/video.c
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2008-04-30 20:10:02 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-30 19:26:27 -0400
commite0066c4ea9ffa420cb79814411ff74fdc7b7d98e (patch)
treef01544d73a8f8e9c425b6b2ef6e851ae54658680 /drivers/acpi/video.c
parent08acd4f8af42affd8cbed81cc1b69fa12ddb213f (diff)
Fix ACPI vs proc_create_data() mismerge
acpi_device_dir() is NULL until all files are createst, so everyting is created in straight in /proc/ and creation code warns. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/acpi/video.c')
-rw-r--r--drivers/acpi/video.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index f7eb12e55602..5e5dda3a3027 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -1070,7 +1070,7 @@ static int acpi_video_device_add_fs(struct acpi_device *device)
1070 device_dir->owner = THIS_MODULE; 1070 device_dir->owner = THIS_MODULE;
1071 1071
1072 /* 'info' [R] */ 1072 /* 'info' [R] */
1073 entry = proc_create_data("info", S_IRUGO, acpi_device_dir(device), 1073 entry = proc_create_data("info", S_IRUGO, device_dir,
1074 &acpi_video_device_info_fops, acpi_driver_data(device)); 1074 &acpi_video_device_info_fops, acpi_driver_data(device));
1075 if (!entry) 1075 if (!entry)
1076 goto err_remove_dir; 1076 goto err_remove_dir;
@@ -1078,7 +1078,7 @@ static int acpi_video_device_add_fs(struct acpi_device *device)
1078 /* 'state' [R/W] */ 1078 /* 'state' [R/W] */
1079 acpi_video_device_state_fops.write = acpi_video_device_write_state; 1079 acpi_video_device_state_fops.write = acpi_video_device_write_state;
1080 entry = proc_create_data("state", S_IFREG | S_IRUGO | S_IWUSR, 1080 entry = proc_create_data("state", S_IFREG | S_IRUGO | S_IWUSR,
1081 acpi_device_dir(device), 1081 device_dir,
1082 &acpi_video_device_state_fops, 1082 &acpi_video_device_state_fops,
1083 acpi_driver_data(device)); 1083 acpi_driver_data(device));
1084 if (!entry) 1084 if (!entry)
@@ -1088,19 +1088,21 @@ static int acpi_video_device_add_fs(struct acpi_device *device)
1088 acpi_video_device_brightness_fops.write = 1088 acpi_video_device_brightness_fops.write =
1089 acpi_video_device_write_brightness; 1089 acpi_video_device_write_brightness;
1090 entry = proc_create_data("brightness", S_IFREG | S_IRUGO | S_IWUSR, 1090 entry = proc_create_data("brightness", S_IFREG | S_IRUGO | S_IWUSR,
1091 acpi_device_dir(device), 1091 device_dir,
1092 &acpi_video_device_brightness_fops, 1092 &acpi_video_device_brightness_fops,
1093 acpi_driver_data(device)); 1093 acpi_driver_data(device));
1094 if (!entry) 1094 if (!entry)
1095 goto err_remove_state; 1095 goto err_remove_state;
1096 1096
1097 /* 'EDID' [R] */ 1097 /* 'EDID' [R] */
1098 entry = proc_create_data("EDID", S_IRUGO, acpi_device_dir(device), 1098 entry = proc_create_data("EDID", S_IRUGO, device_dir,
1099 &acpi_video_device_EDID_fops, 1099 &acpi_video_device_EDID_fops,
1100 acpi_driver_data(device)); 1100 acpi_driver_data(device));
1101 if (!entry) 1101 if (!entry)
1102 goto err_remove_brightness; 1102 goto err_remove_brightness;
1103 1103
1104 acpi_device_dir(device) = device_dir;
1105
1104 return 0; 1106 return 0;
1105 1107
1106 err_remove_brightness: 1108 err_remove_brightness:
@@ -1346,21 +1348,21 @@ static int acpi_video_bus_add_fs(struct acpi_device *device)
1346 device_dir->owner = THIS_MODULE; 1348 device_dir->owner = THIS_MODULE;
1347 1349
1348 /* 'info' [R] */ 1350 /* 'info' [R] */
1349 entry = proc_create_data("info", S_IRUGO, acpi_device_dir(device), 1351 entry = proc_create_data("info", S_IRUGO, device_dir,
1350 &acpi_video_bus_info_fops, 1352 &acpi_video_bus_info_fops,
1351 acpi_driver_data(device)); 1353 acpi_driver_data(device));
1352 if (!entry) 1354 if (!entry)
1353 goto err_remove_dir; 1355 goto err_remove_dir;
1354 1356
1355 /* 'ROM' [R] */ 1357 /* 'ROM' [R] */
1356 entry = proc_create_data("ROM", S_IRUGO, acpi_device_dir(device), 1358 entry = proc_create_data("ROM", S_IRUGO, device_dir,
1357 &acpi_video_bus_ROM_fops, 1359 &acpi_video_bus_ROM_fops,
1358 acpi_driver_data(device)); 1360 acpi_driver_data(device));
1359 if (!entry) 1361 if (!entry)
1360 goto err_remove_info; 1362 goto err_remove_info;
1361 1363
1362 /* 'POST_info' [R] */ 1364 /* 'POST_info' [R] */
1363 entry = proc_create_data("POST_info", S_IRUGO, acpi_device_dir(device), 1365 entry = proc_create_data("POST_info", S_IRUGO, device_dir,
1364 &acpi_video_bus_POST_info_fops, 1366 &acpi_video_bus_POST_info_fops,
1365 acpi_driver_data(device)); 1367 acpi_driver_data(device));
1366 if (!entry) 1368 if (!entry)
@@ -1369,7 +1371,7 @@ static int acpi_video_bus_add_fs(struct acpi_device *device)
1369 /* 'POST' [R/W] */ 1371 /* 'POST' [R/W] */
1370 acpi_video_bus_POST_fops.write = acpi_video_bus_write_POST; 1372 acpi_video_bus_POST_fops.write = acpi_video_bus_write_POST;
1371 entry = proc_create_data("POST", S_IFREG | S_IRUGO | S_IWUSR, 1373 entry = proc_create_data("POST", S_IFREG | S_IRUGO | S_IWUSR,
1372 acpi_device_dir(device), 1374 device_dir,
1373 &acpi_video_bus_POST_fops, 1375 &acpi_video_bus_POST_fops,
1374 acpi_driver_data(device)); 1376 acpi_driver_data(device));
1375 if (!entry) 1377 if (!entry)
@@ -1378,7 +1380,7 @@ static int acpi_video_bus_add_fs(struct acpi_device *device)
1378 /* 'DOS' [R/W] */ 1380 /* 'DOS' [R/W] */
1379 acpi_video_bus_DOS_fops.write = acpi_video_bus_write_DOS; 1381 acpi_video_bus_DOS_fops.write = acpi_video_bus_write_DOS;
1380 entry = proc_create_data("DOS", S_IFREG | S_IRUGO | S_IWUSR, 1382 entry = proc_create_data("DOS", S_IFREG | S_IRUGO | S_IWUSR,
1381 acpi_device_dir(device), 1383 device_dir,
1382 &acpi_video_bus_DOS_fops, 1384 &acpi_video_bus_DOS_fops,
1383 acpi_driver_data(device)); 1385 acpi_driver_data(device));
1384 if (!entry) 1386 if (!entry)