Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: okaya@codeaurora.org (Sinan Kaya)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V3] ACPI / GED: unregister interrupts during shutdown
Date: Fri, 8 Dec 2017 20:54:15 -0500	[thread overview]
Message-ID: <158410c8-2861-a2c9-1246-9604ab9a8e91@codeaurora.org> (raw)
In-Reply-To: <CAJZ5v0iqXz-zBb5Lg_f1FU54-H5hiWcfg-1Qa3hDdbUz=hZD0g@mail.gmail.com>

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.

  reply	other threads:[~2017-12-09  1:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-08  4:40 [PATCH V3] ACPI / GED: unregister interrupts during shutdown Sinan Kaya
2017-12-08 13:54 ` Rafael J. Wysocki
2017-12-09  1:54   ` Sinan Kaya [this message]
2017-12-09 14:12     ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=158410c8-2861-a2c9-1246-9604ab9a8e91@codeaurora.org \
    --to=okaya@codeaurora.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox