mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ACPI : Dummy acpi_video_register should return error code
@ 2016-06-22 18:56 Arvind Yadav
  2016-06-22 21:05 ` Rafael J. Wysocki
  0 siblings, 1 reply; 4+ messages in thread
From: Arvind Yadav @ 2016-06-22 18:56 UTC (permalink / raw)
  To: robert.moore
  Cc: lv.zheng, rafael.j.wysocki, lenb, linux-acpi, devel,
	linux-kernel, Arvind Yadav

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ACPI : Dummy acpi_video_register should return error code
  2016-06-22 18:56 [PATCH] ACPI : Dummy acpi_video_register should return error code Arvind Yadav
@ 2016-06-22 21:05 ` Rafael J. Wysocki
  2016-06-23  1:35   ` Aaron Lu
  0 siblings, 1 reply; 4+ messages in thread
From: Rafael J. Wysocki @ 2016-06-22 21:05 UTC (permalink / raw)
  To: Arvind Yadav, Aaron Lu
  Cc: robert.moore, lv.zheng, rafael.j.wysocki, lenb, linux-acpi,
	devel, linux-kernel

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?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ACPI : Dummy acpi_video_register should return error code
  2016-06-22 21:05 ` Rafael J. Wysocki
@ 2016-06-23  1:35   ` Aaron Lu
  2016-07-04 13:01     ` Rafael J. Wysocki
  0 siblings, 1 reply; 4+ messages in thread
From: Aaron Lu @ 2016-06-23  1:35 UTC (permalink / raw)
  To: Rafael J. Wysocki, Arvind Yadav
  Cc: robert.moore, lv.zheng, rafael.j.wysocki, lenb, linux-acpi,
	devel, linux-kernel

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ACPI : Dummy acpi_video_register should return error code
  2016-06-23  1:35   ` Aaron Lu
@ 2016-07-04 13:01     ` Rafael J. Wysocki
  0 siblings, 0 replies; 4+ messages in thread
From: Rafael J. Wysocki @ 2016-07-04 13:01 UTC (permalink / raw)
  To: Aaron Lu, Arvind Yadav
  Cc: robert.moore, lv.zheng, rafael.j.wysocki, lenb, linux-acpi,
	devel, linux-kernel

On Thursday, June 23, 2016 09:35:01 AM Aaron Lu wrote:
> 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>

Patch applied, thanks!

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-07-04 12:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-22 18:56 [PATCH] ACPI : Dummy acpi_video_register should return error code Arvind Yadav
2016-06-22 21:05 ` Rafael J. Wysocki
2016-06-23  1:35   ` Aaron Lu
2016-07-04 13:01     ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®