lkml.org 
[lkml]   [2017]   [Dec]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH V3] ACPI / GED: unregister interrupts during shutdown
From
Date
On 12/8/2017 8:54 AM, Rafael J. Wysocki wrote:
>> static int ged_remove(struct platform_device *pdev)
>> +{
>> + struct acpi_ged_device *geddev = platform_get_drvdata(pdev);
>>
>> + ged_cleanup_irq(geddev);
> Do you really need this duplication? You may as well call
> ged_shutdown() from here.
>
> And the local variable is redundant too.
>
> I guess it would be better to just fold ged_cleanup_irq() into
> ged_shutdown() and call that from ged_remove().
>

I originally tried to make these two APIs as common as possible and tried
calling shutdown from remove. However, the calling convention of shutdown
and remove are different.

Shutdown returns void; whereas, remove returns an integer. That's why, I
created a common function and called from both places.

I can probably make the calling parameter of ged_cleanup_irq() a pdev and
get rid of the additional casting in these two different functions.

Let me know if you have a better idea.

--
Sinan Kaya
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.

\
 
 \ /
  Last update: 2017-12-09 02:55    [W:0.328 / U:0.508 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site