diff options
author | Toshi Kani <toshi.kani@hp.com> | 2013-03-04 16:30:41 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-03-24 18:49:38 -0400 |
commit | d4e1a692e9e85f9cbee090ea8d6158b133d32157 (patch) | |
tree | d6b76ddfc967c7631f0c192af06fb3b7b70047c6 /drivers/acpi/video_detect.c | |
parent | b09753ec80914424527955147c359e9ac3a87682 (diff) |
ACPI: Remove acpi_device dependency in acpi_device_set_id()
This patch updates the internal operations of acpi_device_set_id()
to setup acpi_device_pnp without using acpi_device. There is no
functional change to acpi_device_set_id() in this patch.
acpi_pnp_type is added to acpi_device_pnp, so that PNPID type is
self-contained within acpi_device_pnp. acpi_add_id(), acpi_bay_match(),
acpi_dock_match(), acpi_ibm_smbus_match() and acpi_is_video_device()
are changed to take acpi_handle as an argument, instead of acpi_device.
Signed-off-by: Toshi Kani <toshi.kani@hp.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/video_detect.c')
-rw-r--r-- | drivers/acpi/video_detect.c | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c index 4ac2593234e7..66f67626f02e 100644 --- a/drivers/acpi/video_detect.c +++ b/drivers/acpi/video_detect.c | |||
@@ -67,40 +67,37 @@ acpi_backlight_cap_match(acpi_handle handle, u32 level, void *context, | |||
67 | return 0; | 67 | return 0; |
68 | } | 68 | } |
69 | 69 | ||
70 | /* Returns true if the device is a video device which can be handled by | 70 | /* Returns true if the ACPI object is a video device which can be |
71 | * video.ko. | 71 | * handled by video.ko. |
72 | * The device will get a Linux specific CID added in scan.c to | 72 | * The device will get a Linux specific CID added in scan.c to |
73 | * identify the device as an ACPI graphics device | 73 | * identify the device as an ACPI graphics device |
74 | * Be aware that the graphics device may not be physically present | 74 | * Be aware that the graphics device may not be physically present |
75 | * Use acpi_video_get_capabilities() to detect general ACPI video | 75 | * Use acpi_video_get_capabilities() to detect general ACPI video |
76 | * capabilities of present cards | 76 | * capabilities of present cards |
77 | */ | 77 | */ |
78 | long acpi_is_video_device(struct acpi_device *device) | 78 | long acpi_is_video_device(acpi_handle handle) |
79 | { | 79 | { |
80 | acpi_handle h_dummy; | 80 | acpi_handle h_dummy; |
81 | long video_caps = 0; | 81 | long video_caps = 0; |
82 | 82 | ||
83 | if (!device) | ||
84 | return 0; | ||
85 | |||
86 | /* Is this device able to support video switching ? */ | 83 | /* Is this device able to support video switching ? */ |
87 | if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_DOD", &h_dummy)) || | 84 | if (ACPI_SUCCESS(acpi_get_handle(handle, "_DOD", &h_dummy)) || |
88 | ACPI_SUCCESS(acpi_get_handle(device->handle, "_DOS", &h_dummy))) | 85 | ACPI_SUCCESS(acpi_get_handle(handle, "_DOS", &h_dummy))) |
89 | video_caps |= ACPI_VIDEO_OUTPUT_SWITCHING; | 86 | video_caps |= ACPI_VIDEO_OUTPUT_SWITCHING; |
90 | 87 | ||
91 | /* Is this device able to retrieve a video ROM ? */ | 88 | /* Is this device able to retrieve a video ROM ? */ |
92 | if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_ROM", &h_dummy))) | 89 | if (ACPI_SUCCESS(acpi_get_handle(handle, "_ROM", &h_dummy))) |
93 | video_caps |= ACPI_VIDEO_ROM_AVAILABLE; | 90 | video_caps |= ACPI_VIDEO_ROM_AVAILABLE; |
94 | 91 | ||
95 | /* Is this device able to configure which video head to be POSTed ? */ | 92 | /* Is this device able to configure which video head to be POSTed ? */ |
96 | if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_VPO", &h_dummy)) && | 93 | if (ACPI_SUCCESS(acpi_get_handle(handle, "_VPO", &h_dummy)) && |
97 | ACPI_SUCCESS(acpi_get_handle(device->handle, "_GPD", &h_dummy)) && | 94 | ACPI_SUCCESS(acpi_get_handle(handle, "_GPD", &h_dummy)) && |
98 | ACPI_SUCCESS(acpi_get_handle(device->handle, "_SPD", &h_dummy))) | 95 | ACPI_SUCCESS(acpi_get_handle(handle, "_SPD", &h_dummy))) |
99 | video_caps |= ACPI_VIDEO_DEVICE_POSTING; | 96 | video_caps |= ACPI_VIDEO_DEVICE_POSTING; |
100 | 97 | ||
101 | /* Only check for backlight functionality if one of the above hit. */ | 98 | /* Only check for backlight functionality if one of the above hit. */ |
102 | if (video_caps) | 99 | if (video_caps) |
103 | acpi_walk_namespace(ACPI_TYPE_DEVICE, device->handle, | 100 | acpi_walk_namespace(ACPI_TYPE_DEVICE, handle, |
104 | ACPI_UINT32_MAX, acpi_backlight_cap_match, NULL, | 101 | ACPI_UINT32_MAX, acpi_backlight_cap_match, NULL, |
105 | &video_caps, NULL); | 102 | &video_caps, NULL); |
106 | 103 | ||
@@ -127,7 +124,7 @@ find_video(acpi_handle handle, u32 lvl, void *context, void **rv) | |||
127 | if (!dev) | 124 | if (!dev) |
128 | return AE_OK; | 125 | return AE_OK; |
129 | pci_dev_put(dev); | 126 | pci_dev_put(dev); |
130 | *cap |= acpi_is_video_device(acpi_dev); | 127 | *cap |= acpi_is_video_device(handle); |
131 | } | 128 | } |
132 | return AE_OK; | 129 | return AE_OK; |
133 | } | 130 | } |