From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753780AbdLIByX (ORCPT ); Fri, 8 Dec 2017 20:54:23 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:35426 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752660AbdLIByT (ORCPT ); Fri, 8 Dec 2017 20:54:19 -0500 DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 519D060581 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=okaya@codeaurora.org Subject: Re: [PATCH V3] ACPI / GED: unregister interrupts during shutdown To: "Rafael J. Wysocki" Cc: ACPI Devel Maling List , Timur Tabi , linux-arm-msm@vger.kernel.org, "linux-arm-kernel@lists.infradead.org" , "Rafael J. Wysocki" , Len Brown , Linux Kernel Mailing List References: <1512708033-28180-1-git-send-email-okaya@codeaurora.org> From: Sinan Kaya Message-ID: <158410c8-2861-a2c9-1246-9604ab9a8e91@codeaurora.org> Date: Fri, 8 Dec 2017 20:54:15 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.