Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1429056 > unrolled thread
| Started by | Arvind Yadav <arvind.yadav.cs@gmail.com> |
|---|---|
| First post | 2016-06-22 21:10 +0200 |
| Last post | 2016-06-23 03:40 +0200 |
| Articles | 3 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH] ACPI : Dummy acpi_video_register should return error code Arvind Yadav <arvind.yadav.cs@gmail.com> - 2016-06-22 21:10 +0200
Re: [PATCH] ACPI : Dummy acpi_video_register should return error code "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2016-06-22 23:10 +0200
Re: [PATCH] ACPI : Dummy acpi_video_register should return error code Aaron Lu <aaron.lu@intel.com> - 2016-06-23 03:40 +0200
| From | Arvind Yadav <arvind.yadav.cs@gmail.com> |
|---|---|
| Date | 2016-06-22 21:10 +0200 |
| Subject | [PATCH] ACPI : Dummy acpi_video_register should return error code |
| Message-ID | <rMVHb-7u5-1@gated-at.bofh.it> |
The inline acpi_video_register stub simply allows compilation on systems
with CONFIG_ACPI_VIDEO disabled. the dummy acpi_video_register does not
register an acpi_bus_driver at all. The inline acpi_video_register should
return to indicate lack of support when attempting to register an
acpi_bus_driver on such a system with CONFIG_ACPI_VIDEO disabled.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
include/acpi/video.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/acpi/video.h b/include/acpi/video.h
index 5731ccb..4536bd3 100644
--- a/include/acpi/video.h
+++ b/include/acpi/video.h
@@ -54,7 +54,7 @@ extern int acpi_video_get_levels(struct acpi_device *device,
struct acpi_video_device_brightness **dev_br,
int *pmax_level);
#else
-static inline int acpi_video_register(void) { return 0; }
+static inline int acpi_video_register(void) { return -ENODEV; }
static inline void acpi_video_unregister(void) { return; }
static inline int acpi_video_get_edid(struct acpi_device *device, int type,
int device_id, void **edid)
--
1.9.1
[toc] | [next] | [standalone]
| From | "Rafael J. Wysocki" <rjw@rjwysocki.net> |
|---|---|
| Date | 2016-06-22 23:10 +0200 |
| Message-ID | <rMXzj-eH-7@gated-at.bofh.it> |
| In reply to | #1429056 |
On Thursday, June 23, 2016 12:26:01 AM Arvind Yadav wrote:
> The inline acpi_video_register stub simply allows compilation on systems
> with CONFIG_ACPI_VIDEO disabled. the dummy acpi_video_register does not
> register an acpi_bus_driver at all. The inline acpi_video_register should
> return to indicate lack of support when attempting to register an
> acpi_bus_driver on such a system with CONFIG_ACPI_VIDEO disabled.
>
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> ---
> include/acpi/video.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/acpi/video.h b/include/acpi/video.h
> index 5731ccb..4536bd3 100644
> --- a/include/acpi/video.h
> +++ b/include/acpi/video.h
> @@ -54,7 +54,7 @@ extern int acpi_video_get_levels(struct acpi_device *device,
> struct acpi_video_device_brightness **dev_br,
> int *pmax_level);
> #else
> -static inline int acpi_video_register(void) { return 0; }
> +static inline int acpi_video_register(void) { return -ENODEV; }
> static inline void acpi_video_unregister(void) { return; }
> static inline int acpi_video_get_edid(struct acpi_device *device, int type,
> int device_id, void **edid)
Aaron, what do you think?
[toc] | [prev] | [next] | [standalone]
| From | Aaron Lu <aaron.lu@intel.com> |
|---|---|
| Date | 2016-06-23 03:40 +0200 |
| Message-ID | <rN1MC-2UJ-15@gated-at.bofh.it> |
| In reply to | #1429110 |
On 06/23/2016 05:05 AM, Rafael J. Wysocki wrote:
> On Thursday, June 23, 2016 12:26:01 AM Arvind Yadav wrote:
>> The inline acpi_video_register stub simply allows compilation on systems
>> with CONFIG_ACPI_VIDEO disabled. the dummy acpi_video_register does not
>> register an acpi_bus_driver at all. The inline acpi_video_register should
>> return to indicate lack of support when attempting to register an
>> acpi_bus_driver on such a system with CONFIG_ACPI_VIDEO disabled.
>>
>> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
>> ---
>> include/acpi/video.h | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/include/acpi/video.h b/include/acpi/video.h
>> index 5731ccb..4536bd3 100644
>> --- a/include/acpi/video.h
>> +++ b/include/acpi/video.h
>> @@ -54,7 +54,7 @@ extern int acpi_video_get_levels(struct acpi_device *device,
>> struct acpi_video_device_brightness **dev_br,
>> int *pmax_level);
>> #else
>> -static inline int acpi_video_register(void) { return 0; }
>> +static inline int acpi_video_register(void) { return -ENODEV; }
>> static inline void acpi_video_unregister(void) { return; }
>> static inline int acpi_video_get_edid(struct acpi_device *device, int type,
>> int device_id, void **edid)
>
> Aaron, what do you think?
The only place that cares about the return value of acpi_video_register
is in acpi_video_init where CONFIG_ACPI_VIDEO must be defined, all other
places do not care about the return value so this change shouldn't cause
any problems and returning -ENODEV sounds more reasonable than 0 here.
Reviewed-by: Aaron Lu <aaron.lu@intel.com>
Regards,
Aaron
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web