From mboxrd@z Thu Jan 1 00:00:00 1970 From: sathya Subject: Re: [RFC v1 2/6] platform/x86: intel_pmc_ipc: Use devm_* calls in driver probe Date: Mon, 21 Aug 2017 22:05:09 -0700 Message-ID: <55cbf2a1-b5c6-c320-a8b6-4475680cdb3e@gmail.com> References: <5147288461b861d1b956e1adc3f1d61192086c34.1501610760.git.sathyanarayanan.kuppuswamy@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from mail-pf0-f194.google.com ([209.85.192.194]:33213 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750899AbdHVFFL (ORCPT ); Tue, 22 Aug 2017 01:05:11 -0400 In-Reply-To: Content-Language: en-US Sender: platform-driver-x86-owner@vger.kernel.org List-ID: To: Andy Shevchenko , Kuppuswamy Sathyanarayanan Cc: "x86@kernel.org" , Ingo Molnar , Zha Qipeng , "H. Peter Anvin" , "dvhart@infradead.org" , Thomas Gleixner , Andy Shevchenko , "linux-kernel@vger.kernel.org" , Platform Driver Hi, On 08/18/2017 05:24 AM, Andy Shevchenko wrote: > On Tue, Aug 1, 2017 at 9:13 PM, > wrote: >> From: Kuppuswamy Sathyanarayanan >> >> This patch cleans up unnecessary free/alloc calls in this driver >> by using devm_* calls. >> static int ipc_plat_remove(struct platform_device *pdev) >> { >> - struct resource *res; >> - >> sysfs_remove_group(&pdev->dev.kobj, &intel_ipc_group); >> - free_irq(ipcdev.irq, &ipcdev); > Can we get an IRQ at any time here? Yes, if the ipc_plat_probe() is successful then ipcdev.irq will have valid IRQ in all cases. > >> platform_device_unregister(ipcdev.tco_dev); >> platform_device_unregister(ipcdev.punit_dev); >> platform_device_unregister(ipcdev.telemetry_dev); >> ipcdev.dev = NULL; >> return 0; >> } > - Sathya